aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md12
-rw-r--r--src/MoonP/moon_compiler.cpp17
2 files changed, 19 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3fe390d..0154124 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,11 @@ The implementation for original Moonscript language 0.5.0 can be found in the `0
4 4
5 5
6 6
7## v0.4.1 7## v0.4.4
8
9### Fixed Issues
10
11* Fix issues when declaring table key with Lua multiline string and indexing expressions with Lua multiline string.
8 12
9### Added Features 13### Added Features
10 14
@@ -39,9 +43,7 @@ The implementation for original Moonscript language 0.5.0 can be found in the `0
39### Fixed Issues 43### Fixed Issues
40 44
41* Fix issues of unary and binary operator "~". 45* Fix issues of unary and binary operator "~".
42
43* Fix Moonscript issue 416: ambiguous Lua output in some cases. 46* Fix Moonscript issue 416: ambiguous Lua output in some cases.
44
45* Fix errors when explicitly declaring global or local variable initialized with table block. 47* Fix errors when explicitly declaring global or local variable initialized with table block.
46* Fix macro type mismatch issue. 48* Fix macro type mismatch issue.
47* Fix line break issue in macro, disable macro declaration outside the root scope. 49* Fix line break issue in macro, disable macro declaration outside the root scope.
@@ -52,10 +54,8 @@ The implementation for original Moonscript language 0.5.0 can be found in the `0
52 54
53### Added Features 55### Added Features
54 56
55* Change operator precedence to 1 ^ 2 unary operators (not, #, -, ~) 3 |> 4 *, /, //, %, ... 57* Change operator precedence to (1) ^ (2) unary operators (not, #, -, ~) (3) |> (4) *, /, //, %, ...
56
57* Make back call operator use highest priority for operator precedence. 58* Make back call operator use highest priority for operator precedence.
58
59* Add existential operator support for `with` statement. 59* Add existential operator support for `with` statement.
60* Add repeat until statement support. 60* Add repeat until statement support.
61* Allow implicitly returning block macro. 61* Allow implicitly returning block macro.
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 }