From 4bd1513262a61071b07f5efe2a3cb9356ce6c8c2 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 17 May 2023 15:11:09 +0800 Subject: fix spec. --- spec/outputs/existential.lua | 2 +- spec/outputs/metatable.lua | 35 +++++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 9 deletions(-) (limited to 'spec/outputs') 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 local _obj_0 = tb if _obj_0 ~= nil then do - local _obj_1 = getmetatable(_obj_0).__a + local _obj_1 = getmetatable(_obj_0).__call if _obj_1 ~= nil then _obj_1(123) 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 getmetatable(a).__index = tb local mt = getmetatable(a) tb:func(#list) -getmetatable(tb):__func(list) -getmetatable(tb):__func(list) +do + local _obj_0 = getmetatable(tb) + _obj_0["func"](_obj_0, list) +end +do + local _obj_0 = getmetatable(tb) + _obj_0["func"](_obj_0, list) +end local index, setFunc do local _obj_0 = getmetatable(require("module")) @@ -86,7 +92,10 @@ end do local _with_0 = tb print(getmetatable(_with_0).__add, getmetatable(_with_0.x):__index("key")) - a = getmetatable(getmetatable(getmetatable(_with_0).__index).__add):__new(123) + do + local _obj_0 = getmetatable(getmetatable(getmetatable(_with_0).__index).__add) + a = _obj_0["new"](_obj_0, 123) + end b = t(#getmetatable(_with_0).__close.test) c = t(#getmetatable(_with_0).__close(_with_0.test)) end @@ -132,13 +141,23 @@ do return _obj_0["value" .. tostring(x > y)](_obj_0, 123, ...) end do - f = getmetatable(tb):__value(123, ...) - f(getmetatable(tb):__value(123, ...)) - getmetatable(tb):__value(123, ...) - return getmetatable(tb):__value(123, ...) + do + local _obj_0 = getmetatable(tb) + f = _obj_0['value'](_obj_0, 123, ...) + end + f((function(...) + local _obj_0 = getmetatable(tb) + return _obj_0['value'](_obj_0, 123, ...) + end)(...)) + do + local _obj_0 = getmetatable(tb) + _obj_0['value'](_obj_0, 123, ...) + end + local _obj_0 = getmetatable(tb) + return _obj_0['value'](_obj_0, 123, ...) end do - f = getmetatable(tb).__value(123, ...) + f = getmetatable(tb)["value"](123, ...) f = getmetatable(tb)["value" .. tostring(x < y)](123, ...) f(getmetatable(tb)['value'](123, ...)) getmetatable(tb)[ [[ value -- cgit v1.2.3-55-g6feb