diff options
Diffstat (limited to 'src/yuescript/yue_parser.cpp')
-rwxr-xr-x | src/yuescript/yue_parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 8325366..258997e 100755 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -237,7 +237,8 @@ YueParser::YueParser() { | |||
237 | Switch = Space >> key("switch") >> disable_do(Exp) >> -(Space >> key("do")) | 237 | Switch = Space >> key("switch") >> disable_do(Exp) >> -(Space >> key("do")) |
238 | >> -Space >> Break >> SwitchBlock; | 238 | >> -Space >> Break >> SwitchBlock; |
239 | 239 | ||
240 | IfCond = disable_do_chain(disable_arg_table_block(Exp >> -Assign)); | 240 | assignment = ExpList >> Assign; |
241 | IfCond = disable_do_chain(disable_arg_table_block(assignment | Exp)); | ||
241 | IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> Space >> key("elseif") >> IfCond >> plain_body_with("then"); | 242 | IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> Space >> key("elseif") >> IfCond >> plain_body_with("then"); |
242 | IfElse = -(Break >> *EmptyLine >> CheckIndent) >> Space >> key("else") >> plain_body; | 243 | IfElse = -(Break >> *EmptyLine >> CheckIndent) >> Space >> key("else") >> plain_body; |
243 | IfType = (expr("if") | expr("unless")) >> not_(AlphaNum); | 244 | IfType = (expr("if") | expr("unless")) >> not_(AlphaNum); |
@@ -619,10 +620,9 @@ YueParser::YueParser() { | |||
619 | 620 | ||
620 | ExpListAssign = ExpList >> -(Update | Assign); | 621 | ExpListAssign = ExpList >> -(Update | Assign); |
621 | 622 | ||
622 | if_line = Space >> key("if") >> Exp >> -Assign; | 623 | if_line = Space >> IfType >> IfCond; |
623 | unless_line = Space >> key("unless") >> Exp; | ||
624 | 624 | ||
625 | statement_appendix = (if_line | unless_line | CompInner) >> Space; | 625 | statement_appendix = (if_line | CompInner) >> Space; |
626 | statement_sep = and_(*SpaceBreak >> CheckIndent >> Space >> (set("($'\"") | expr("[[") | expr("[="))); | 626 | statement_sep = and_(*SpaceBreak >> CheckIndent >> Space >> (set("($'\"") | expr("[[") | expr("[="))); |
627 | Statement = Space >> ( | 627 | Statement = Space >> ( |
628 | Import | While | Repeat | For | ForEach | | 628 | Import | While | Repeat | For | ForEach | |