diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
| commit | 60a979e224f26117f5be82bfca757a2483cef0fd (patch) | |
| tree | 7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/local.lua | |
| parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
| download | yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2 yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip | |
fix test.
Diffstat (limited to 'spec/outputs/local.lua')
| -rw-r--r-- | spec/outputs/local.lua | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/spec/outputs/local.lua b/spec/outputs/local.lua new file mode 100644 index 0000000..288764a --- /dev/null +++ b/spec/outputs/local.lua | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | do | ||
| 2 | local a | ||
| 3 | local a, b, c | ||
| 4 | local g | ||
| 5 | b, g = 23232 | ||
| 6 | end | ||
| 7 | do | ||
| 8 | local x = 1212 | ||
| 9 | local something | ||
| 10 | something = function() | ||
| 11 | local x | ||
| 12 | x = 1212 | ||
| 13 | end | ||
| 14 | end | ||
| 15 | do | ||
| 16 | local y, z | ||
| 17 | y = 2323 | ||
| 18 | z = 2323 | ||
| 19 | end | ||
| 20 | do | ||
| 21 | print("Nothing Here!") | ||
| 22 | end | ||
| 23 | do | ||
| 24 | local X, Y | ||
| 25 | local x = 3434 | ||
| 26 | local y = 3434 | ||
| 27 | X = 3434 | ||
| 28 | Y = "yeah" | ||
| 29 | end | ||
| 30 | do | ||
| 31 | local x, y = "a", "b" | ||
| 32 | end | ||
| 33 | do | ||
| 34 | local x, y | ||
| 35 | x, y = "a", "b" | ||
| 36 | end | ||
| 37 | do | ||
| 38 | if something then | ||
| 39 | local x = 2323 | ||
| 40 | end | ||
| 41 | end | ||
| 42 | do | ||
| 43 | local x | ||
| 44 | do | ||
| 45 | x = "one" | ||
| 46 | end | ||
| 47 | x = 100 | ||
| 48 | do | ||
| 49 | x = "two" | ||
| 50 | end | ||
| 51 | end | ||
| 52 | do | ||
| 53 | local k, x, a, b, c | ||
| 54 | if what then | ||
| 55 | k = 10 | ||
| 56 | end | ||
| 57 | x = 100 | ||
| 58 | do | ||
| 59 | local _obj_0 = y | ||
| 60 | a, b, c = _obj_0.a, _obj_0.b, _obj_0.c | ||
| 61 | end | ||
| 62 | end | ||
| 63 | do | ||
| 64 | local a, b, c, d | ||
| 65 | a = 100 | ||
| 66 | print("hi") | ||
| 67 | b = 200 | ||
| 68 | c = 100 | ||
| 69 | print("hi") | ||
| 70 | d = 200 | ||
| 71 | d = 2323 | ||
| 72 | end | ||
| 73 | do | ||
| 74 | local Uppercase, One, Two | ||
| 75 | local lowercase = 5 | ||
| 76 | Uppercase = 3 | ||
| 77 | do | ||
| 78 | local _class_0 | ||
| 79 | local Five | ||
| 80 | local _base_0 = { } | ||
| 81 | _base_0.__index = _base_0 | ||
| 82 | _class_0 = setmetatable({ | ||
| 83 | __init = function() end, | ||
| 84 | __base = _base_0, | ||
| 85 | __name = "One" | ||
| 86 | }, { | ||
| 87 | __index = _base_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 | Five = 6 | ||
| 97 | One = _class_0 | ||
| 98 | end | ||
| 99 | do | ||
| 100 | local _class_0 | ||
| 101 | local No | ||
| 102 | local _base_0 = { } | ||
| 103 | _base_0.__index = _base_0 | ||
| 104 | _class_0 = setmetatable({ | ||
| 105 | __init = function() end, | ||
| 106 | __base = _base_0, | ||
| 107 | __name = "Two" | ||
| 108 | }, { | ||
| 109 | __index = _base_0, | ||
| 110 | __call = function(cls, ...) | ||
| 111 | local _self_0 = setmetatable({ }, _base_0) | ||
| 112 | cls.__init(_self_0, ...) | ||
| 113 | return _self_0 | ||
| 114 | end | ||
| 115 | }) | ||
| 116 | _base_0.__class = _class_0 | ||
| 117 | local self = _class_0; | ||
| 118 | do | ||
| 119 | local _class_1 | ||
| 120 | local _base_1 = { } | ||
| 121 | _base_1.__index = _base_1 | ||
| 122 | _class_1 = setmetatable({ | ||
| 123 | __init = function() end, | ||
| 124 | __base = _base_1, | ||
| 125 | __name = "No" | ||
| 126 | }, { | ||
| 127 | __index = _base_1, | ||
| 128 | __call = function(cls, ...) | ||
| 129 | local _self_0 = setmetatable({ }, _base_1) | ||
| 130 | cls.__init(_self_0, ...) | ||
| 131 | return _self_0 | ||
| 132 | end | ||
| 133 | }) | ||
| 134 | _base_1.__class = _class_1 | ||
| 135 | No = _class_1 | ||
| 136 | end | ||
| 137 | Two = _class_0 | ||
| 138 | end | ||
| 139 | end | ||
| 140 | do | ||
| 141 | local _list_0 = { } | ||
| 142 | for _index_0 = 1, #_list_0 do | ||
| 143 | local a = _list_0[_index_0] | ||
| 144 | local _ = a | ||
| 145 | end | ||
| 146 | end | ||
| 147 | do | ||
| 148 | local x | ||
| 149 | x = a or b | ||
| 150 | end | ||
| 151 | local g = 2323 | ||
