Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / Parser.cpp
diff options
context:
space:
mode:
Commit407a57944600619a6693dfc4d8c525163bea0e13 (patch)
Author
 Dimitar Trendafilov <trendafilov.dn@gmail.com>
2020-11-02 09:05:58 +0200
Committer
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2020-11-09 22:08:19 +0200
Files6094d4c5dac3af5c56e1bc379a16a32f60b66103 /JSImpl/src/Parser.cpp
IPL-407a57944600619a6693dfc4d8c525163bea0e13.tar
IPL-407a57944600619a6693dfc4d8c525163bea0e13.tar.gz
IPL-407a57944600619a6693dfc4d8c525163bea0e13.zip
Parent0d0159f70b0f3b23d6a4187d43167ded6b104e0f (diff)
Fix value of LiteralString nodes
1 files changed, 5 insertions, 1 deletions
-rw-r--r--JSImpl/src/Parser.cpp6
diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp
index 89ba3df..bc4920f 100644
--- a/JSImpl/src/Parser.cpp
+++ b/JSImpl/src/Parser.cpp
@@ -320,7 +320,11 @@ ExpressionPtr Parser::SimpleExpression()
}
else if (Match(TokenType::String))
{
- return IPLMakeSharePtr<LiteralString>(Prev().Lexeme);
+ const auto& lexeme = Prev().Lexeme;
+ const auto length = lexeme.length();
+ assert(length >= 2);
+ auto value = lexeme.substr(1, length-2);
+ return IPLMakeSharePtr<LiteralString>(value);
}
else if (Match(TokenType::Null))
{