aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_parser.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
committerLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
commited317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch)
tree427e365939da39f31dbfa755675fb60bb141583d /src/MoonP/moon_parser.cpp
parent4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff)
downloadyuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.gz
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.bz2
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.zip
fix Moonscript issue 375.
Diffstat (limited to 'src/MoonP/moon_parser.cpp')
-rw-r--r--src/MoonP/moon_parser.cpp4
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;
198rule IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> -key("then") >> Body; 198rule IfElseIf = -(Break >> *EmptyLine >> CheckIndent) >> key("elseif") >> IfCond >> -key("then") >> Body;
199rule IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> Body; 199rule IfElse = -(Break >> *EmptyLine >> CheckIndent) >> key("else") >> Body;
200rule If = key("if") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; 200rule If = key("if") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse;
201rule Unless = key("unless") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse; 201rule Unless = key("unless") >> Seperator >> IfCond >> -key("then") >> Body >> *IfElseIf >> -IfElse;
202 202
203rule While = key("while") >> DisableDo >> ensure(Exp, PopDo) >> -key("do") >> Body; 203rule While = key("while") >> DisableDo >> ensure(Exp, PopDo) >> -key("do") >> Body;
204 204
@@ -510,7 +510,7 @@ rule SimpleValue =
510 510
511rule ExpListAssign = ExpList >> -(Update | Assign); 511rule ExpListAssign = ExpList >> -(Update | Assign);
512 512
513rule if_else_line = key("if") >> Exp >> (key("else") >> Exp | default_value); 513rule if_else_line = key("if") >> Exp >> -Assign >> (key("else") >> Exp | default_value);
514rule unless_line = key("unless") >> Exp; 514rule unless_line = key("unless") >> Exp;
515 515
516rule statement_appendix = (if_else_line | unless_line | CompInner) >> Space; 516rule statement_appendix = (if_else_line | unless_line | CompInner) >> Space;