From 953f1748ec99d796cc39143796ca06de03123088 Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Wed, 26 Sep 2018 08:55:46 +0300 Subject: Fix assignment and logical operators parsing --- JSImpl/src/Parser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'JSImpl/src/Parser.cpp') diff --git a/JSImpl/src/Parser.cpp b/JSImpl/src/Parser.cpp index df2006f..feb302c 100644 --- a/JSImpl/src/Parser.cpp +++ b/JSImpl/src/Parser.cpp @@ -592,7 +592,7 @@ ExpressionPtr Parser::ConditionalExpression() // TODO log parsing error assert(false); } - return LogicalExpression(); + return condition; } ExpressionPtr Parser::AssignmentExpression() @@ -688,7 +688,11 @@ ExpressionPtr Parser::VariableDefinition() if (Match(TokenType::Identifier)) { auto id = Prev().Lexeme; - auto ae = AssignmentExpression(); + auto ae = CreateEmptyExpression(); + if (Match(TokenType::Equal)) + { + auto ae = AssignmentExpression(); + } return IPLMakeSharePtr(id, ae); } return nullptr; -- cgit v1.3.1-23-gd82d