From 6c2f7812f65b4a5c60f85297d1bc4f918e32936e Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Sat, 3 Nov 2018 14:47:20 +0200 Subject: Introduce interactive interpreter. --- JSImpl/src/Parser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'JSImpl/src/Parser.cpp') diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index b0d394b..8c387c8 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -470,9 +470,10 @@ ExpressionPtr Parser::Unary() TokenType::Bang, })) { + auto type = Prev().Type; auto ls = Unary(); auto suffix = false; - return IPLMakeSharePtr(ls, Prev().Type, suffix); + return IPLMakeSharePtr(ls, type, suffix); } else { @@ -662,8 +663,9 @@ ExpressionPtr Parser::AssignmentExpression() TokenType::BitwiseXorEqual, TokenType::BitwiseOrEqual })) { + auto type = Prev().Type; auto right = AssignmentExpression(); - return IPLMakeSharePtr(left, right, Prev().Type); + return IPLMakeSharePtr(left, right, type); } // revert state; m_Current = snapShot; @@ -675,10 +677,11 @@ ExpressionPtr Parser::Expression() auto ae = AssignmentExpression(); while (Match(TokenType::Comma)) { + auto type = Prev().Type; auto next = AssignmentExpression(); if (next) { - ae = IPLMakeSharePtr(ae, next, Prev().Type); + ae = IPLMakeSharePtr(ae, next, type); } else { -- cgit v1.3.1-23-gd82d