diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
| commit | ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch) | |
| tree | 427e365939da39f31dbfa755675fb60bb141583d /src/MoonP/moon_parser.cpp | |
| parent | 4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff) | |
| download | yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.gz yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.bz2 yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.zip | |
fix Moonscript issue 375.
Diffstat (limited to '')
| -rw-r--r-- | src/MoonP/moon_parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp index d3c0ed2..6d1b86c 100644 --- a/src/MoonP/moon_parser.cpp +++ b/src/MoonP/moon_parser.cpp | |||
| @@ -198,7 +198,7 @@ rule IfCond = Exp >> -Assign; | |||
| 198 | rule IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> -key("then") >> Body; | 198 | rule IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> -key("then") >> Body; |
| 199 | rule IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> Body; | 199 | rule IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> Body; |
| 200 | rule If = key("if") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; | 200 | rule If = key("if") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; |
| 201 | rule Unless = key("unless") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; | 201 | rule Unless = key("unless") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; |
| 202 | 202 | ||
| 203 | rule While = key("while") >> DisableDo >> ensure(Exp, PopDo) >> -key("do") >> Body; | 203 | rule While = key("while") >> DisableDo >> ensure(Exp, PopDo) >> -key("do") >> Body; |
| 204 | 204 | ||
| @@ -510,7 +510,7 @@ rule SimpleValue = | |||
| 510 | 510 | ||
| 511 | rule ExpListAssign = ExpList >> -(Update | Assign); | 511 | rule ExpListAssign = ExpList >> -(Update | Assign); |
| 512 | 512 | ||
| 513 | rule if_else_line = key("if") >> Exp >> (key("else") >> Exp | default_value); | 513 | rule if_else_line = key("if") >> Exp >> -Assign >> (key("else") >> Exp | default_value); |
| 514 | rule unless_line = key("unless") >> Exp; | 514 | rule unless_line = key("unless") >> Exp; |
| 515 | 515 | ||
| 516 | rule statement_appendix = (if_else_line | unless_line | CompInner) >> Space; | 516 | rule statement_appendix = (if_else_line | unless_line | CompInner) >> Space; |
