Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / Parser.cpp
diff options
context:
space:
mode:
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))
{