From 407a57944600619a6693dfc4d8c525163bea0e13 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 2 Nov 2020 09:05:58 +0200 Subject: Fix value of LiteralString nodes --- JSImpl/src/Parser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'JSImpl/src/Parser.cpp') 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(Prev().Lexeme); + const auto& lexeme = Prev().Lexeme; + const auto length = lexeme.length(); + assert(length >= 2); + auto value = lexeme.substr(1, length-2); + return IPLMakeSharePtr(value); } else if (Match(TokenType::Null)) { -- cgit v1.3.1-23-gd82d