diff options
author | Li Jin <dragon-fly@qq.com> | 2023-05-17 15:11:09 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-05-17 15:11:09 +0800 |
commit | 4bd1513262a61071b07f5efe2a3cb9356ce6c8c2 (patch) | |
tree | aaaf73884315aeb436f7bb4020e9bd9c20344c90 /spec/outputs | |
parent | 0c589d36fadba92d547fc6a93a2d5494d4d51981 (diff) | |
download | yuescript-0.16.5.tar.gz yuescript-0.16.5.tar.bz2 yuescript-0.16.5.zip |
fix spec.v0.16.5
Diffstat (limited to 'spec/outputs')
-rw-r--r-- | spec/outputs/existential.lua | 2 | ||||
-rw-r--r-- | spec/outputs/metatable.lua | 35 |
2 files changed, 28 insertions, 9 deletions
diff --git a/spec/outputs/existential.lua b/spec/outputs/existential.lua index b241b3b..391f553 100644 --- a/spec/outputs/existential.lua +++ b/spec/outputs/existential.lua | |||
@@ -201,7 +201,7 @@ do | |||
201 | local _obj_0 = tb | 201 | local _obj_0 = tb |
202 | if _obj_0 ~= nil then | 202 | if _obj_0 ~= nil then |
203 | do | 203 | do |
204 | local _obj_1 = getmetatable(_obj_0).__a | 204 | local _obj_1 = getmetatable(_obj_0).__call |
205 | if _obj_1 ~= nil then | 205 | if _obj_1 ~= nil then |
206 | _obj_1(123) | 206 | _obj_1(123) |
207 | end | 207 | end |
diff --git a/spec/outputs/metatable.lua b/spec/outputs/metatable.lua index 907a584..9f95787 100644 --- a/spec/outputs/metatable.lua +++ b/spec/outputs/metatable.lua | |||
@@ -76,8 +76,14 @@ getmetatable(a).__index = tb | |||
76 | getmetatable(a).__index = tb | 76 | getmetatable(a).__index = tb |
77 | local mt = getmetatable(a) | 77 | local mt = getmetatable(a) |
78 | tb:func(#list) | 78 | tb:func(#list) |
79 | getmetatable(tb):__func(list) | 79 | do |
80 | getmetatable(tb):__func(list) | 80 | local _obj_0 = getmetatable(tb) |
81 | _obj_0["func"](_obj_0, list) | ||
82 | end | ||
83 | do | ||
84 | local _obj_0 = getmetatable(tb) | ||
85 | _obj_0["func"](_obj_0, list) | ||
86 | end | ||
81 | local index, setFunc | 87 | local index, setFunc |
82 | do | 88 | do |
83 | local _obj_0 = getmetatable(require("module")) | 89 | local _obj_0 = getmetatable(require("module")) |
@@ -86,7 +92,10 @@ end | |||
86 | do | 92 | do |
87 | local _with_0 = tb | 93 | local _with_0 = tb |
88 | print(getmetatable(_with_0).__add, getmetatable(_with_0.x):__index("key")) | 94 | print(getmetatable(_with_0).__add, getmetatable(_with_0.x):__index("key")) |
89 | a = getmetatable(getmetatable(getmetatable(_with_0).__index).__add):__new(123) | 95 | do |
96 | local _obj_0 = getmetatable(getmetatable(getmetatable(_with_0).__index).__add) | ||
97 | a = _obj_0["new"](_obj_0, 123) | ||
98 | end | ||
90 | b = t(#getmetatable(_with_0).__close.test) | 99 | b = t(#getmetatable(_with_0).__close.test) |
91 | c = t(#getmetatable(_with_0).__close(_with_0.test)) | 100 | c = t(#getmetatable(_with_0).__close(_with_0.test)) |
92 | end | 101 | end |
@@ -132,13 +141,23 @@ do | |||
132 | return _obj_0["value" .. tostring(x > y)](_obj_0, 123, ...) | 141 | return _obj_0["value" .. tostring(x > y)](_obj_0, 123, ...) |
133 | end | 142 | end |
134 | do | 143 | do |
135 | f = getmetatable(tb):__value(123, ...) | 144 | do |
136 | f(getmetatable(tb):__value(123, ...)) | 145 | local _obj_0 = getmetatable(tb) |
137 | getmetatable(tb):__value(123, ...) | 146 | f = _obj_0['value'](_obj_0, 123, ...) |
138 | return getmetatable(tb):__value(123, ...) | 147 | end |
148 | f((function(...) | ||
149 | local _obj_0 = getmetatable(tb) | ||
150 | return _obj_0['value'](_obj_0, 123, ...) | ||
151 | end)(...)) | ||
152 | do | ||
153 | local _obj_0 = getmetatable(tb) | ||
154 | _obj_0['value'](_obj_0, 123, ...) | ||
155 | end | ||
156 | local _obj_0 = getmetatable(tb) | ||
157 | return _obj_0['value'](_obj_0, 123, ...) | ||
139 | end | 158 | end |
140 | do | 159 | do |
141 | f = getmetatable(tb).__value(123, ...) | 160 | f = getmetatable(tb)["value"](123, ...) |
142 | f = getmetatable(tb)["value" .. tostring(x < y)](123, ...) | 161 | f = getmetatable(tb)["value" .. tostring(x < y)](123, ...) |
143 | f(getmetatable(tb)['value'](123, ...)) | 162 | f(getmetatable(tb)['value'](123, ...)) |
144 | getmetatable(tb)[ [[ value | 163 | getmetatable(tb)[ [[ value |