aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_parser.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-05-02 14:41:40 +0800
committerLi Jin <dragon-fly@qq.com>2020-05-02 14:41:40 +0800
commit6402a8896c78440aee03cc4b7bb315fc236e6ff8 (patch)
treea5c23153a2285ae4ae79d9b1ff5b64f39f7c379f /src/MoonP/moon_parser.cpp
parent5eac89411f056e4e6ad56c9a41944a341780d68b (diff)
downloadyuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.tar.gz
yuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.tar.bz2
yuescript-6402a8896c78440aee03cc4b7bb315fc236e6ff8.zip
fix Moonscript issue 416: ambiguous Lua output in some cases.
Diffstat (limited to 'src/MoonP/moon_parser.cpp')
-rw-r--r--src/MoonP/moon_parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp
index 4f12a34..5b537a1 100644
--- a/src/MoonP/moon_parser.cpp
+++ b/src/MoonP/moon_parser.cpp
@@ -538,12 +538,13 @@ MoonParser::MoonParser() {
538 unless_line = key("unless") >> Exp; 538 unless_line = key("unless") >> Exp;
539 539
540 statement_appendix = (if_line | unless_line | CompInner) >> Space; 540 statement_appendix = (if_line | unless_line | CompInner) >> Space;
541 statement_sep = and_(*SpaceBreak >> CheckIndent >> Space >> (set("($'\"") | expr("[[") | expr("[=")));
541 Statement = ( 542 Statement = (
542 Import | While | Repeat | For | ForEach | 543 Import | While | Repeat | For | ForEach |
543 Return | Local | Global | Export | Macro | 544 Return | Local | Global | Export | Macro |
544 Space >> BreakLoop | Label | Goto | Backcall | ExpListAssign 545 Space >> BreakLoop | Label | Goto | Backcall | ExpListAssign
545 ) >> Space >> 546 ) >> Space >>
546 -statement_appendix; 547 -statement_appendix >> -statement_sep;
547 548
548 Body = Space >> Break >> *EmptyLine >> InBlock | Statement; 549 Body = Space >> Break >> *EmptyLine >> InBlock | Statement;
549 550