From acf20e1802b03fed63b845ac8c0274fff415fb22 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 6 Aug 2020 12:11:01 +0800 Subject: fix a case multiline binary operator expression conflicts with new statement started with an unary expression. --- src/MoonP/moon_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/MoonP/moon_parser.cpp') diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index 43e6887..6fa014f 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp @@ -308,9 +308,9 @@ MoonParser::MoonParser() { expo_exp = Value >> *expo_value; unary_operator = - expr('-') >> not_(expr('>') | space_one) | + expr('-') >> not_(set(">=") | space_one) | expr('#') | - expr('~') >> not_(space_one) | + expr('~') >> not_(expr('=') | space_one) | expr("not") >> not_(AlphaNum); unary_exp = *(Space >> unary_operator) >> expo_exp; @@ -331,7 +331,7 @@ MoonParser::MoonParser() { expr(">>") | expr("//") | set("+-*/%><|&~"); - exp_op_value = White >> BinaryOperator >> *SpaceBreak >> backcall_exp; + exp_op_value = (White >> not_(unary_operator) | Space) >> BinaryOperator >> *SpaceBreak >> backcall_exp; Exp = Seperator >> backcall_exp >> *exp_op_value; ChainValue = Seperator >> (Chain | Callable) >> -existential_op >> -InvokeArgs; -- cgit v1.2.3-55-g6feb