diff options
Diffstat (limited to 'src/yuescript/yue_parser.cpp')
-rw-r--r-- | src/yuescript/yue_parser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index f72407d..294f1e5 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -317,18 +317,18 @@ YueParser::YueParser() { | |||
317 | with_exp = ExpList >> -(space >> Assign); | 317 | with_exp = ExpList >> -(space >> Assign); |
318 | 318 | ||
319 | With = key("with") >> -ExistentialOp >> space >> disable_do_chain_arg_table_block_rule(with_exp) >> space >> body_with("do"); | 319 | With = key("with") >> -ExistentialOp >> space >> disable_do_chain_arg_table_block_rule(with_exp) >> space >> body_with("do"); |
320 | SwitchCase = key("when") >> (disable_chain_rule(disable_arg_table_block_rule(SwitchList)) | space >> In) >> space >> body_with("then"); | 320 | SwitchCase = key("when") >> space >> (disable_chain_rule(disable_arg_table_block_rule(SwitchList)) | In) >> space >> body_with("then"); |
321 | switch_else = key("else") >> space >> body; | 321 | switch_else = key("else") >> space >> body; |
322 | 322 | ||
323 | switch_block = | 323 | switch_block = |
324 | *(line_break >> *space_break >> check_indent_match >> space >> SwitchCase) >> | 324 | *(line_break >> *space_break >> check_indent_match >> space >> SwitchCase) >> |
325 | -(line_break >> *space_break >> check_indent_match >> space >> switch_else); | 325 | -(line_break >> *space_break >> check_indent_match >> space >> switch_else); |
326 | 326 | ||
327 | exp_not_tab = not_(SimpleTable | TableLit) >> space >> Exp; | 327 | exp_not_tab = not_(SimpleTable | TableLit) >> Exp; |
328 | 328 | ||
329 | SwitchList = Seperator >> ( | 329 | SwitchList = Seperator >> ( |
330 | and_(SimpleTable | TableLit) >> space >> Exp | | 330 | and_(SimpleTable | TableLit) >> Exp | |
331 | exp_not_tab >> *(space >> ',' >> exp_not_tab) | 331 | exp_not_tab >> *(space >> ',' >> space >> exp_not_tab) |
332 | ); | 332 | ); |
333 | Switch = key("switch") >> space >> Exp >> | 333 | Switch = key("switch") >> space >> Exp >> |
334 | space >> Seperator >> ( | 334 | space >> Seperator >> ( |
@@ -458,8 +458,8 @@ YueParser::YueParser() { | |||
458 | InRangeClose = true_(); | 458 | InRangeClose = true_(); |
459 | NotIn = true_(); | 459 | NotIn = true_(); |
460 | InRange = ('(' >> InRangeOpen | '[' >> InRangeClose) >> space >> Exp >> space >> ',' >> space >> Exp >> space >> (')' >> InRangeOpen | ']' >> InRangeClose); | 460 | InRange = ('(' >> InRangeOpen | '[' >> InRangeClose) >> space >> Exp >> space >> ',' >> space >> Exp >> space >> (')' >> InRangeOpen | ']' >> InRangeClose); |
461 | InDiscrete = '{' >> Seperator >> space >> Exp >> *(space >> ',' >> space >> Exp) >> space >> '}'; | 461 | InDiscrete = '{' >> Seperator >> space >> exp_not_tab >> *(space >> ',' >> space >> exp_not_tab) >> space >> '}'; |
462 | In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete); | 462 | In = -(key("not") >> NotIn >> space) >> key("in") >> space >> (InRange | InDiscrete | Exp); |
463 | 463 | ||
464 | UnaryOperator = | 464 | UnaryOperator = |
465 | '-' >> not_(set(">=") | space_one) | | 465 | '-' >> not_(set(">=") | space_one) | |