From 1b0bf8554e84bcd4d68dd2131838ea9c923ed694 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 21 Nov 2022 18:02:25 +0800 Subject: fix class syntax ambiguous issue. --- src/yuescript/yue_compiler.cpp | 2 +- src/yuescript/yue_parser.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index cd91c97..cf9f188 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -60,7 +60,7 @@ namespace yue { typedef std::list str_list; -const std::string_view version = "0.15.15"sv; +const std::string_view version = "0.15.16"sv; const std::string_view extension = "yue"sv; class YueCompilerImpl { diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 24f821c..1ff772b 100644 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp @@ -523,11 +523,11 @@ YueParser::YueParser() { ClassBlock = +SpaceBreak >> Advance >> Seperator >> ClassLine >> *(+SpaceBreak >> ClassLine) >> PopIndent; ClassDecl = - Space >> key("class") >> not_(expr(':')) >> - -Assignable >> - -(Space >> key("extends") >> PreventIndent >> ensure(Exp, PopIndent)) >> - -(Space >> key("using") >> PreventIndent >> ensure(ExpList, PopIndent)) >> - -ClassBlock; + Space >> key("class") >> not_(expr(':')) >> disable_arg_table_block( + -Assignable >> + -(Space >> key("extends") >> PreventIndent >> ensure(Exp, PopIndent)) >> + -(Space >> key("using") >> PreventIndent >> ensure(ExpList, PopIndent)) + ) >> -ClassBlock; global_values = NameList >> -(sym('=') >> (TableBlock | ExpListLow)); global_op = expr('*') | expr('^'); -- cgit v1.2.3-55-g6feb