From 6bf5bbeab70f5affb1b10842248a68294882d16a Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 19 Dec 2023 23:30:05 +0800 Subject: [PATCH] update Yuescript. --- Source/3rdParty/yuescript/yue_ast.h | 3 ++- Source/3rdParty/yuescript/yue_compiler.cpp | 5 +++-- Source/3rdParty/yuescript/yue_parser.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/3rdParty/yuescript/yue_ast.h b/Source/3rdParty/yuescript/yue_ast.h index 6b2b7f804..6d90add0d 100644 --- a/Source/3rdParty/yuescript/yue_ast.h +++ b/Source/3rdParty/yuescript/yue_ast.h @@ -80,6 +80,7 @@ class Macro_t; class In_t; class NormalDef_t; class SpreadListExp_t; +class Comprehension_t; } // namespace yue AST_LEAF(Num) @@ -171,7 +172,7 @@ AST_END(CloseAttrib, "close"sv) AST_NODE(LocalAttrib) ast_sel attrib; ast_ptr sep; - ast_sel_list leftList; + ast_sel_list leftList; ast_ptr assign; AST_MEMBER(LocalAttrib, &attrib, &sep, &leftList, &assign) AST_END(LocalAttrib, "local_attrib"sv) diff --git a/Source/3rdParty/yuescript/yue_compiler.cpp b/Source/3rdParty/yuescript/yue_compiler.cpp index d43f79b08..f163bdffb 100644 --- a/Source/3rdParty/yuescript/yue_compiler.cpp +++ b/Source/3rdParty/yuescript/yue_compiler.cpp @@ -75,7 +75,7 @@ static std::unordered_set Metamethods = { "close"s // Lua 5.4 }; -const std::string_view version = "0.21.5"sv; +const std::string_view version = "0.21.6"sv; const std::string_view extension = "yue"sv; class CompileError : public std::logic_error { @@ -9376,7 +9376,8 @@ class YueCompilerImpl { case id(): value->item.set(item); break; - case id(): { + case id(): + case id(): { auto simpleValue = item->new_ptr(); simpleValue->value.set(item); value->item.set(simpleValue); diff --git a/Source/3rdParty/yuescript/yue_parser.cpp b/Source/3rdParty/yuescript/yue_parser.cpp index 3557534b9..4e6105b7d 100644 --- a/Source/3rdParty/yuescript/yue_parser.cpp +++ b/Source/3rdParty/yuescript/yue_parser.cpp @@ -286,7 +286,7 @@ YueParser::YueParser() { ConstAttrib = key("const"); CloseAttrib = key("close"); - local_const_item = Variable | SimpleTable | TableLit; + local_const_item = Variable | SimpleTable | TableLit | Comprehension; LocalAttrib = ( ConstAttrib >> Seperator >> space >> local_const_item >> *(space >> ',' >> space >> local_const_item) | CloseAttrib >> Seperator >> space >> Variable >> *(space >> ',' >> space >> Variable)