diff options
Diffstat (limited to 'src/yuescript/yue_parser.cpp')
-rw-r--r-- | src/yuescript/yue_parser.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 607edc9..255469d 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
@@ -244,10 +244,11 @@ YueParser::YueParser() { | |||
244 | IfCond = disable_chain(Exp >> -Assign); | 244 | IfCond = disable_chain(Exp >> -Assign); |
245 | IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> plain_body_with("then"); | 245 | IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> plain_body_with("then"); |
246 | IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> plain_body; | 246 | IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> plain_body; |
247 | If = key("if") >> Seperator >> IfCond >> plain_body_with("then") >> *IfElseIf >> -IfElse; | 247 | IfType = (expr("if") | expr("unless")) >> not_(AlphaNum); |
248 | Unless = key("unless") >> Seperator >> IfCond >> plain_body_with("then") >> *IfElseIf >> -IfElse; | 248 | If = Space >> IfType >> IfCond >> plain_body_with("then") >> *IfElseIf >> -IfElse; |
249 | 249 | ||
250 | While = key("while") >> disable_do_chain(Exp) >> plain_body_with("do"); | 250 | WhileType = (expr("while") | expr("until")) >> not_(AlphaNum); |
251 | While = Space >> WhileType >> disable_do_chain(Exp) >> plain_body_with("do"); | ||
251 | Repeat = key("repeat") >> Body >> Break >> *EmptyLine >> CheckIndent >> key("until") >> Exp; | 252 | Repeat = key("repeat") >> Body >> Break >> *EmptyLine >> CheckIndent >> key("until") >> Exp; |
252 | 253 | ||
253 | for_step_value = sym(',') >> Exp; | 254 | for_step_value = sym(',') >> Exp; |
@@ -607,7 +608,7 @@ YueParser::YueParser() { | |||
607 | 608 | ||
608 | SimpleValue = | 609 | SimpleValue = |
609 | (Space >> const_value) | | 610 | (Space >> const_value) | |
610 | If | Unless | Switch | With | ClassDecl | ForEach | For | While | Do | | 611 | If | Switch | With | ClassDecl | ForEach | For | While | Do | |
611 | (Space >> unary_value) | | 612 | (Space >> unary_value) | |
612 | TblComprehension | TableLit | Comprehension | FunLit | | 613 | TblComprehension | TableLit | Comprehension | FunLit | |
613 | (Space >> Num); | 614 | (Space >> Num); |