From 5b656d2913e4f9f0017698ec835ce4ddda1dc81f Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 18 Sep 2020 17:24:03 +0800 Subject: support inserting common expression item started with * symbol into a table block. --- src/MoonP/moon_ast.h | 2 +- src/MoonP/moon_compiler.cpp | 2 +- src/MoonP/moon_parser.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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) AST_NODE(TableBlock) ast_ptr sep; - ast_sel_list values; + ast_sel_list values; AST_MEMBER(TableBlock, &sep, &values) AST_END(TableBlock) 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) { } const std::string_view version() { - return "0.4.14"sv; + return "0.4.15"sv; } class 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() { }); KeyValueList = KeyValue >> *(sym(',') >> KeyValue); - KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent); + KeyValueLine = CheckIndent >> (KeyValueList >> -sym(',') | TableBlockIndent | Space >> expr('*') >> Exp); FnArgDef = (Variable | SelfName) >> -(sym('=') >> Space >> Exp); -- cgit v1.2.3-55-g6feb