diff options
Diffstat (limited to 'src/MoonP/moon_compiler.cpp')
-rw-r--r-- | src/MoonP/moon_compiler.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index c176c01..b89f6d1 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
@@ -43,7 +43,7 @@ inline std::string s(std::string_view sv) { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | const char* moonScriptVersion() { | 45 | const char* moonScriptVersion() { |
46 | return "0.5.0-r0.3.4"; | 46 | return "0.5.0-r0.3.5"; |
47 | } | 47 | } |
48 | 48 | ||
49 | // name of table stored in lua registry | 49 | // name of table stored in lua registry |
@@ -750,6 +750,8 @@ private: | |||
750 | case id<Export_t>(): transformExport(static_cast<Export_t*>(content), out); break; | 750 | case id<Export_t>(): transformExport(static_cast<Export_t*>(content), out); break; |
751 | case id<Macro_t>(): transformMacro(static_cast<Macro_t*>(content), out, false); break; | 751 | case id<Macro_t>(): transformMacro(static_cast<Macro_t*>(content), out, false); break; |
752 | case id<BreakLoop_t>(): transformBreakLoop(static_cast<BreakLoop_t*>(content), out); break; | 752 | case id<BreakLoop_t>(): transformBreakLoop(static_cast<BreakLoop_t*>(content), out); break; |
753 | case id<Label_t>(): transformLabel(static_cast<Label_t*>(content), out); break; | ||
754 | case id<Goto_t>(): transformGoto(static_cast<Goto_t*>(content), out); break; | ||
753 | case id<ExpListAssign_t>(): { | 755 | case id<ExpListAssign_t>(): { |
754 | auto expListAssign = static_cast<ExpListAssign_t*>(content); | 756 | auto expListAssign = static_cast<ExpListAssign_t*>(content); |
755 | if (expListAssign->action) { | 757 | if (expListAssign->action) { |
@@ -4997,6 +4999,14 @@ private: | |||
4997 | _buf << indent() << "break"sv << nll(breakLoop); | 4999 | _buf << indent() << "break"sv << nll(breakLoop); |
4998 | out.push_back(clearBuf()); | 5000 | out.push_back(clearBuf()); |
4999 | } | 5001 | } |
5002 | |||
5003 | void transformLabel(Label_t* label, str_list& out) { | ||
5004 | out.push_back(indent() + s("::"sv) + _parser.toString(label->label) + s("::"sv) + nll(label)); | ||
5005 | } | ||
5006 | |||
5007 | void transformGoto(Goto_t* gotoNode, str_list& out) { | ||
5008 | out.push_back(indent() + s("goto "sv) + _parser.toString(gotoNode->label) + nll(gotoNode)); | ||
5009 | } | ||
5000 | }; | 5010 | }; |
5001 | 5011 | ||
5002 | const std::string MoonCompilerImpl::Empty; | 5012 | const std::string MoonCompilerImpl::Empty; |