diff options
author | Li Jin <dragon-fly@qq.com> | 2023-06-26 09:23:37 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-06-26 09:23:37 +0800 |
commit | 51faef5288a64a84b8f8e5cea8631c7518b94411 (patch) | |
tree | aec09d396ea1183d3fd4d2bb8fde7e2157823a6b | |
parent | cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193 (diff) | |
download | yuescript-51faef5288a64a84b8f8e5cea8631c7518b94411.tar.gz yuescript-51faef5288a64a84b8f8e5cea8631c7518b94411.tar.bz2 yuescript-51faef5288a64a84b8f8e5cea8631c7518b94411.zip |
fix gcc build.
-rw-r--r-- | src/yuescript/yue_compiler.cpp | 5 | ||||
-rw-r--r-- | src/yuescript/yuescript.cpp | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 8574e6c..477815d 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
@@ -202,6 +202,7 @@ public: | |||
202 | } else if (auto exportNode = stmt->content.as<Export_t>()) { | 202 | } else if (auto exportNode = stmt->content.as<Export_t>()) { |
203 | if (exportNode->target.is<Macro_t>()) break; | 203 | if (exportNode->target.is<Macro_t>()) break; |
204 | } | 204 | } |
205 | [[fallthrough]]; | ||
205 | default: | 206 | default: |
206 | throw CompileError("macro exporting module only accepts macro definition, macro importing and macro expansion in place"sv, stmt); | 207 | throw CompileError("macro exporting module only accepts macro definition, macro importing and macro expansion in place"sv, stmt); |
207 | break; | 208 | break; |
@@ -1951,6 +1952,7 @@ private: | |||
1951 | out.back().insert(0, preDefine); | 1952 | out.back().insert(0, preDefine); |
1952 | return; | 1953 | return; |
1953 | } | 1954 | } |
1955 | break; | ||
1954 | } | 1956 | } |
1955 | case id<TableBlock_t>(): { | 1957 | case id<TableBlock_t>(): { |
1956 | auto tableBlock = static_cast<TableBlock_t*>(value); | 1958 | auto tableBlock = static_cast<TableBlock_t*>(value); |
@@ -1961,6 +1963,7 @@ private: | |||
1961 | out.back().insert(0, preDefine); | 1963 | out.back().insert(0, preDefine); |
1962 | return; | 1964 | return; |
1963 | } | 1965 | } |
1966 | break; | ||
1964 | } | 1967 | } |
1965 | } | 1968 | } |
1966 | auto exp = ast_cast<Exp_t>(value); | 1969 | auto exp = ast_cast<Exp_t>(value); |
@@ -3776,7 +3779,7 @@ private: | |||
3776 | str_list temp; | 3779 | str_list temp; |
3777 | for (auto node : nodes) { | 3780 | for (auto node : nodes) { |
3778 | transformStatement(static_cast<Statement_t*>(node), temp); | 3781 | transformStatement(static_cast<Statement_t*>(node), temp); |
3779 | if (_parser.startWith<StatementSep_t>(temp.back())) { | 3782 | if (!temp.empty() && _parser.startWith<StatementSep_t>(temp.back())) { |
3780 | auto rit = ++temp.rbegin(); | 3783 | auto rit = ++temp.rbegin(); |
3781 | if (rit != temp.rend() && !rit->empty()) { | 3784 | if (rit != temp.rend() && !rit->empty()) { |
3782 | auto index = std::string::npos; | 3785 | auto index = std::string::npos; |
diff --git a/src/yuescript/yuescript.cpp b/src/yuescript/yuescript.cpp index 933c77d..22ba2a1 100644 --- a/src/yuescript/yuescript.cpp +++ b/src/yuescript/yuescript.cpp | |||
@@ -328,6 +328,7 @@ static int yuetoast(lua_State* L) { | |||
328 | lua_pop(L, 1); | 328 | lua_pop(L, 1); |
329 | break; | 329 | break; |
330 | } | 330 | } |
331 | [[fallthrough]]; | ||
331 | } | 332 | } |
332 | default: { | 333 | default: { |
333 | auto len = lua_objlen(L, tableIndex); | 334 | auto len = lua_objlen(L, tableIndex); |