diff options
author | Li Jin <dragon-fly@qq.com> | 2023-07-31 16:43:38 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-07-31 16:43:38 +0800 |
commit | 812094c4ef17b5a1187ce82eb642ee47a1e88aa4 (patch) | |
tree | 9592371a9221acddf1411a84f24969e0f5b48bfd | |
parent | 0380be2756cd2513a2b42e6e334eaa010489ae31 (diff) | |
download | yuescript-0.17.14.tar.gz yuescript-0.17.14.tar.bz2 yuescript-0.17.14.zip |
cleanup.v0.17.14
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 5b8b112..7dc4558 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -5366,9 +5366,10 @@ private: | |||
5366 | 5366 | ||
5367 | void transformUnaryValue(UnaryValue_t* unary_value, str_list& out) { | 5367 | void transformUnaryValue(UnaryValue_t* unary_value, str_list& out) { |
5368 | str_list temp; | 5368 | str_list temp; |
5369 | int target = getLuaTarget(unary_value); | ||
5369 | for (auto _op : unary_value->ops.objects()) { | 5370 | for (auto _op : unary_value->ops.objects()) { |
5370 | std::string op = _parser.toString(_op); | 5371 | std::string op = _parser.toString(_op); |
5371 | if (op == "~"sv && getLuaTarget(_op) < 503) { | 5372 | if (op == "~"sv && target < 503) { |
5372 | throw CompileError("bitwise operator is not available when not targeting Lua version 5.3 or higher"sv, _op); | 5373 | throw CompileError("bitwise operator is not available when not targeting Lua version 5.3 or higher"sv, _op); |
5373 | } | 5374 | } |
5374 | temp.push_back(op == "not"sv ? op + ' ' : op); | 5375 | temp.push_back(op == "not"sv ? op + ' ' : op); |
@@ -5630,9 +5631,10 @@ private: | |||
5630 | return; | 5631 | return; |
5631 | } | 5632 | } |
5632 | std::string unary_op; | 5633 | std::string unary_op; |
5634 | int target = getLuaTarget(unary_exp); | ||
5633 | for (auto _op : unary_exp->ops.objects()) { | 5635 | for (auto _op : unary_exp->ops.objects()) { |
5634 | std::string op = _parser.toString(_op); | 5636 | std::string op = _parser.toString(_op); |
5635 | if (op == "~"sv && getLuaTarget(_op) < 503) { | 5637 | if (op == "~"sv && target < 503) { |
5636 | throw CompileError("bitwise operator is not available when not targeting Lua version 5.3 or higher"sv, _op); | 5638 | throw CompileError("bitwise operator is not available when not targeting Lua version 5.3 or higher"sv, _op); |
5637 | } | 5639 | } |
5638 | unary_op.append(op == "not"sv ? op + ' ' : op); | 5640 | unary_op.append(op == "not"sv ? op + ' ' : op); |