diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-06-25 17:46:32 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-06-25 17:46:32 +0800 |
| commit | cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193 (patch) | |
| tree | 5bc8bc55f80fe74a3b73101b55eabc60ae1d75c3 /spec/outputs/teal-lang.lua | |
| parent | 5d246757285a437401347dd6a1a1f8d3cf61e08c (diff) | |
| download | yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.tar.gz yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.tar.bz2 yuescript-cd618f934b0e4a30bd6cd4e98f8c1005bf3d6193.zip | |
fix more ambiguous Lua codes generation cases.
Diffstat (limited to 'spec/outputs/teal-lang.lua')
| -rw-r--r-- | spec/outputs/teal-lang.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/outputs/teal-lang.lua b/spec/outputs/teal-lang.lua index 0e627f4..28ba6f8 100644 --- a/spec/outputs/teal-lang.lua +++ b/spec/outputs/teal-lang.lua | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | local a = { | 1 | local a = { |
| 2 | value = 123 | 2 | value = 123 |
| 3 | }; | 3 | } |
| 4 | local b = a.value; | 4 | local b = a.value |
| 5 | local add = function(a, b) | 5 | local add = function(a, b) |
| 6 | return a + b | 6 | return a + b |
| 7 | end | 7 | end |
| 8 | local s = add(a.value, b) | 8 | local s = add(a.value, b) |
| 9 | print(s); | 9 | print(s) |
| 10 | local Point = {}; | 10 | local Point = {} |
| 11 | Point.new = function(x, y) | 11 | Point.new = function(x, y) |
| 12 | local point = setmetatable({ }, { | 12 | local point = setmetatable({ }, { |
| 13 | __index = Point | 13 | __index = Point |
| @@ -21,7 +21,7 @@ Point.move = function(self, dx, dy) | |||
| 21 | self.y = self.y + dy | 21 | self.y = self.y + dy |
| 22 | end | 22 | end |
| 23 | local p = Point.new(100, 100) | 23 | local p = Point.new(100, 100) |
| 24 | p:move(50, 50); | 24 | p:move(50, 50) |
| 25 | local filter = function(tab, handler) | 25 | local filter = function(tab, handler) |
| 26 | local _accum_0 = { } | 26 | local _accum_0 = { } |
| 27 | local _len_0 = 1 | 27 | local _len_0 = 1 |
