Skip to content

Commit f472477

Browse files
committed
fix: terminal symbols handling in BytecodeParser
1 parent 74c4775 commit f472477

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/bytecode_parser/ParsingSession.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "ParsingSession.hpp"
22

33
#include <tokens/EofToken.hpp>
4+
#include <tokens/LiteralToken.hpp>
5+
#include <tokens/values/StringValue.hpp>
46

57
namespace ovum::bytecode::parser {
68

@@ -118,7 +120,8 @@ std::expected<std::string, BytecodeParserError> ParsingSession::ConsumeStringLit
118120
std::to_string(token->GetPosition().GetColumn())));
119121
}
120122

121-
std::string value = Current()->GetLexeme();
123+
std::string value =
124+
dynamic_cast<StringValue*>(dynamic_cast<ovum::LiteralToken*>(Current().get())->GetValue())->ToString();
122125

123126
value = value.substr(1, value.length() - 2);
124127

0 commit comments

Comments
 (0)