diff options
author | Li Jin <dragon-fly@qq.com> | 2020-08-06 12:11:01 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-08-06 12:11:01 +0800 |
commit | acf20e1802b03fed63b845ac8c0274fff415fb22 (patch) | |
tree | f8410fa73f59ee31814e3b24dc9ec7a959a5a706 /src | |
parent | cb5371a7dcfde196db07f5a2a3f144888b73d522 (diff) | |
download | yuescript-acf20e1802b03fed63b845ac8c0274fff415fb22.tar.gz yuescript-acf20e1802b03fed63b845ac8c0274fff415fb22.tar.bz2 yuescript-acf20e1802b03fed63b845ac8c0274fff415fb22.zip |
fix a case multiline binary operator expression conflicts with new statement started with an unary expression.
Diffstat (limited to 'src')
-rw-r--r-- | src/MoonP/moon_compiler.cpp | 2 | ||||
-rw-r--r-- | src/MoonP/moon_parser.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index f517e27..1652e17 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
@@ -49,7 +49,7 @@ inline std::string s(std::string_view sv) { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | const std::string_view version() { | 51 | const std::string_view version() { |
52 | return "0.4.7"sv; | 52 | return "0.4.8"sv; |
53 | } | 53 | } |
54 | 54 | ||
55 | // name of table stored in lua registry | 55 | // name of table stored in lua registry |
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() { | |||
308 | expo_exp = Value >> *expo_value; | 308 | expo_exp = Value >> *expo_value; |
309 | 309 | ||
310 | unary_operator = | 310 | unary_operator = |
311 | expr('-') >> not_(expr('>') | space_one) | | 311 | expr('-') >> not_(set(">=") | space_one) | |
312 | expr('#') | | 312 | expr('#') | |
313 | expr('~') >> not_(space_one) | | 313 | expr('~') >> not_(expr('=') | space_one) | |
314 | expr("not") >> not_(AlphaNum); | 314 | expr("not") >> not_(AlphaNum); |
315 | unary_exp = *(Space >> unary_operator) >> expo_exp; | 315 | unary_exp = *(Space >> unary_operator) >> expo_exp; |
316 | 316 | ||
@@ -331,7 +331,7 @@ MoonParser::MoonParser() { | |||
331 | expr(">>") | | 331 | expr(">>") | |
332 | expr("//") | | 332 | expr("//") | |
333 | set("+-*/%><|&~"); | 333 | set("+-*/%><|&~"); |
334 | exp_op_value = White >> BinaryOperator >> *SpaceBreak >> backcall_exp; | 334 | exp_op_value = (White >> not_(unary_operator) | Space) >> BinaryOperator >> *SpaceBreak >> backcall_exp; |
335 | Exp = Seperator >> backcall_exp >> *exp_op_value; | 335 | Exp = Seperator >> backcall_exp >> *exp_op_value; |
336 | 336 | ||
337 | ChainValue = Seperator >> (Chain | Callable) >> -existential_op >> -InvokeArgs; | 337 | ChainValue = Seperator >> (Chain | Callable) >> -existential_op >> -InvokeArgs; |