diff options
| Commit | 953f1748ec99d796cc39143796ca06de03123088 (patch) | |
|---|---|---|
| Author | 2018-09-26 08:55:46 +0300 | |
| Committer | 2018-09-26 09:22:22 +0300 | |
| Files | d72e52e31da53437c031d41365d3e49f9f53ce62 /JSImpl/src/Parser.cpp | |
| IPL-953f1748ec99d796cc39143796ca06de03123088.tar IPL-953f1748ec99d796cc39143796ca06de03123088.tar.gz IPL-953f1748ec99d796cc39143796ca06de03123088.zip | ||
| Parent | 1577e442a12a92640bb3b2ee399a4492706d00f5 (diff) | |
Fix assignment and logical operators parsing
1 files changed, 6 insertions, 2 deletions
| -rw-r--r-- | JSImpl/src/Parser.cpp | 8 |
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<VariableDefinitionExpression>(id, ae); } return nullptr; |
