aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-09-18 17:24:03 +0800
committerLi Jin <dragon-fly@qq.com>2020-09-18 17:24:03 +0800
commit5b656d2913e4f9f0017698ec835ce4ddda1dc81f (patch)
treed5e4239aa264175b78f3c6aa72291c0c94f5055e /src
parent5e032607d83070ff6968a3fa3eabaf86a0ea2c2e (diff)
downloadyuescript-5b656d2913e4f9f0017698ec835ce4ddda1dc81f.tar.gz
yuescript-5b656d2913e4f9f0017698ec835ce4ddda1dc81f.tar.bz2
yuescript-5b656d2913e4f9f0017698ec835ce4ddda1dc81f.zip
support inserting common expression item started with * symbol into a table block.
Diffstat (limited to 'src')
-rw-r--r--src/MoonP/moon_ast.h2
-rw-r--r--src/MoonP/moon_compiler.cpp2
-rw-r--r--src/MoonP/moon_parser.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h
index 16f7801..90508a5 100644
--- a/src/MoonP/moon_ast.h
+++ b/src/MoonP/moon_ast.h
@@ -535,7 +535,7 @@ AST_END(TableBlockIndent)
535 535
536AST_NODE(TableBlock) 536AST_NODE(TableBlock)
537 ast_ptr<true, Seperator_t> sep; 537 ast_ptr<true, Seperator_t> sep;
538 ast_sel_list<false, variable_pair_t, normal_pair_t, TableBlockIndent_t> values; 538 ast_sel_list<false, variable_pair_t, normal_pair_t, TableBlockIndent_t, Exp_t> values;
539 AST_MEMBER(TableBlock, &sep, &values) 539 AST_MEMBER(TableBlock, &sep, &values)
540AST_END(TableBlock) 540AST_END(TableBlock)
541 541
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp
index 510b47e..8c0746f 100644
--- a/src/MoonP/moon_compiler.cpp
+++ b/src/MoonP/moon_compiler.cpp
@@ -54,7 +54,7 @@ inline std::string s(std::string_view sv) {
54} 54}
55 55
56const std::string_view version() { 56const std::string_view version() {
57 return "0.4.14"sv; 57 return "0.4.15"sv;
58} 58}
59 59
60class MoonCompilerImpl { 60class MoonCompilerImpl {
diff --git a/src/MoonP/moon_parser.cpp b/src/MoonP/moon_parser.cpp
index 394ce50..41db324 100644
--- a/src/MoonP/moon_parser.cpp
+++ b/src/MoonP/moon_parser.cpp
@@ -491,7 +491,7 @@ MoonParser::MoonParser() {
491 }); 491 });
492 492
493 KeyValueList = KeyValue >> *(sym(',') >> KeyValue); 493 KeyValueList = KeyValue >> *(sym(',') >> KeyValue);
494 KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent); 494 KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> Exp);
495 495
496 FnArgDef = (Variable | SelfName) >> -(sym('=') >> Space >> Exp); 496 FnArgDef = (Variable | SelfName) >> -(sym('=') >> Space >> Exp);
497 497