Skip to content

Commit

Permalink
fix a format case.
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Dec 18, 2023
1 parent 8cff607 commit 1b43ecc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.5)
project(yue CXX)

set(LUA_LIBDIR ${LUA_INCDIR}/../lib ${LUA_INCDIR}/../../lib)
Expand Down
18 changes: 15 additions & 3 deletions src/yuescript/yue_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,21 @@ static bool isInBlockExp(ast_node* node, bool last = false) {
}
auto value = static_cast<Value_t*>(unaryExp->expos.back());
if (auto simpleValue = value->item.as<SimpleValue_t>()) {
if (!ast_is<TableLit_t, ConstValue_t, Num_t, VarArg_t,
TblComprehension_t, Comprehension_t>(simpleValue->value)) {
return true;
switch (simpleValue->value->get_id()) {
case id<TableLit_t>():
case id<ConstValue_t>():
case id<Num_t>():
case id<VarArg_t>():
case id<TblComprehension_t>():
case id<Comprehension_t>():
return false;
case id<FunLit_t>():
if (!last) {
return true;
}
return false;
default:
return true;
}
} else if (auto chainValue = value->item.as<ChainValue_t>()) {
if (ast_is<InvokeArgs_t>(chainValue->items.back())) {
Expand Down
2 changes: 1 addition & 1 deletion src/yuescript/yue_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static std::unordered_set<std::string> Metamethods = {
"close"s // Lua 5.4
};

const std::string_view version = "0.21.3"sv;
const std::string_view version = "0.21.4"sv;
const std::string_view extension = "yue"sv;

class CompileError : public std::logic_error {
Expand Down

0 comments on commit 1b43ecc

Please sign in to comment.