diff options
| author | Li Jin <dragon-fly@qq.com> | 2024-03-21 09:14:34 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2024-03-21 09:14:34 +0800 |
| commit | 4a3cc26c6dfd74e61c8b6480038d6a292ea86e47 (patch) | |
| tree | 9554b94cfc15e4acee0c2e60b63af16f1b828207 /spec/outputs/vararg.lua | |
| parent | 80b65520da432843f0c63431a1867bd2620bc4ac (diff) | |
| download | yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.tar.gz yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.tar.bz2 yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.zip | |
remove redundant 'do' blocks in code generation.
Diffstat (limited to 'spec/outputs/vararg.lua')
| -rw-r--r-- | spec/outputs/vararg.lua | 88 |
1 files changed, 42 insertions, 46 deletions
diff --git a/spec/outputs/vararg.lua b/spec/outputs/vararg.lua index 27918e9..dabba44 100644 --- a/spec/outputs/vararg.lua +++ b/spec/outputs/vararg.lua | |||
| @@ -46,57 +46,53 @@ local _anon_func_5 = function(items, ...) | |||
| 46 | end | 46 | end |
| 47 | local _anon_func_6 = function(func, setmetatable) | 47 | local _anon_func_6 = function(func, setmetatable) |
| 48 | local A | 48 | local A |
| 49 | do | 49 | local _class_0 |
| 50 | local _class_0 | 50 | local _base_0 = { } |
| 51 | local _base_0 = { } | 51 | if _base_0.__index == nil then |
| 52 | if _base_0.__index == nil then | 52 | _base_0.__index = _base_0 |
| 53 | _base_0.__index = _base_0 | 53 | end |
| 54 | _class_0 = setmetatable({ | ||
| 55 | __init = function() end, | ||
| 56 | __base = _base_0, | ||
| 57 | __name = "A" | ||
| 58 | }, { | ||
| 59 | __index = _base_0, | ||
| 60 | __call = function(cls, ...) | ||
| 61 | local _self_0 = setmetatable({ }, _base_0) | ||
| 62 | cls.__init(_self_0, ...) | ||
| 63 | return _self_0 | ||
| 54 | end | 64 | end |
| 55 | _class_0 = setmetatable({ | 65 | }) |
| 56 | __init = function() end, | 66 | _base_0.__class = _class_0 |
| 57 | __base = _base_0, | 67 | local self = _class_0; |
| 58 | __name = "A" | 68 | func() |
| 59 | }, { | 69 | A = _class_0 |
| 60 | __index = _base_0, | 70 | return _class_0 |
| 61 | __call = function(cls, ...) | ||
| 62 | local _self_0 = setmetatable({ }, _base_0) | ||
| 63 | cls.__init(_self_0, ...) | ||
| 64 | return _self_0 | ||
| 65 | end | ||
| 66 | }) | ||
| 67 | _base_0.__class = _class_0 | ||
| 68 | local self = _class_0; | ||
| 69 | func() | ||
| 70 | A = _class_0 | ||
| 71 | return _class_0 | ||
| 72 | end | ||
| 73 | end | 71 | end |
| 74 | local _anon_func_7 = function(func, setmetatable, ...) | 72 | local _anon_func_7 = function(func, setmetatable, ...) |
| 75 | local A | 73 | local A |
| 76 | do | 74 | local _class_0 |
| 77 | local _class_0 | 75 | local _base_0 = { } |
| 78 | local _base_0 = { } | 76 | if _base_0.__index == nil then |
| 79 | if _base_0.__index == nil then | 77 | _base_0.__index = _base_0 |
| 80 | _base_0.__index = _base_0 | 78 | end |
| 79 | _class_0 = setmetatable({ | ||
| 80 | __init = function() end, | ||
| 81 | __base = _base_0, | ||
| 82 | __name = "A" | ||
| 83 | }, { | ||
| 84 | __index = _base_0, | ||
| 85 | __call = function(cls, ...) | ||
| 86 | local _self_0 = setmetatable({ }, _base_0) | ||
| 87 | cls.__init(_self_0, ...) | ||
| 88 | return _self_0 | ||
| 81 | end | 89 | end |
| 82 | _class_0 = setmetatable({ | 90 | }) |
| 83 | __init = function() end, | 91 | _base_0.__class = _class_0 |
| 84 | __base = _base_0, | 92 | local self = _class_0; |
| 85 | __name = "A" | 93 | func(...) |
| 86 | }, { | 94 | A = _class_0 |
| 87 | __index = _base_0, | 95 | return _class_0 |
| 88 | __call = function(cls, ...) | ||
| 89 | local _self_0 = setmetatable({ }, _base_0) | ||
| 90 | cls.__init(_self_0, ...) | ||
| 91 | return _self_0 | ||
| 92 | end | ||
| 93 | }) | ||
| 94 | _base_0.__class = _class_0 | ||
| 95 | local self = _class_0; | ||
| 96 | func(...) | ||
| 97 | A = _class_0 | ||
| 98 | return _class_0 | ||
| 99 | end | ||
| 100 | end | 96 | end |
| 101 | local _anon_func_8 = function(pairs, tb) | 97 | local _anon_func_8 = function(pairs, tb) |
| 102 | local _tbl_0 = { } | 98 | local _tbl_0 = { } |
