aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_parser.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-04-24 16:17:44 +0800
committerLi Jin <dragon-fly@qq.com>2020-04-24 16:17:44 +0800
commitfeac3c1cba6ca95b911240217f74a494680cd057 (patch)
treee85b6648a51c3355181bd1ad86f3a043c5223ee2 /src/MoonP/moon_parser.cpp
parentade971c9b5f5d367de72ab8e65e9c651ce87cc9a (diff)
downloadyuescript-feac3c1cba6ca95b911240217f74a494680cd057.tar.gz
yuescript-feac3c1cba6ca95b911240217f74a494680cd057.tar.bz2
yuescript-feac3c1cba6ca95b911240217f74a494680cd057.zip
fix errors when explicitly declaring global or local variable initialized with table block.
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 9208d3a..7de2a84 100644
--- a/src/MoonP/moon_parser.cpp
+++ b/src/MoonP/moon_parser.cpp
@@ -170,7 +170,7 @@ MoonParser::MoonParser() {
170 InBlock = Advance >> ensure(Block, PopIndent); 170 InBlock = Advance >> ensure(Block, PopIndent);
171 171
172 local_flag = expr('*') | expr('^'); 172 local_flag = expr('*') | expr('^');
173 local_values = NameList >> -(sym('=') >> ExpListLow); 173 local_values = NameList >> -(sym('=') >> (TableBlock | ExpListLow));
174 Local = key("local") >> (Space >> local_flag | local_values); 174 Local = key("local") >> (Space >> local_flag | local_values);
175 175
176 colon_import_name = sym('\\') >> Space >> Variable; 176 colon_import_name = sym('\\') >> Space >> Variable;
@@ -419,7 +419,7 @@ MoonParser::MoonParser() {
419 -(key("extends") >> PreventIndent >> ensure(Exp, PopIndent)) >> 419 -(key("extends") >> PreventIndent >> ensure(Exp, PopIndent)) >>
420 -ClassBlock; 420 -ClassBlock;
421 421
422 global_values = NameList >> -(sym('=') >> ExpListLow); 422 global_values = NameList >> -(sym('=') >> (TableBlock | ExpListLow));
423 global_op = expr('*') | expr('^'); 423 global_op = expr('*') | expr('^');
424 Global = key("global") >> (ClassDecl | (Space >> global_op) | global_values); 424 Global = key("global") >> (ClassDecl | (Space >> global_op) | global_values);
425 425