aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/MoonP/moon_compiler.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp
index 1283422..41d29df 100644
--- a/src/MoonP/moon_compiler.cpp
+++ b/src/MoonP/moon_compiler.cpp
@@ -49,7 +49,7 @@ inline std::string s(std::string_view sv) {
49} 49}
50 50
51const std::string_view version() { 51const std::string_view version() {
52 return "0.4.3"sv; 52 return "0.4.4"sv;
53} 53}
54 54
55// name of table stored in lua registry 55// name of table stored in lua registry
@@ -3814,7 +3814,7 @@ private:
3814 } 3814 }
3815 case id<Exp_t>(): 3815 case id<Exp_t>():
3816 transformExp(static_cast<Exp_t*>(key), temp, ExpUsage::Closure); 3816 transformExp(static_cast<Exp_t*>(key), temp, ExpUsage::Closure);
3817 temp.back() = s("["sv) + temp.back() + s("]"sv); 3817 temp.back() = s(temp.back().front() == '[' ? "[ "sv : "["sv) + temp.back() + s("]"sv);
3818 break; 3818 break;
3819 case id<DoubleString_t>(): 3819 case id<DoubleString_t>():
3820 transformDoubleString(static_cast<DoubleString_t*>(key), temp); 3820 transformDoubleString(static_cast<DoubleString_t*>(key), temp);
@@ -3873,10 +3873,19 @@ private:
3873 temp.push_back(s("\""sv) + str + s("\""sv)); 3873 temp.push_back(s("\""sv) + str + s("\""sv));
3874 break; 3874 break;
3875 } 3875 }
3876 case id<Exp_t>(): 3876 case id<Exp_t>(): {
3877 transformExp(static_cast<Exp_t*>(content), temp, ExpUsage::Closure); 3877 transformExp(static_cast<Exp_t*>(content), temp, ExpUsage::Closure);
3878 temp.back() = s("tostring("sv) + temp.back() + s(")"sv); 3878 std::string tostr("tostring"sv);
3879 temp.back() = tostr + '(' + temp.back() + s(")"sv);
3880 if (_config.lintGlobalVariable) {
3881 if (!isDefined(tostr)) {
3882 if (_globals.find(tostr) == _globals.end()) {
3883 _globals[tostr] = {content->m_begin.m_line, content->m_begin.m_col};
3884 }
3885 }
3886 }
3879 break; 3887 break;
3888 }
3880 default: assert(false); break; 3889 default: assert(false); break;
3881 } 3890 }
3882 } 3891 }