From e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 17 Aug 2023 10:36:15 +0800 Subject: add unicode identifier support, fix more issue from #144 --- spec/outputs/plus.lua | 24 +- spec/outputs/unicode/ambiguous.lua | 114 +++ spec/outputs/unicode/assign.lua | 171 ++++ spec/outputs/unicode/attrib.lua | 122 +++ spec/outputs/unicode/backcall.lua | 151 ++++ spec/outputs/unicode/bubbling.lua | 123 +++ spec/outputs/unicode/class.lua | 1242 ++++++++++++++++++++++++++++++ spec/outputs/unicode/comprehension.lua | 276 +++++++ spec/outputs/unicode/cond.lua | 354 +++++++++ spec/outputs/unicode/destructure.lua | 637 +++++++++++++++ spec/outputs/unicode/do.lua | 48 ++ spec/outputs/unicode/existential.lua | 223 ++++++ spec/outputs/unicode/export.lua | 338 ++++++++ spec/outputs/unicode/export_default.lua | 19 + spec/outputs/unicode/funcs.lua | 222 ++++++ spec/outputs/unicode/global.lua | 91 +++ spec/outputs/unicode/goto.lua | 67 ++ spec/outputs/unicode/import.lua | 112 +++ spec/outputs/unicode/in_expression.lua | 181 +++++ spec/outputs/unicode/lists.lua | 281 +++++++ spec/outputs/unicode/literals.lua | 36 + spec/outputs/unicode/local.lua | 157 ++++ spec/outputs/unicode/loops.lua | 337 ++++++++ spec/outputs/unicode/macro.lua | 321 ++++++++ spec/outputs/unicode/metatable.lua | 168 ++++ spec/outputs/unicode/multiline_chain.lua | 135 ++++ spec/outputs/unicode/nil_coalescing.lua | 182 +++++ spec/outputs/unicode/operators.lua | 29 + spec/outputs/unicode/pipe.lua | 135 ++++ spec/outputs/unicode/plus.lua | 73 ++ spec/outputs/unicode/return.lua | 126 +++ spec/outputs/unicode/string.lua | 53 ++ spec/outputs/unicode/stub.lua | 26 + spec/outputs/unicode/switch.lua | 401 ++++++++++ spec/outputs/unicode/syntax.lua | 431 +++++++++++ spec/outputs/unicode/tables.lua | 594 ++++++++++++++ spec/outputs/unicode/try_catch.lua | 61 ++ spec/outputs/unicode/unless_else.lua | 7 + spec/outputs/unicode/using.lua | 30 + spec/outputs/unicode/vararg.lua | 301 ++++++++ spec/outputs/unicode/whitespace.lua | 98 +++ spec/outputs/unicode/with.lua | 222 ++++++ 42 files changed, 8708 insertions(+), 11 deletions(-) create mode 100644 spec/outputs/unicode/ambiguous.lua create mode 100644 spec/outputs/unicode/assign.lua create mode 100644 spec/outputs/unicode/attrib.lua create mode 100644 spec/outputs/unicode/backcall.lua create mode 100644 spec/outputs/unicode/bubbling.lua create mode 100644 spec/outputs/unicode/class.lua create mode 100644 spec/outputs/unicode/comprehension.lua create mode 100644 spec/outputs/unicode/cond.lua create mode 100644 spec/outputs/unicode/destructure.lua create mode 100644 spec/outputs/unicode/do.lua create mode 100644 spec/outputs/unicode/existential.lua create mode 100644 spec/outputs/unicode/export.lua create mode 100644 spec/outputs/unicode/export_default.lua create mode 100644 spec/outputs/unicode/funcs.lua create mode 100644 spec/outputs/unicode/global.lua create mode 100644 spec/outputs/unicode/goto.lua create mode 100644 spec/outputs/unicode/import.lua create mode 100644 spec/outputs/unicode/in_expression.lua create mode 100644 spec/outputs/unicode/lists.lua create mode 100644 spec/outputs/unicode/literals.lua create mode 100644 spec/outputs/unicode/local.lua create mode 100644 spec/outputs/unicode/loops.lua create mode 100644 spec/outputs/unicode/macro.lua create mode 100644 spec/outputs/unicode/metatable.lua create mode 100644 spec/outputs/unicode/multiline_chain.lua create mode 100644 spec/outputs/unicode/nil_coalescing.lua create mode 100644 spec/outputs/unicode/operators.lua create mode 100644 spec/outputs/unicode/pipe.lua create mode 100644 spec/outputs/unicode/plus.lua create mode 100644 spec/outputs/unicode/return.lua create mode 100644 spec/outputs/unicode/string.lua create mode 100644 spec/outputs/unicode/stub.lua create mode 100644 spec/outputs/unicode/switch.lua create mode 100644 spec/outputs/unicode/syntax.lua create mode 100644 spec/outputs/unicode/tables.lua create mode 100644 spec/outputs/unicode/try_catch.lua create mode 100644 spec/outputs/unicode/unless_else.lua create mode 100644 spec/outputs/unicode/using.lua create mode 100644 spec/outputs/unicode/vararg.lua create mode 100644 spec/outputs/unicode/whitespace.lua create mode 100644 spec/outputs/unicode/with.lua (limited to 'spec/outputs') diff --git a/spec/outputs/plus.lua b/spec/outputs/plus.lua index 749e830..bd89bfe 100644 --- a/spec/outputs/plus.lua +++ b/spec/outputs/plus.lua @@ -1,16 +1,18 @@ -x["do"](x, "work") +local _call_0 = x +_call_0["do"](_call_0, "work") func((function() - local _call_0 = a["do"](a) - local _call_1 = _call_0["end"](_call_0, "OK") - return _call_1["if"](_call_1, "abc", 123) + local _call_1 = a + local _call_2 = _call_1["do"](_call_1) + local _call_3 = _call_2["end"](_call_2, "OK") + return _call_3["if"](_call_3, "abc", 123) end)()) -local _call_0 = b["function"] -local _call_1 = _call_0["do"](_call_0) -local _call_2 = _call_1["while"](_call_1, "OK") -local res = _call_2["if"](_call_2, "def", 998) -local _call_3 = c["repeat"]["if"] -local _call_4 = _call_3["then"](_call_3, "xyz") -_call_4["else"](_call_4, res) +local _call_1 = b["function"] +local _call_2 = _call_1["do"](_call_1) +local _call_3 = _call_2["while"](_call_2, "OK") +local res = _call_3["if"](_call_3, "def", 998) +local _call_4 = c["repeat"]["if"] +local _call_5 = _call_4["then"](_call_4, "xyz") +_call_5["else"](_call_5, res) print(self["for"], self.__class["function"](self.__class, 123)) do local fcolor = message:match("<%w*>") diff --git a/spec/outputs/unicode/ambiguous.lua b/spec/outputs/unicode/ambiguous.lua new file mode 100644 index 0000000..3783026 --- /dev/null +++ b/spec/outputs/unicode/ambiguous.lua @@ -0,0 +1,114 @@ +local _u7ed1_u5b9a = _u6293_u53d6["绑定"]; +(_u7ed1_u5b9a(_u58f0_u660e))({ + ["颜色"] = "Red" +}) +local _u53d8_u91cfa = 'b' +local _u53d8_u91cfc = _u53d8_u91cfd; +(_u53d8_u91cfa(_u53d8_u91cfb))(_u53d8_u91cfc(_u53d8_u91cfd)) +_u53d8_u91cfc = _u53d8_u91cfd["变量c"]; +(_u53d8_u91cfa(_u53d8_u91cfb))(_u53d8_u91cfc(_u53d8_u91cfd)); +(_u53d8_u91cfc(_u53d8_u91cfd))(_u53d8_u91cfa(_u53d8_u91cfb)) +local _u53d8_u91cfb +_u53d8_u91cfa, _u53d8_u91cfb = _u53d8_u91cfc, _u53d8_u91cfd; +(_u53d8_u91cfd(_u53d8_u91cfa))(_u53d8_u91cfc) +for _u8ba1_u6570 = 1, 10 do + _u53d8_u91cfa = function() end + (_u6253_u5370)(1) + _u53d8_u91cfa = _u53d8_u91cff; + (_u6253_u5370)(2) + if _u6761_u4ef6 then + (_u6253_u5370)(3) + end + ::_u8df3_u8f6c_u4f4d_u7f6e::; + (_u6253_u5370)(4) + goto _u8df3_u8f6c_u4f4d_u7f6e; + (_u6253_u5370)(5) +end +do + _u6253_u5370(); + (a_u53d8_u91cf)(b_u53d8_u91cf(1)) + _u6253_u5370(); + (fn)(function() end) +end +do + _u6253_u5370() + _u5f02_u6b65_u51fd_u6570(function() + _u6253_u5370(); +--[[a comment to insert]] + (haha)() + return nil + end) +end +do + _u6253_u5370(123) +end +do + _u51fd_u6570f({ + ["v变量"] = v_u53d8_u91cf + }) + local _u6570_u7ec4 + do + local _accum_0 = { } + local _len_0 = 1 + while _u6761_u4ef6f do + _accum_0[_len_0] = { + ["v变量"] = v_u53d8_u91cf + } + _len_0 = _len_0 + 1 + end + _u6570_u7ec4 = _accum_0 + end + repeat + _u6253_u5370(_u53d8_u91cfv) + until _u6761_u4ef6f({ + ["变量v"] = _u53d8_u91cfv + }) + do + local _with_0 = _u6761_u4ef6f + local _u53d8_u91cfv = _u6570_u7ec4["变量v"] + _with_0["字段x"] = 1 + end + local _u53d8_u91cfx + if _u6761_u4ef6f then + _u53d8_u91cfx = { + ["字段v"] = _u5b57_u6bb5v + } + end + do + local _exp_0 = _u6761_u4ef6f({ + ["字段v"] = _u5b57_u6bb5v + }) + if _u6761_u4ef6f == _exp_0 then + _u53d8_u91cfx = { + ["字段v"] = _u5b57_u6bb5v + } + end + end + local _u6570_u5b57_u6570_u7ec4 + do + local _accum_0 = { } + local _len_0 = 1 + for _u6570_u5b57 = 1, _u957f_u5ea6 do + _accum_0[_len_0] = { + ["数字"] = _u6570_u5b57 + } + _len_0 = _len_0 + 1 + end + _u6570_u5b57_u6570_u7ec4 = _accum_0 + end + local _u5bf9_u8c61_u6570_u7ec4 + do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u7269_u4ef6_u6570_u7ec4 + for _index_0 = 1, #_list_0 do + local _u7269_u4ef6 = _list_0[_index_0] + _accum_0[_len_0] = { + ["名称"] = _u7269_u4ef6 + } + _len_0 = _len_0 + 1 + end + _u5bf9_u8c61_u6570_u7ec4 = _accum_0 + end +end +return nil diff --git a/spec/outputs/unicode/assign.lua b/spec/outputs/unicode/assign.lua new file mode 100644 index 0000000..b530093 --- /dev/null +++ b/spec/outputs/unicode/assign.lua @@ -0,0 +1,171 @@ +local __u65e0_u6548_u53d8_u91cf +__u65e0_u6548_u53d8_u91cf = function() + local joop_u53d8_u91cf = 2302 + return function(_u597d) + local _u53d8_u91cfd = 100 + _u597d = 1021 + local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc + _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd = 1, 2, 3, 4 + local _u4f60_u597d + _u4f60_u597d[232], (5 + 5)[121], _u4f60_u597d, _u53d8_u91cfx[99] = 100, 200, 300, 400 + joop_u53d8_u91cf = 12 + end +end +local joop_u53d8_u91cf = 2345 +local _u53d8_u91cfa, _u53d8_u91cfb +if _u4f60_u597d then + _u53d8_u91cfa, _u53d8_u91cfb = "你好", nil +else + _u53d8_u91cfa, _u53d8_u91cfb = "没啥", "✌️" +end +if _u4f60_u597d then + if _u270c_ufe0f then + _u53d8_u91cfa, _u53d8_u91cfb = "一", "二" + else + _u53d8_u91cfa, _u53d8_u91cfb = "mmhh", nil + end +else + _u6253_u5370("其它东西") + _u53d8_u91cfa, _u53d8_u91cfb = "没啥事", "✌️" +end +local _u53d8_u91cfc, _u53d8_u91cfd +if true then + _u53d8_u91cfc, _u53d8_u91cfd = 1, 2 +end +local _u53d8_u91cfx +do + local _u51fd_u6570 = _u83b7_u53d6_u5904_u7406_u51fd_u6570() + if _u51fd_u6570 then + do + _u51fd_u6570() + _u53d8_u91cfx = 123 + end + end +end +return __u65e0_u6548_u53d8_u91cf(function() + setmetatable(a_u53d8_u91cf, (function() + _u6253_u5370(123) + return { } + end)()) + do + local _u5143_u7d20a, _u5143_u7d20b + do + local _exp_0 = _u5bf9_u8c61c + if "a" == _exp_0 then + do + local _obj_0 = _u5b57_u5178 + _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] + end + elseif "b" == _exp_0 then + do + local _obj_0 = _u51fd_u6570() + _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] + end + end + end + end + do + local _obj_0 = a_u6570_u7ec4 + if _u6761_u4ef6x then + _obj_0[#_obj_0 + 1] = 1 + else + _obj_0[#_obj_0 + 1] = 2 + end + end + do + local _u53d8_u91cfa + if x_u6761_u4ef6 then + do + local _exp_0 = _u5bf9_u8c61y + if 1 == _exp_0 then + do + local _obj_0, _obj_1 = _u51fd_u6570() + _u53d8_u91cfb[#_u53d8_u91cfb + 1] = _obj_1 + _u53d8_u91cfa = _obj_0 + end + end + end + end + end + do + local _u53d8_u91cfa + local _u5143_u7d20b + if x_u6761_u4ef6 then + do + local _obj_0, _obj_1 = _u51fd_u6570() + _u53d8_u91cfa = _obj_0 + _u5143_u7d20b = _obj_1[1] + end + else + _u53d8_u91cfa = 123 + _u5143_u7d20b = _u8868[1] + end + end + do + local _u53d8_u91cfa, _u5bf9_u8c61c + if _u6761_u4ef6x then + do + local _exp_0 = _u5bf9_u8c61y + if 1 == _exp_0 then + do + local _obj_0, _obj_1, _obj_2, _obj_3 = _u51fd_u6570() + do + local _obj_4 = _u6570_u7ec4b + _obj_4[#_obj_4 + 1] = _obj_1 + end + _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = _obj_0, _obj_2, _obj_3 + end + end + end + elseif _u6761_u4ef6x2 then + if _u6761_u4ef6y2 then + do + local _obj_0, _obj_1, _obj_2, _obj_3 = _u51fd_u65701() + do + local _obj_4 = _u6570_u7ec4b + _obj_4[#_obj_4 + 1] = _obj_1 + end + _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = _obj_0, _obj_2, _obj_3 + end + end + else + _u6253_u5370("hello") + do + _u6253_u5370(123) + do + local _obj_0, _obj_1, _obj_2 = _u51fd_u65702() + do + local _obj_3 = _u6570_u7ec4b + _obj_3[#_obj_3 + 1] = _obj_0 + end + _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = 1, _obj_1, _obj_2 + end + end + end + end + do + local _u53d8_u91cfa = 0 + local _u53d8_u91cfb = 0 + local _u53d8_u91cfc = 0 + local _u53d8_u91cfd = 0 + end + do + local a_u53d8_u91cf = _u51fd_u6570() + local b_u53d8_u91cf = a_u53d8_u91cf + local c_u53d8_u91cf = a_u53d8_u91cf + local d_u53d8_u91cf = a_u53d8_u91cf + end + do + local _u53d8_u91cfe = _u6570_u7ec4_u5bf9_u8c61 + local a_u5143_u7d20 = _u53d8_u91cfe[1] + local _u5b57_u6bb5b = _u53d8_u91cfe["字段b"] + _u5bf9_u8c61c["字段d"] = _u53d8_u91cfe + end + do + local _u503c = 123 + local _u53d8_u91cfa = _u503c + local _u53d8_u91cfb = _u503c + local _u53d8_u91cfc = _u503c + end + return nil +end) diff --git a/spec/outputs/unicode/attrib.lua b/spec/outputs/unicode/attrib.lua new file mode 100644 index 0000000..0f60451 --- /dev/null +++ b/spec/outputs/unicode/attrib.lua @@ -0,0 +1,122 @@ +local _u5e38_u91cfa , _u5e38_u91cfb , _u5e38_u91cfc , _u5e38_u91cfd = 1, 2, 3, 4 +do + local _u5173_u95ed_u53d8_u91cfa, _u5173_u95ed_u53d8_u91cfb = setmetatable({ }, { + __close = function(self) + return _u6253_u5370("已关闭") + end + }) + local _close_0 = _u5173_u95ed_u53d8_u91cfa + local _close_1 = _u5173_u95ed_u53d8_u91cfb + local _u53d8_u91cfc , _u5e38_u91cfd = 123, 'abc' + close(_u5e38_u91cfa, _u5e38_u91cfb) + const(_u5e38_u91cfc, _u5e38_u91cfd) +end +do + local _u5e38_u91cfa = _u51fd_u6570() + local _u5143_u7d20b, _u5143_u7d20c, _u5143_u7d20d + do + local _obj_0, _obj_1 = _u51fd_u65701() + _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2] + _u5143_u7d20d = _obj_1[1] + end +end +do + local _u5e38_u91cfa, _u5143_u7d20b, _u5143_u7d20c, _u5143_u7d20d + do + local _obj_0, _obj_1, _obj_2 = _u51fd_u6570() + _u5e38_u91cfa = _obj_0 + _u5143_u7d20b, _u5143_u7d20c = _obj_1[1], _obj_1[2] + _u5143_u7d20d = _obj_2[1] + end +end +do + local _u5173_u95ed_u53d8_u91cfv = (function() + if _u6807_u8bb0_u4e3a_u771f then + return _u51fd_u6570_u8c03_u7528() + else + return setmetatable({ }, { + __close = function(self) end + }) + end + end)() + local _u5173_u95ed_u53d8_u91cff = (function() + local _with_0 = io.open("文件.txt") + _with_0:write("你好") + return _with_0 + end)() +end +do + local _u5e38_u91cfa = (function() + if true then + return 1 + end + end)() + local _u5173_u95ed_u53d8_u91cfb = (function() + if not false then + if _u6761_u4ef6x then + return 1 + end + end + end)() + local _u5e38_u91cfc = (function() + if true then + local _exp_0 = _u6761_u4ef6x + if "abc" == _exp_0 then + return 998 + end + end + end)() + local _u5173_u95ed_u53d8_u91cfd = (function() + if (function() + local _exp_0 = _u6761_u4ef6a + if _exp_0 ~= nil then + return _exp_0 + else + return _u6761_u4ef6b + end + end)() then + return { + ["数值"] = _u6570_u503c + } + end + end)() +end +do + local __u65e0_u6548_u53d8_u91cf = (function() + local _with_0 = io.open("文件.txt") + _with_0:write("你好") + return _with_0 + end)() + local __u65e0_u6548_u53d8_u91cf = setmetatable({ }, { + __close = function() + return _u6253_u5370("第二") + end + }) + local __u65e0_u6548_u53d8_u91cf = setmetatable({ }, { + __close = function() + return _u6253_u5370("第一") + end + }) +end +local __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 = setmetatable({ }, { + __close = function(self) + self[#self]() + self[#self] = nil + end +}) +local _u5ef6_u8fdf +_u5ef6_u8fdf = function(_u9879_u76ee) + __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4[#__u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 + 1] = _u9879_u76ee + return __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 +end +do + local __u65e0_u6548_u53d8_u91cf = _u5ef6_u8fdf(function() + return _u6253_u5370(3) + end) + local __u65e0_u6548_u53d8_u91cf = _u5ef6_u8fdf(function() + return _u6253_u5370(2) + end) + local __u65e0_u6548_u53d8_u91cf = _u5ef6_u8fdf(function() + return _u6253_u5370(1) + end) +end diff --git a/spec/outputs/unicode/backcall.lua b/spec/outputs/unicode/backcall.lua new file mode 100644 index 0000000..91dfdff --- /dev/null +++ b/spec/outputs/unicode/backcall.lua @@ -0,0 +1,151 @@ +do + _u6620_u5c04({ + 1, + 2, + 3 + }, function(_u9879_u76ee) + return _u9879_u76ee * 2 + end) +end +do + _u6620_u5c04(function(_u9879_u76ee) + return _u9879_u76ee * 2 + end, { + 1, + 2, + 3 + }) +end +do + _u8fc7_u6ee4(function(_u9879_u76ee) + return _u9879_u76ee > 2 + end, (function() + return _u6620_u5c04(function(_u9879_u76ee) + return _u9879_u76ee * 2 + end, { + 1, + 2, + 3, + 4 + }) + end)()) +end +do + do + local _obj_0 = _u7f51_u7edc + if _obj_0 ~= nil then + _obj_0["获取"]("测试地址", function(_u6570_u636e) + local _call_0 = _u7f51_u9875_u4f53[".结果"] + _call_0["网页"](_call_0, _u6570_u636e) + return _u7f51_u7edc["请求"]("测试地址", _u6570_u636e, function(_u662f_u5426_u5904_u7406_u6210_u529f) + local _call_1 = _u7f51_u9875_u4f53[".结果"] + _call_1["添加"](_call_1, _u662f_u5426_u5904_u7406_u6210_u679c) + return _u8bbe_u7f6e_u8d85_u65f6_u56de_u8c03(1000, function() + return _u6253_u5370("完成") + end) + end) + end) + end + end +end +do + _u540c_u6b65_u72b6_u6001(function() + return _u5f02_u6b65_u52a0_u8f7d("文件.yue", function(_u9519_u8bef_u4fe1_u606f, _u6570_u636e) + if _u6570_u636e == nil then + _u6570_u636e = "nil" + end + if _u9519_u8bef_u4fe1_u606f then + _u6253_u5370(_u9519_u8bef_u4fe1_u606f) + return + end + return _u5f02_u6b65_u7f16_u8bd1(_u6570_u636e, function(_u4ee3_u7801) + local _u7ed3_u679c_u51fd_u6570 = _u52a0_u8f7d_u5b57_u7b26_u4e32(_u4ee3_u7801) + return _u7ed3_u679c_u51fd_u6570() + end) + end) + end) +end +do + _u51fd_u65701(function() + return _u51fd_u65702(function() + do + _u51fd_u65703(function() + return _u51fd_u65704(function() end) + end) + end + return _u51fd_u65705(function() + return _u51fd_u65706(function() + return _u51fd_u65707() + end) + end) + end) + end) +end +do + local _u7ed3_u679c, _u6d88_u606f + do + do + local _obj_0 = _u5f02_u6b65_u63a5_u6536("文件名.txt", function(_u6570_u636e) + _u6253_u5370(_u6570_u636e) + return _u5f02_u6b65_u5904_u7406(_u6570_u636e, function(_u4fe1_u606f) + return _u68c0_u67e5(_u4fe1_u606f) + end) + end) + _u7ed3_u679c, _u6d88_u606f = _obj_0["结果"], _obj_0["消息"] + end + end + _u6253_u5370(_u7ed3_u679c, _u6d88_u606f) + local _u603b_u5927_u5c0f = _u5408_u5e76(((function() + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u6587_u4ef6_u6570_u7ec4 + for _index_0 = 1, #_list_0 do + local _u6587_u4ef6 = _list_0[_index_0] + _accum_0[_len_0] = _u5f02_u6b65_u52a0_u8f7d(_u6587_u4ef6, function(_u6570_u636e) + return _u52a0_u5165_u7f13_u5b58(_u6587_u4ef6, _u6570_u636e) + end) + _len_0 = _len_0 + 1 + end + return _accum_0 + end)()), 0, function(_u5bf9_u8c61a, _u5bf9_u8c61b) + return _u5bf9_u8c61a + _u5bf9_u8c61b + end) +end +local _u5c5e_u6027A +do + _u5c5e_u6027A = _u5c5e_u6027_u5b9a_u4e49(function(self) + return self["_值"] + end, function(self, _u503c) + _u6253_u5370("之前值: " .. tostring(self["_值"])) + _u6253_u5370("最新值: " .. tostring(_u503c)) + self["_值"] = _u503c + end) +end +local _u5c5e_u6027B +do + _u5c5e_u6027B = _u5c5e_u6027_u5b9a_u4e49(function(self) + return self["_值"] + end, function(self, _u503c) + _u6253_u5370("之前值: " .. tostring(self["_值"])) + _u6253_u5370("最新值: " .. tostring(_u503c)) + self["_值"] = _u503c + end) +end +_u8b66_u544a("嗨") +local _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz +do + _u53d8_u91cfx = (_u53d8_u91cfa) < -_u53d8_u91cfb +end +do + _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(_u53d8_u91cfa) end) +end +do + _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(_u53d8_u91cfa) end) +end +do + _u53d8_u91cfx = _u53d8_u91cfa <= _u53d8_u91cfb +end +do + _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(self, _u53d8_u91cfa) end) +end +return nil diff --git a/spec/outputs/unicode/bubbling.lua b/spec/outputs/unicode/bubbling.lua new file mode 100644 index 0000000..cb8750d --- /dev/null +++ b/spec/outputs/unicode/bubbling.lua @@ -0,0 +1,123 @@ +local _u51fd_u6570 +_u51fd_u6570 = function(...) + return #{ + ... + } +end +local _u4e0d_u8981_u5192_u6ce1 +_u4e0d_u8981_u5192_u6ce1 = function() + local _accum_0 = { } + local _len_0 = 1 + for _u5143_u7d20 in (function(...) + return _u6253_u5370(...) + end)("你好") do + _accum_0[_len_0] = _u5143_u7d20 + _len_0 = _len_0 + 1 + end + return _accum_0 +end +local _u53d8_u91cfk +do + local _accum_0 = { } + local _len_0 = 1 + for _u5143_u7d20 in (function(...) + return _u6253_u5370(...) + end)("你好") do + _accum_0[_len_0] = _u5143_u7d20 + _len_0 = _len_0 + 1 + end + _u53d8_u91cfk = _accum_0 +end +local _u53d8_u91cfj +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = function(...) + return _u6253_u5370(...) + end + _len_0 = _len_0 + 1 + end + _u53d8_u91cfj = _accum_0 +end +local _u53d8_u91cfm +_u53d8_u91cfm = function(...) + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = { + ... + } + for _index_0 = 1, #_list_0 do + local _u5143_u7d20 = _list_0[_index_0] + if _u51fd_u6570(...) > 4 then + _accum_0[_len_0] = _u5143_u7d20 + _len_0 = _len_0 + 1 + end + end + return _accum_0 +end +local __u65e0_u6548_u53d8_u91cf +__u65e0_u6548_u53d8_u91cf = function(...) + local _u6570_u7ec4x + do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = { + ... + } + for _index_0 = 1, #_list_0 do + local _u8ba1_u6570 = _list_0[_index_0] + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + _u6570_u7ec4x = _accum_0 + end + local _u6570_u7ec4y + do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = { + ... + } + for _index_0 = 1, #_list_0 do + local _u5143_u7d20 = _list_0[_index_0] + _accum_0[_len_0] = _u5143_u7d20 + _len_0 = _len_0 + 1 + end + _u6570_u7ec4y = _accum_0 + end + local _u6570_u7ec4z + do + local _accum_0 = { } + local _len_0 = 1 + for _u5143_u7d20 in _u5217_u8868 do + if _u51fd_u6570(...) > 4 then + _accum_0[_len_0] = _u5143_u7d20 + _len_0 = _len_0 + 1 + end + end + _u6570_u7ec4z = _accum_0 + end + local _u6570_u7ec4a + do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = ... + _len_0 = _len_0 + 1 + end + _u6570_u7ec4a = _accum_0 + end + local _u6570_u7ec4b + do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = function(...) + return _u6253_u5370(...) + end + _len_0 = _len_0 + 1 + end + _u6570_u7ec4b = _accum_0 + end +end diff --git a/spec/outputs/unicode/class.lua b/spec/outputs/unicode/class.lua new file mode 100644 index 0000000..4d309e3 --- /dev/null +++ b/spec/outputs/unicode/class.lua @@ -0,0 +1,1242 @@ +local _u4f60_u597d +do + local _class_0 + local _base_0 = { + ["你好"] = function(self) + return _u6253_u5370(self["测试"], self["世界"]) + end, + __tostring = function(self) + return "你好 世界" + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self, _u6d4b_u8bd5, _u4e16_u754c) + self["测试"] = _u6d4b_u8bd5 + self["世界"] = _u4e16_u754c + return _u6253_u5370("创建对象..") + end, + __base = _base_0, + __name = "你好" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u4f60_u597d = _class_0 +end +local _u5bf9_u8c61x = _u4f60_u597d(1, 2) +_u5bf9_u8c61x["你好"](_u5bf9_u8c61x) +_u6253_u5370(_u5bf9_u8c61x) +local _u7b80_u5355 +do + local _class_0 + local _base_0 = { + ["酷"] = function(self) + return _u6253_u5370("酷") + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "简单" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u7b80_u5355 = _class_0 +end +local _u4f0a_u514b_u65af +do + local _class_0 + local _parent_0 = _u7b80_u5355 + local _base_0 = { } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self) + return _u6253_u5370("你好已创建") + end, + __base = _base_0, + __name = "伊克斯", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u4f0a_u514b_u65af = _class_0 +end +local x_u5bf9_u8c61 = _u4f0a_u514b_u65af() +x_u5bf9_u8c61["酷"](x_u5bf9_u8c61) +local _u55e8 +do + local _class_0 + local _base_0 = { + ["酷"] = function(self, _u6570_u503c) + return _u6253_u5370("数值", _u6570_u503c) + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self, _u53c2_u6570) + return _u6253_u5370("初始化参数", _u53c2_u6570) + end, + __base = _base_0, + __name = "嗨" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u55e8 = _class_0 +end +do + local _class_0 + local _parent_0 = _u55e8 + local _base_0 = { + ["酷"] = function(self) + return _class_0.__parent.__base["酷"](self, 120302) + end + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self) + return _class_0.__parent.__init(self, "伙计") + end, + __base = _base_0, + __name = "简单", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u7b80_u5355 = _class_0 +end +x_u5bf9_u8c61 = _u7b80_u5355() +x_u5bf9_u8c61["酷"](x_u5bf9_u8c61) +_u6253_u5370(x_u5bf9_u8c61.__class == _u7b80_u5355) +local _u597d_u5427 +do + local _class_0 + local _base_0 = { + ["一些东西"] = 20323 + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "好吧" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u597d_u5427 = _class_0 +end +local _u597d_u54d2 +do + local _class_0 + local _parent_0 = _u597d_u5427 + local _base_0 = { + ["一些东西"] = function(self) + _class_0.__parent.__base["一些东西"](self, 1, 2, 3, 4) + _class_0.__parent["一些东西"](_u53e6_u4e00_u4e2a_u81ea_u5df1, 1, 2, 3, 4) + return _u65ad_u8a00(_class_0.__parent == _u597d_u5427) + end + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "好哒", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u597d_u54d2 = _class_0 +end +local _u597d +do + local _class_0 + local _base_0 = { + ["不错"] = function(self) + local _call_0 = _class_0.__parent + return _call_0["一些东西"](_call_0, self, 1, 2, 3, 4) + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "好" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u597d = _class_0 +end +local _u4ec0_u4e48 +do + local _class_0 + local _base_0 = { + ["一些东西"] = function(self) + return _u6253_u5370("值:", self["值"]) + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "什么" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u4ec0_u4e48 = _class_0 +end +do + local _class_0 + local _parent_0 = _u4ec0_u4e48 + local _base_0 = { + ["值"] = 2323, + ["一些东西"] = function(self) + local _base_1 = _class_0.__parent + local _fn_0 = _base_1["一些东西"] + return _fn_0 and function(...) + return _fn_0(_base_1, ...) + end + end + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "你好", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u4f60_u597d = _class_0 +end +do + local _with_0 = _u4f60_u597d() + _u5bf9_u8c61x = _with_0["一些对象"](_with_0) + _u6253_u5370(_u5bf9_u8c61x) + _u5bf9_u8c61x() +end +local _u8d85_u7ea7_u9177 +do + local _class_0 + local _base_0 = { + ["👋"] = function(self) + _class_0.__parent.__base["👋"](self, 1, 2, 3, 4)(1, 2, 3, 4) + _class_0.__parent["一些东西"](1, 2, 3, 4) + local _ = _class_0.__parent["一些东西"](1, 2, 3, 4)["世界"] + local _call_0 = _class_0.__parent + _call_0["好吧"](_call_0, self, "世界")["不错"](_u54c8, _u54c8, _u54c8) + _ = _u4e00_u4e9b_u4e1c_u897f["上级"] + _ = _class_0.__parent["上级"]["上级"]["上级"] + do + local _base_1 = _class_0.__parent + local _fn_0 = _base_1["你好"] + _ = _fn_0 and function(...) + return _fn_0(_base_1, ...) + end + end + return nil + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "超级酷" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u8d85_u7ea7_u9177 = _class_0 +end +local _u53d8_u91cfx = self["你好"] +_u53d8_u91cfx = self.__class["你好"] +self["你好"](self, "世界") +self.__class["你好"](self.__class, "世界") +self.__class["一"](self.__class, self.__class["二"](self.__class, 4, 5)(self["三"], self["四"])) +local _u53d8_u91cfxx +_u53d8_u91cfxx = function(_u4f60_u597d, _u4e16_u754c, _u9177) + self["你好"] = _u4f60_u597d + self.__class["世界"] = _u4e16_u754c +end +local _u4e00_u4e2a_u7c7b +do + local _class_0 + local _base_0 = { + ["蓝色"] = function(self) end, + ["绿色"] = function(self) end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "一个类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + self["好"] = 343 + self["你好"] = 3434 + self["世界"] = 23423 + self["红色"] = function(self) end + _u4e00_u4e2a_u7c7b = _class_0 +end +_u53d8_u91cfx = self +local _u53d8_u91cfy = self.__class +self(_u4e00_u4e9b_u4e1c_u897f) +self.__class(_u4e00_u4e9b_u4e1c_u897f) +local self = self + self / self +self = 343 +self["你好"](2, 3, 4) +local _ = _u4f60_u597d[self]["世界"] +local _u602a_u602a_u7684 +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "怪怪的" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = self["你好"] + if _u4e00_u4e9b_u4e1c_u897f then + _u6253_u5370("你好世界") + end + _u4f60_u597d = "世界" + self["另一"] = "天" + if _u4e00_u4e9b_u4e1c_u897f then + _u6253_u5370("好") + end + _u602a_u602a_u7684 = _class_0 +end +_u6253_u5370("你好") +local _u53d8_u91cfyyy +_u53d8_u91cfyyy = function() + local _u9177 + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "酷" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = nil + _u9177 = _class_0 + return _class_0 + end +end +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "子类D" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = nil + _u5bf9_u8c61a["字段b"]["字段c"]["子类D"] = _class_0 +end +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "你好" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = nil + _u5bf9_u8c61a["字段b"]["你好"] = _class_0 +end +do + local _class_0 + local _parent_0 = _u4f60_u597d["世界"] + local _base_0 = { } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "某个成员", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = nil + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + (function() + return require("moon") + end)()["某个成员"] = _class_0 +end +local _u7c7ba +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "类a" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u7c7ba = _class_0 +end +local _u7c7bb +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "一个类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u4e00_u4e2a_u7c7b = _class_0 + _u7c7bb = _class_0 +end +local _u7c7bc +do + local _class_0 + local _parent_0 = _u4f60_u597d + local _base_0 = { } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "一个类", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u4e00_u4e2a_u7c7b = _class_0 + _u7c7bc = _class_0 +end +local _u7c7bd +do + local _class_0 + local _parent_0 = _u4e16_u754c + local _base_0 = { } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "类d", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u7c7bd = _class_0 +end +_u6253_u5370(((function() + local _u5565_u4e8b + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "啥事" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u5565_u4e8b = _class_0 + return _class_0 + end +end)()).__name) +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "一个类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _ = nil + _u4e00_u4e2a_u7c7b = _class_0 +end +do + local _class_0 + local _u503c, _u63d2_u5165 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self) + return _u6253_u5370(_u63d2_u5165, _u503c) + end, + __base = _base_0, + __name = "一个类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _u503c = 23 + _u63d2_u5165 = _u8868["插入"] + _u4e00_u4e2a_u7c7b = _class_0 +end +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = _u55e8, + __base = _base_0, + __name = "X类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + X_u7c7b = _class_0 +end +local _u9177 +do + local _class_0 + local _parent_0 = _u4e1c_u897f + local _base_0 = { + ["当"] = function(self) + return { + ["你好"] = function() + return _class_0.__parent.__base["当"](self) + end, + ["世界"] = function() + return _class_0.__parent.one + end + } + end + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "酷", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u9177 = _class_0 +end +local _u5947_u602a +do + local _class_0 + local _parent_0 = _u4e1c_u897f + local _base_0 = { + ["当"] = _u505a_u70b9_u4e8b(function(self) + return _class_0.__parent.__base["当"](self) + end) + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "奇怪", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u5947_u602a = _class_0 +end +local _u5594_u54c8 +do + local _class_0 + local _parent_0 = _u4e1c_u897f + local _base_0 = { } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __name = "喔哈", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + self["底部"] = function() + _class_0.__parent["底部"](self) + _ = _class_0.__parent["你好"] + local _call_0 = _class_0.__parent + _call_0["你好"](_call_0, self) + local _base_1 = _class_0.__parent + local _fn_0 = _base_1["你好"] + return _fn_0 and function(...) + return _fn_0(_base_1, ...) + end + end + self["空间"] = _u9177({ + function() + _class_0.__parent["空间"](self) + _ = _class_0.__parent["你好"] + local _call_0 = _class_0.__parent + _call_0["你好"](_call_0, self) + local _base_1 = _class_0.__parent + local _fn_0 = _base_1["你好"] + return _fn_0 and function(...) + return _fn_0(_base_1, ...) + end + end + }) + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + _u5594_u54c8 = _class_0 +end +do + local _u6d4b_u8bd5 + do + local _class_0 + local _base_0 = { + ["测试"] = function(self) + return self.__class["如果"] and self.__class["做"](self.__class) + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self) + self.__class["如果"] = true + end, + __base = _base_0, + __name = "测试" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + self["做"] = function(self) + return 1 + end + _u6d4b_u8bd5 = _class_0 + end + local _u6d4b_u8bd5_u5b9e_u4f8b = _u6d4b_u8bd5() + _u6d4b_u8bd5_u5b9e_u4f8b["测试"](_u6d4b_u8bd5_u5b9e_u4f8b) +end +do + local _u6d4b_u8bd5 + do + local _class_0 + local _base_0 = { + ["做"] = function(self) + return 1 + end, + ["测试"] = function(self) + return self["如果"] and self["做"](self) + end + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self) + self["如果"] = true + end, + __base = _base_0, + __name = "测试" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u6d4b_u8bd5 = _class_0 + end + local _u6d4b_u8bd5_u5b9e_u4f8b = _u6d4b_u8bd5() + _u6d4b_u8bd5_u5b9e_u4f8b["测试"](_u6d4b_u8bd5_u5b9e_u4f8b) +end +do + local _class_0 + local _parent_0 = _u9752["应用"] + local _base_0 = { + ["/"] = function(self) + return { + json = { + ["状态"] = true + } + } + end + } + for _key_0, _val_0 in pairs(_parent_0.__base) do + if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then + _base_0[_key_0] = _val_0 + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, ...) + return _class_0.__parent.__init(self, ...) + end, + __base = _base_0, + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end +end +local _u7c7bA +do + local _class_0 + local _base_0 = { } + local _list_0 = { + _u7c7bB, + _u7c7bC, + _u7c7bD, + { + ["值"] = 123 + } + } + for _index_0 = 1, #_list_0 do + local _item_0 = _list_0[_index_0] + local _cls_0, _mixin_0 = (_item_0.__base ~= nil), _item_0.__base or _item_0 + for _key_0, _val_0 in pairs(_mixin_0) do + if _base_0[_key_0] == nil and (not _cls_0 or not _key_0:match("^__")) then + _base_0[_key_0] = _val_0 + end + end + end + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "类A" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u7c7bA = _class_0 +end +local _u793a_u4f8b +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "示例" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + self["字段1"] = 1 + self["字段2"] = self["字段1"] + 1 + _u793a_u4f8b = _class_0 +end +local _u968f_u4fbf +do + local _class_0 + local _base_0 = { + __mul = function(self, _u53c2_u6570y) + return self["x字段"] * _u53c2_u6570y + end, + ["任意名称"] = 123, + ["相加"] = _u76f8_u52a0, + __add = add + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function(self, _u53c2_u6570) + self["x字段"] = _u53c2_u6570 + end, + __base = _base_0, + __name = "随便" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u968f_u4fbf = _class_0 +end +return nil diff --git a/spec/outputs/unicode/comprehension.lua b/spec/outputs/unicode/comprehension.lua new file mode 100644 index 0000000..60e490f --- /dev/null +++ b/spec/outputs/unicode/comprehension.lua @@ -0,0 +1,276 @@ +local _u5217_u8868 = { + 1, + 2, + 3, + 4, + 5, + 6 +} +local _u8f93_u51fa +do + local _tbl_0 = { } + for _u5143_u7d20 in _u5bf9_u8c61_u6570_u7ec4 do + _tbl_0[_u5143_u7d20] = _u5143_u7d20 * 2 + end + _u8f93_u51fa = _tbl_0 +end +local _u5b57_u5178x = { + ["你好"] = "世界", + ["好吧"] = 2323 +} +local _u590d_u5236 +do + local _tbl_0 = { } + for _u952e, _u503c in pairs(_u5bf9_u8c61x) do + if _u952e ~= "好吧" then + _tbl_0[_u952e] = _u503c + end + end + _u590d_u5236 = _tbl_0 +end +local __u65e0_u6548_u53d8_u91cf +do + local _tbl_0 = { } + for _u5143_u7d20 in _u662f_u7684 do + local _key_0, _val_0 = _u89e3_u5305(_u5143_u7d20) + _tbl_0[_key_0] = _val_0 + end + __u65e0_u6548_u53d8_u91cf = _tbl_0 +end +do + local _tbl_0 = { } + local _list_0 = _u662f_u7684 + for _index_0 = 1, #_list_0 do + local _u5143_u7d20 = _list_0[_index_0] + local _key_0, _val_0 = _u89e3_u5305(_u5143_u7d20) + _tbl_0[_key_0] = _val_0 + end + __u65e0_u6548_u53d8_u91cf = _tbl_0 +end +do + local _tbl_0 = { } + for _u5143_u7d20 in _u662f_u7684 do + local _key_0, _val_0 = _u5143_u7d20_u5143_u7d20 + _tbl_0[_key_0] = _val_0 + end + __u65e0_u6548_u53d8_u91cf = _tbl_0 +end +do + local _tbl_0 = { } + local _list_0 = { + { + 1, + 2 + }, + { + 3, + 4 + } + } + for _index_0 = 1, #_list_0 do + local x_u5bf9_u8c61 = _list_0[_index_0] + local _key_0, _val_0 = _u89e3_u5305((function() + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570, _u5bf9_u8c61 in ipairs(x_u5bf9_u8c61) do + _accum_0[_len_0] = _u5bf9_u8c61 * _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + return _accum_0 + end)()) + _tbl_0[_key_0] = _val_0 + end + __u65e0_u6548_u53d8_u91cf = _tbl_0 +end +local _u53d8_u91cf1 +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + _u53d8_u91cf1 = _accum_0 +end +local _u53d8_u91cf2 +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + if _u8ba1_u6570 % 2 == 1 then + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + end + _u53d8_u91cf2 = _accum_0 +end +local _u53d8_u91cfaa +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570x = 1, 10 do + for _u8ba1_u6570y = 5, 14 do + _accum_0[_len_0] = { + _u8ba1_u6570x, + _u8ba1_u6570y + } + _len_0 = _len_0 + 1 + end + end + _u53d8_u91cfaa = _accum_0 +end +local _u53d8_u91cfbb +do + local _accum_0 = { } + local _len_0 = 1 + for _u5143_u7d20 in _u5bf9_u8c61y do + for _u8ba1_u6570i = 1, 10 do + _accum_0[_len_0] = _u5bf9_u8c61y + _len_0 = _len_0 + 1 + end + end + _u53d8_u91cfbb = _accum_0 +end +local _u53d8_u91cfcc +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + for _u5143_u7d20 in _u5bf9_u8c61y do + _accum_0[_len_0] = _u5bf9_u8c61y + _len_0 = _len_0 + 1 + end + end + _u53d8_u91cfcc = _accum_0 +end +local _u53d8_u91cfdd +do + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + if _u9177 then + for _u5143_u7d20 in _u5bf9_u8c61y do + if _u53d8_u91cfx > 3 then + if _u53d8_u91cfc + 3 then + _accum_0[_len_0] = _u5bf9_u8c61y + _len_0 = _len_0 + 1 + end + end + end + end + end + _u53d8_u91cfdd = _accum_0 +end +do + local _tbl_0 = { } + for _u8ba1_u6570 = 1, 10 do + _tbl_0["你好"] = "世界" + end + __u65e0_u6548_u53d8_u91cf = _tbl_0 +end +local _u53d8_u91cfj +do + local _accum_0 = { } + local _len_0 = 1 + for _des_0 in _u5f88_u591a_u4e1c_u897f do + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] + _accum_0[_len_0] = _u5143_u7d20a + _len_0 = _len_0 + 1 + end + _u53d8_u91cfj = _accum_0 +end +local _u53d8_u91cfk +do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u5f88_u591a_u4e1c_u897f + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] + _accum_0[_len_0] = _u5143_u7d20a + _len_0 = _len_0 + 1 + end + _u53d8_u91cfk = _accum_0 +end +local _u53d8_u91cfi +do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u5f88_u591a_u4e1c_u897f + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u4f60_u597d, _u4e16_u754c = _des_0["你好"], _des_0["世界"] + _accum_0[_len_0] = _u4f60_u597d + _len_0 = _len_0 + 1 + end + _u53d8_u91cfi = _accum_0 +end +local _u53d8_u91cfhj +do + local _tbl_0 = { } + for _des_0 in _u5f88_u591a_u4e1c_u897f do + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] + _tbl_0[_u5143_u7d20a] = _u5143_u7d20c + end + _u53d8_u91cfhj = _tbl_0 +end +local _u53d8_u91cfhk +do + local _tbl_0 = { } + local _list_0 = _u5f88_u591a_u4e1c_u897f + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] + _tbl_0[_u5143_u7d20a] = _u5143_u7d20c + end + _u53d8_u91cfhk = _tbl_0 +end +local _u53d8_u91cfhi +do + local _tbl_0 = { } + local _list_0 = _u5f88_u591a_u4e1c_u897f + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u4f60_u597d, _u4e16_u754c = _des_0["你好"], _des_0["世界"] + _tbl_0[_u4f60_u597d] = _u4e16_u754c + end + _u53d8_u91cfhi = _tbl_0 +end +for _des_0 in _u5f88_u591a_u4e1c_u897f do + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] + _u6ca1_u9519(_u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c) +end +do + local _accum_0 = { } + local _len_0 = 1 + local _max_0 = 3 + 4 + for _index_0 = 1 + 2, _max_0 < 0 and #_u5217_u8868 + _max_0 or _max_0 do + local _u9879_u76ee = _u5217_u8868[_index_0] + _accum_0[_len_0] = _u9879_u76ee + _len_0 = _len_0 + 1 + end + __u65e0_u6548_u53d8_u91cf = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + local _max_0 = 2 - _u4e1c_u897f[4] + for _index_0 = _u4f60_u597d() * 4, _max_0 < 0 and #_u5217_u8868 + _max_0 or _max_0 do + local _u9879_u76ee = _u5217_u8868[_index_0] + _accum_0[_len_0] = _u9879_u76ee + _len_0 = _len_0 + 1 + end + __u65e0_u6548_u53d8_u91cf = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + for _u9879_u76ee in _u5217_u8868 do + if _u9879_u76ee ~= nil then + _accum_0[_len_0] = _u9879_u76ee["调用"](_u9879_u76ee, 123) + end + _len_0 = _len_0 + 1 + end + _u5217_u8868 = _accum_0 +end +return nil diff --git a/spec/outputs/unicode/cond.lua b/spec/outputs/unicode/cond.lua new file mode 100644 index 0000000..f972dea --- /dev/null +++ b/spec/outputs/unicode/cond.lua @@ -0,0 +1,354 @@ +local _u4f60_u5f88_u9177 = false +local __u65e0_u6548_u53d8_u91cf +if _u9177 then + if _u4f60_u5f88_u9177 then + __u65e0_u6548_u53d8_u91cf = _u4e00 + else + if _u5403_u4e1c_u897f then + __u65e0_u6548_u53d8_u91cf = _u597d + else + __u65e0_u6548_u53d8_u91cf = _u4e8c + __u65e0_u6548_u53d8_u91cf = _u4e09 + end + end +else + __u65e0_u6548_u53d8_u91cf = _u5426 +end +if _u9177 then + __u65e0_u6548_u53d8_u91cf = _u5426 +end +if _u9177 then + __u65e0_u6548_u53d8_u91cf = _u5426 +else + __u65e0_u6548_u53d8_u91cf = _u662f +end +if _u9177 then + _u5594(_u9177) +else + _u6ca1_u90a3_u4e48(_u9177) +end +if _u5728_u5de5_u4f5c then + if _u9177 then + if _u9177 then + __u65e0_u6548_u53d8_u91cf = _u597d_u5427 + else + __u65e0_u6548_u53d8_u91cf = _u4ec0_u4e48 + end + else + __u65e0_u6548_u53d8_u91cf = _u5450 + end +end +if _u270c_ufe0f then + _u65e0(_u65e5) +elseif _u9177(_u6211) then + _u597d_u5427(_u5440) +else + u_u578b(_u8def) +end +if _u270c_ufe0f then + _u65e0(_u7236) +else + if _u9177(_u4f60) then + _u597d_u5427(_u5427) + else + p_u578b(_u8def) + end +end +if (function() end)() then + _u968f_u4fbf(_u600e_u6837) +end +if nil then + _u7ffb_u8f6c(_u6211) +else + _u8fd9_u4e2a(_u662f, _u5f27_u5ea6) +end +if _u4e1c_u897f(_u4e0d_u9519) then + _u6ca1(_u6cd5) +elseif _u597d_u7684(_u786e_u5b9a) then + _u4ec0_u4e48(_u8fd9_u91cc) +end +if _u5f88_u591a_u4e1c_u897f then + _u6ca1(_u673a_u4f1a) +elseif _u597d_u5427 then + _u73b0_u5728(_u600e_u4e48_u529e) +end +if _u5f88_u591a_u4e1c_u897f then + _u662f(_u4f19_u8ba1) +elseif _u597d_u7684(_u4eba) then + _u55e8(_u597d_u5440) +else + _u55ef(_u786e_u5b9a) +end +if _u6211_u4eec(_u8d70_u5427) then + _u6253_u5370("打招呼") +elseif "只有我们" then + _u6253_u5370("威尔史密斯") +else + _u663e_u793a(5555555) +end +do + local _u67d0_u4e1c_u897f = 10 + if _u67d0_u4e1c_u897f then + _u6253_u5370(_u67d0_u4e1c_u897f) + else + _u6253_u5370("其它") + end +end +local _u4f60_u597d +do + local _u67d0_u4e1c_u897f = 10 + if _u67d0_u4e1c_u897f then + _u4f60_u597d = _u6253_u5370(_u67d0_u4e1c_u897f) + else + _u4f60_u597d = _u6253_u5370("其它") + end +end +_u4f60_u597d = 5 + (function() + local _u67d0_u4e1c_u897f = 10 + if _u67d0_u4e1c_u897f then + return _u6253_u5370(_u67d0_u4e1c_u897f) + end +end)() +local z_u53d8_u91cf = false +if false then + __u65e0_u6548_u53d8_u91cf = _u4e00 +else + do + local _u6761_u4ef6x = true + if _u6761_u4ef6x then + __u65e0_u6548_u53d8_u91cf = _u4e8c + else + do + local _u6761_u4ef6z = true + if _u6761_u4ef6z then + __u65e0_u6548_u53d8_u91cf = _u4e09 + else + __u65e0_u6548_u53d8_u91cf = _u56db + end + end + end + end +end +local _u8f93_u51fa +if false then + _u8f93_u51fa = _u4e00 +else + do + local _u6761_u4ef6x = true + if _u6761_u4ef6x then + _u8f93_u51fa = _u4e8c + else + do + local _u6761_u4ef6z = true + if _u6761_u4ef6z then + _u8f93_u51fa = _u4e09 + else + _u8f93_u51fa = _u56db + end + end + end + end +end +local _u53d8_u91cf +_u53d8_u91cf = function() + do + local _u67d0_u4e1c_u897f = true + if _u67d0_u4e1c_u897f then + return 1 + else + do + local _u53e6_u4e00_u4e2a = false + if _u53e6_u4e00_u4e2a then + return 2 + end + end + end + end +end +if not true then + _u6253_u5370("酷!") +end +if not (true and false) then + _u6253_u5370("酷!") +end +if not false then + _u6253_u5370("酷!") +end +if not false then + _u6253_u5370("酷!") +else + _u6253_u5370("no way!") +end +if not nil then + _u6253_u5370("hello") +else + _u6253_u5370("world") +end +local x +if not true then + x = _u6253_u5370("酷!") +end +if not (true and false) then + x = _u6253_u5370("酷!") +end +local y +if not false then + y = _u6253_u5370("酷!") +end +if not false then + y = _u6253_u5370("酷!") +else + y = _u6253_u5370("没门!") +end +local z +if not nil then + z = _u6253_u5370("你好") +else + z = _u6253_u5370("世界") +end +_u6253_u5370((function() + if not true then + return _u6253_u5370("酷!") + end +end)()) +_u6253_u5370((function() + if not (true and false) then + return _u6253_u5370("酷!") + end +end)()) +_u6253_u5370((function() + if not false then + return _u6253_u5370("酷!") + end +end)()) +_u6253_u5370((function() + if not false then + return _u6253_u5370("酷!") + else + return _u6253_u5370("没门!") + end +end)()) +_u6253_u5370((function() + if not nil then + return _u6253_u5370("你好") + else + return _u6253_u5370("世界") + end +end)()) +if not _u503c then + _u6253_u5370("你好") +end +local _u53d8_u91cfdddd +if not _u503c then + _u53d8_u91cfdddd = { + 1, + 2, + 3 + } +end +do + local j_u53d8_u91cf = 100 + j_u53d8_u91cf = _u55e8() + if not j_u53d8_u91cf then + _u9519_u8bef("不是 j变量!") + end +end +local _u53d8_u91cfa = 12 +local _u53d8_u91cfc, _u53d8_u91cfb +if _u67d0_u4e1c_u897f then + _u53d8_u91cfa, _u53d8_u91cfc, _u53d8_u91cfb = "酷", nil, nil +end +local _u53d8_u91cfj +if 1 then + if 2 then + _u53d8_u91cfj = 3 + end +else + _u53d8_u91cfj = 6 +end +local _u53d8_u91cfm +if 1 then + if 2 then + _u53d8_u91cfm = 3 + end +else + _u53d8_u91cfm = 6 +end +do + _u51fd_u6570a({ + ["字段b"] = _u5b57_u6bb5b + }) + if _u51fd_u6570a then + return { + ["字段b"] = _u5b57_u6bb5b + } + else + if _u51fd_u6570c then + return { + ["字段d"] = _u53d8_u91cfe + } + else + return { + ["字段f"] = 123 + } + end + end +end +do + _u51fd_u6570c({ + ["字段d"] = _u53d8_u91cfe + }) + if _u6761_u4ef6a then + local _u5b57_u6bb5b = _u53d8_u91cftb["字段b"] + elseif _u6761_u4ef6c then + local _u53d8_u91cfe = _u53d8_u91cftb["字段d"] + end +end +do + local _des_0 = _u6570_u5b66_u5e93 + if _des_0 then + local _u6d3e = _des_0["派"] + _u6253_u5370(_u6d3e) + end +end +do + local _u6570_u5b66_u5e93 + if _u6570_u5b66_u5e93 then + local _u6d3e = _u6570_u5b66_u5e93["派"] + _u6253_u5370(_u6d3e) + end +end +do + do + local __u6a21_u5757 = { } + if __u6a21_u5757 then + local _u4e1c_u897f = __u6a21_u5757["东西"] + local a_u529f_u80fd, b_u529f_u80fd = __u6a21_u5757["a功能"], __u6a21_u5757["b功能"] + end + end +end +do + do + local _des_0 = { } + if _des_0 then + __u6a21_u5757 = _des_0 + local _u4e1c_u897f = __u6a21_u5757["东西"] + local a_u529f_u80fd, b_u529f_u80fd + do + local _obj_0 = __u6a21_u5757 + a_u529f_u80fd, b_u529f_u80fd = _obj_0["a功能"], _obj_0["b功能"] + end + end + end +end +do + local _u53d8_u91cfv + if 1 and (function() + return 0 ~= 1 + end)() then + _u53d8_u91cfv = 1 + else + _u53d8_u91cfv = 2 + end +end +return nil diff --git a/spec/outputs/unicode/destructure.lua b/spec/outputs/unicode/destructure.lua new file mode 100644 index 0000000..002c4b0 --- /dev/null +++ b/spec/outputs/unicode/destructure.lua @@ -0,0 +1,637 @@ +do + local _u5143_u7d20a, _u5143_u7d20b + do + local _obj_0 = _u4f60_u597d + _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] + end + local _u5143_u7d20c + do + local _obj_0 = _u4f60_u597d + _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1][1], _obj_0[2], _obj_0[3][1] + end + local _u4f60_u597d, _u4e16_u754c + do + local _obj_0 = _u503c + _u4f60_u597d, _u4e16_u754c = _obj_0["你好"], _obj_0["世界"] + end +end +do + local _u5426, _u4e1c_u897f + do + local _obj_0 = _u4e16_u754c + _u5426, _u4e1c_u897f = _obj_0["是"], _obj_0[1] + end + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c, d_u5b57_u6bb5 + do + local _obj_0 = _u597d + _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c, d_u5b57_u6bb5 = _obj_0["字段a"], _obj_0["字段b"], _obj_0["字段c"], _obj_0["d字段"] + end + local _u53d8_u91cfb = _u4e8c + local a_u5143_u7d20 = _u4e00[1] + local _u53d8_u91cfc = nil + local b_u5143_u7d20 = _u4e00[1] + local _u53d8_u91cfe = _u4e8c + local d_u5143_u7d20 = _u4e00[1] + local _u53d8_u91cfx = _u4e00 + local _u5143_u7d20y = _u4e8c[1] + local _u53d8_u91cfxx, _u53d8_u91cfyy = 1, 2 + local _u5143_u7d20yy, _u5143_u7d20xx + do + local _obj_0 = { + _u53d8_u91cfxx, + _u53d8_u91cfyy + } + _u5143_u7d20yy, _u5143_u7d20xx = _obj_0[1], _obj_0[2] + end + local _u5143_u7d20a, _u5143_u7d20c, _u5b57_u6bb5d, _u5143_u7d20e, _u5b57_u6bb5f, _u5143_u7d20g + do + local _obj_0 = _u8868 + _u5143_u7d20a, _u5b57_u6bb5b, _u5143_u7d20c, _u5b57_u6bb5d, _u5143_u7d20e, _u5b57_u6bb5f, _u5143_u7d20g = _obj_0[1], _obj_0["字段b"], _obj_0[2], _obj_0["字段d"], _obj_0[3], _obj_0["字段f"], _obj_0[4] + end + do + _u53d8_u91cfc = nil + do + local _obj_0 = _u8868 + _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] + end + end + do + local _u53d8_u91cfa = _u8868 + do + local _obj_0 = __u65e0_u6548_u53d8_u91cf + _u5b57_u6bb5b, _u5b57_u6bb5c = _obj_0["字段b"], _obj_0["字段c"] + end + end + do + _u53d8_u91cfb = __u65e0_u6548_u53d8_u91cf + _u5b57_u6bb5a = _u8868["字段a"] + _u5b57_u6bb5c = __u65e0_u6548_u53d8_u91cf["字段c"] + end +end +do + local _u672a_u6765_u4eba_u4eec = { + ["雕刻家"] = "翁贝托·博乔尼", + ["画家"] = "弗拉基米尔·伯留克", + ["诗人"] = { + ["姓名"] = "F.T.马里内蒂", + ["地址"] = { + "罗马42R大街", + "贝拉焦,意大利 22021" + } + } + } + do + local _u59d3_u540d, _u8857_u9053, _u57ce_u5e02 = _u672a_u6765_u4eba_u4eec["诗人"]["姓名"], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][1], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][2] + end + do + local _u96d5_u523b_u5bb6, _u753b_u5bb6, _u59d3_u540d, _u8857_u9053, _u57ce_u5e02 = _u672a_u6765_u4eba_u4eec["雕刻家"], _u672a_u6765_u4eba_u4eec["画家"], _u672a_u6765_u4eba_u4eec["诗人"]["姓名"], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][1], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][2] + end +end +do + local _u53d8_u91cfc, _u53d8_u91cfe + do + local _obj_0 = _u5bf9_u8c61tb + _u53d8_u91cfc, _u53d8_u91cfe = _obj_0["字段a"]["字段b"], _obj_0["字段a"]["字段d"] + end +end +do + local _u53d8_u91cfc, _u53d8_u91cfe, _u5143_u7d20f + do + local _obj_0 = _u5bf9_u8c61tb + _u53d8_u91cfc, _u53d8_u91cfe, _u5143_u7d20f = _obj_0["字段a"][1]["字段b"], _obj_0["字段a"][2]["字段d"], _obj_0["字段a"][3] + end +end +do + self["世界"] = _u53d8_u91cfx[1] + do + local _obj_0 = _u53d8_u91cfx + _u5bf9_u8c61a["字段b"], _u5bf9_u8c61c["字段y"], _u51fd_u6570()["字段z"] = _obj_0[1], _obj_0[2], _obj_0[3] + end + self["世界"] = _u53d8_u91cfx["世界"] +end +do + local _u4e1c_u897f = { + { + 1, + 2 + }, + { + 3, + 4 + } + } + for _index_0 = 1, #_u4e1c_u897f do + local _des_0 = _u4e1c_u897f[_index_0] + local _u5143_u7d20x, _u5143_u7d20y = _des_0[1], _des_0[2] + _u6253_u5370(_u5143_u7d20x, _u5143_u7d20y) + end +end +do + do + local _with_0 = _u4e1c_u897f + local _u5143_u7d20a, _u5143_u7d20b = _with_0[1], _with_0[2] + _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) + end +end +do + local _u4e1c_u897f = nil + if _u4e1c_u897f then + local _u5143_u7d20a = _u4e1c_u897f[1] + _u6253_u5370(_u5143_u7d20a) + else + _u6253_u5370("没东西") + end + local _u4e1c_u4e1c = { + 1, + 2 + } + if _u4e1c_u4e1c then + local _u5143_u7d20a, _u5143_u7d20b = _u4e1c_u4e1c[1], _u4e1c_u4e1c[2] + _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) + end + if _u4e1c_u897f then + local _u5143_u7d20a, _u5143_u7d20b = _u4e1c_u897f[1], _u4e1c_u897f[2] + _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) + else + if _u4e1c_u4e1c then + local _u5143_u7d20c, _u5143_u7d20d = _u4e1c_u4e1c[1], _u4e1c_u4e1c[2] + _u6253_u5370(_u5143_u7d20c, _u5143_u7d20d) + else + _u6253_u5370("不") + end + end +end +do + local _u53d8_u91cfz = "好" + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _u53d8_u91cfz[1], _u53d8_u91cfz[2], _u53d8_u91cfz[3] +end +do + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c + do + local _obj_0 = _u53d8_u91cfz + _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2], _obj_0[3] + end +end +local _ +_ = function(_u53c2_u6570z) + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _u53c2_u6570z[1], _u53c2_u6570z[2], _u53c2_u6570z[3] +end +do + local _u53d8_u91cfz = "〇〇" + _ = function(_u53c2_u6570k) + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c + do + local _obj_0 = _u53c2_u6570z + _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2], _obj_0[3] + end + end +end +do + local _u7ed3_u675f_u53d8_u91cf = _u4e1c_u897f["函数"]["结束"] +end +do + local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c + do + local _obj_0 = _u4e1c_u897f + _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0["如果"][1], _obj_0["如果"][2], _obj_0["如果"][3] + end +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b + if true then + do + local _obj_0 = { + ["字段a"] = "你好", + ["字段b"] = "世界" + } + _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] + end + end + local _u5929, _u5c0f_u65f6, _u5206_u949f, _u79d2 + do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = { + string.match("1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)") + } + for _index_0 = 1, #_list_0 do + local _u5143_u7d20 = _list_0[_index_0] + _accum_0[_len_0] = tonumber(_u5143_u7d20) + _len_0 = _len_0 + 1 + end + _u5929, _u5c0f_u65f6, _u5206_u949f, _u79d2 = _accum_0[1], _accum_0[2], _accum_0[3], _accum_0[4] + end + local _u4e00, _u4e8c, _u4e09 + do + local _tbl_0 = { } + for _u5339_u914d_u7ed3_u679c in (function() + local _call_0 = _u968f_u673a_u5bf9_u8c61 + return _call_0["全局匹配"](_call_0, "%S+") + end)() do + _tbl_0[_u5339_u914d_u7ed3_u679c] = true + end + _u4e00, _u4e8c, _u4e09 = _tbl_0["一"], _tbl_0["二"], _tbl_0["三"] + end + local _u53d8_u91cfb = 123 + _u5b57_u6bb5a = ((function() + local _call_0 = _u5bf9_u8c61a + return _call_0["如果"](_call_0, 123) + end)() + _u53d8_u91cft)["字段a"] +end +do + local _u540d_u79f0, _u5de5_u4f5c + do + local _obj_0 = _u4e2a_u4eba + _u540d_u79f0, _u5de5_u4f5c = _obj_0["名称"], _obj_0["工作"] + if _u540d_u79f0 == nil then + _u540d_u79f0 = "没名字" + end + if _u5de5_u4f5c == nil then + _u5de5_u4f5c = "没工作" + end + end + local _u8bf7_u6c42 + _u8bf7_u6c42 = function(_u5730_u5740, _u9009_u9879) + if _u9009_u9879 == nil then + _u9009_u9879 = { } + end + local _u65b9_u5f0f, _u8bf7_u6c42_u5934, _u53c2_u6570, _u8d1f_u8f7d, _u786e_u8ba4, _u9519_u8bef, _u6700_u7ec8_u5904_u7406 = _u9009_u9879["方式"], _u9009_u9879["请求头"], _u9009_u9879["参数"], _u9009_u9879["负载"], _u9009_u9879["确认"], _u9009_u9879["错误"], _u9009_u9879["最终处理"] + if _u65b9_u5f0f == nil then + _u65b9_u5f0f = "GET" + end + if _u8bf7_u6c42_u5934 == nil then + _u8bf7_u6c42_u5934 = { } + end + if _u53c2_u6570 == nil then + _u53c2_u6570 = { } + end + if _u8d1f_u8f7d == nil then + _u8d1f_u8f7d = "" + end + local _u7ed3_u679c = _u53d1_u8d77_u8bf7_u6c42(_u5730_u5740, _u65b9_u5f0f, _u53c2_u6570, _u8d1f_u8f7d, _u786e_u8ba4, _u9519_u8bef, _u6700_u7ec8_u5904_u7406) + return _u7ed3_u679c + end + local _u503c1, _u952e3 + do + local _obj_0 = _u5bf9_u8c61tb + _u503c1, _u952e3 = _obj_0["键1"]["键2"], _obj_0["键3"] + if _u503c1 == nil then + _u503c1 = 123 + end + if _u952e3 == nil then + _u952e3 = "abc" + end + end + local _u5143_u8868, call, add + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb) + _u5143_u8868, call, add = _obj_0, getmetatable(_obj_0).__call, getmetatable(_obj_0).__add + if _u5143_u8868 == nil then + _u5143_u8868 = { + __index = { + ["字段abc"] = 123 + } + } + end + if call == nil then + call = (function() + return { } + end) + end + end + local _u5143_u8868x, y_u5b57_u6bb5, z_u53d8_u91cf, index + do + local _obj_0 = _u5bf9_u8c61tb + _u5143_u8868x, y_u5b57_u6bb5, z_u53d8_u91cf = getmetatable(_obj_0["字段x"]), _obj_0["y字段"], _obj_0["z字段"] + if _u5143_u8868x == nil then + _u5143_u8868x = { } + end + index = getmetatable(_obj_0).__index + if index == nil then + index = function() + return nil + end + end + end + do + local _tmp_0 + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb) + _tmp_0 = _obj_0["函数"] + end + if _tmp_0 == nil then + do + local _obj_0 = _u9879_u76ee + if _obj_0 ~= nil then + _tmp_0 = _obj_0["默认值"] + end + end + end + a_u5bf9_u8c61["b字段"](function() + return 123 + end)["字段c"] = _tmp_0 + end +end +do + local _u5143_u8868, _u51cf_u51fd_u6570 + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb["字段x"]) + _u5143_u8868, _u51cf_u51fd_u6570 = _obj_0, _obj_0.__sub + if _u5143_u8868 == nil then + _u5143_u8868 = { } + end + end +end +do + local _u5143_u8868, _u51cf_u51fd_u6570 + do + local _obj_0 = _u5bf9_u8c61tb + _u5143_u8868, _u51cf_u51fd_u6570 = getmetatable(_obj_0["x字段"]), getmetatable(_obj_0["x字段"]).__sub + if _u5143_u8868 == nil then + _u5143_u8868 = { } + end + end +end +do + local _u5143_u7d20a, _u5143_u7d20b + do + local _obj_0 = _u5bf9_u8c61tb + local _tmp_0 + _u5143_u7d20a, _u5143_u7d20b, _tmp_0 = _obj_0[1], _obj_0[2], _obj_0["字段c"][1] + if _u5143_u7d20a == nil then + _u5143_u7d20a = 1 + end + if _u5143_u7d20b == nil then + _u5143_u7d20b = 2 + end + if _tmp_0 == nil then + _tmp_0 = 3 + end + _u5bf9_u50cfd["字段e"] = _tmp_0 + end + local _list_0 = _u5143_u7ec4_u5217_u8868 + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u5de6, _u53f3 = _des_0[1], _des_0[2] + if _u5de6 == nil then + _u5de6 = "null" + end + if _u53f3 == nil then + _u53f3 = false + end + _u6253_u5370(_u5de6, _u53f3) + end +end +do + local a_u5143_u7d20, b_u5143_u7d20 + do + local _obj_0 = _u5bf9_u8c61tb + a_u5143_u7d20, b_u5143_u7d20 = _obj_0[2], _obj_0[4] + end +end +do + do + local _obj_0 = _u5bf9_u8c61x["字段x"]["字段x"] + local _tmp_0, _tmp_1 = _obj_0["字段x"], _obj_0["y字段"] + if _tmp_0 == nil then + _tmp_0 = 1 + end + if _tmp_1 == nil then + _tmp_1 = 2 + end + _u5bf9_u8c61a["字段b"] = _tmp_0 + a_u5bf9_u8c61["c字段"] = _tmp_1 + end +end +do + local _u5bbd, _u9ad8 + do + local _obj_0 = _u89c6_u533a["尺寸"] + _u5bbd, _u9ad8 = _obj_0["宽"], _obj_0["高"] + end + local x_u5750_u6807, y_u5750_u6807 + do + local _obj_0 = _u70b9 + x_u5750_u6807, y_u5750_u6807 = _obj_0["x坐标"], _obj_0["y坐标"] + if x_u5750_u6807 == nil then + x_u5750_u6807 = 0.0 + end + if y_u5750_u6807 == nil then + y_u5750_u6807 = 0.0 + end + end +end +do + local _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u53d8_u91cfd, _u53d8_u91cfe + local _u5143_u7d20b + do + local _obj_0, _obj_1, _obj_2, _obj_3, _obj_4 = _u51fd_u6570() + do + local _obj_5 = _u6570_u7ec4a + _obj_5[#_obj_5 + 1] = _obj_0 + end + setmetatable(_u5bf9_u8c61c, _obj_4) + _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u53d8_u91cfd, _u53d8_u91cfe = 1, 2, 3, _obj_1, _obj_3 + _u5143_u7d20b = _obj_2[1] + end + local _u53d8_u91cfy1, _u53d8_u91cfy4 + local _u5b57_u6bb5y2, _u5b57_u6bb5y3 + do + local _obj_0, _obj_1 = _u51fd_u65702() + _u53d8_u91cfy1, _u53d8_u91cfy4 = _u51fd_u65701(), _obj_1 + _u5b57_u6bb5y2, _u5b57_u6bb5y3 = _obj_0["字段y2"], _obj_0["字段y3"] + end +end +do + local _u53d8_u91cfv1, _u53d8_u91cfv2, _u53d8_u91cfv3, _u53d8_u91cfv4 + do + local _obj_0 = _u5bf9_u8c61tb + local _tmp_0, _tmp_1 = 1 + 1, self.x + _u53d8_u91cfv1, _u53d8_u91cfv2, _u53d8_u91cfv3, _u53d8_u91cfv4 = _obj_0[ [["abc"]]], _obj_0[_tmp_0][1], _obj_0[_tmp_0][2], _obj_0[_tmp_1] + if _u53d8_u91cfv1 == nil then + _u53d8_u91cfv1 = 111 + end + if _u53d8_u91cfv2 == nil then + _u53d8_u91cfv2 = 222 + end + if _u53d8_u91cfv3 == nil then + _u53d8_u91cfv3 = 333 + end + if _u53d8_u91cfv4 == nil then + _u53d8_u91cfv4 = 444 + end + end + local _u53d8_u91cfv5, _u53d8_u91cfv6, _u53d8_u91cfv7 + do + local _obj_0 = _u5bf9_u8c61tb2 + local _tmp_2, _tmp_3 = _u51fd_u6570(), _u51fd_u65702() + _u53d8_u91cfv5, _u53d8_u91cfv6, _u53d8_u91cfv7 = _obj_0['x-y-z'], _obj_0[_tmp_2][_tmp_3], _obj_0[_tmp_2][1] + end +end +do + local _u503c, _u5143_u503c + do + local _obj_0 = _u5bf9_u8c61tb + _u503c = _obj_0[_u540d_u79f0] + _u5143_u503c = getmetatable(_obj_0)[_u540d_u79f0] + end +end +do + local tostring, add + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb) + tostring, add = _obj_0.__tostring, _obj_0.__add + if tostring == nil then + tostring = (function() + return "名称" + end) + end + end + do + local _exp_0 = _u5bf9_u8c61tb + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + local name, _u5143_u5b57_u6bb5 + do + local _obj_0 = getmetatable(_exp_0) + name = _obj_0.__name + _u5143_u5b57_u6bb5 = _obj_0["123"] + if name == nil then + name = "项目" + end + end + if _u5143_u5b57_u6bb5 ~= nil then + _u6253_u5370(name, _u5143_u5b57_u6bb5) + end + end + end +end +do + local _u5bf9_u8c61tb = { } + do + local _tmp_0 = _u51fd_u6570c() + local _u53d8_u91cfv2 = _u5bf9_u8c61tb[_tmp_0] + end + local _u53d8_u91cfv1 + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb) + local _tmp_1 = _u53d8_u91cfa + _u53d8_u91cfb + _u53d8_u91cfv1 = _obj_0[_tmp_1] + end +end +do + local add, _u5b57_u6bb5 + do + local _obj_0 = _u5bf9_u8c61tb + add, _u5b57_u6bb5 = getmetatable(_obj_0.a).__add, getmetatable(_obj_0.b)[_u5b57_u6bb5_u540d] + if add == nil then + add = _u52a0_u51fd_u6570 + end + if _u5b57_u6bb5 == nil then + _u5b57_u6bb5 = 123 + end + end + local _u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c + do + local _obj_0 = getmetatable(_u5bf9_u8c61tb) + _u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c = _obj_0["字段abc"], _obj_0[ [[任意 字符串]]], _obj_0['字符串'] + if _u5143_u5b57_u6bb5 == nil then + _u5143_u5b57_u6bb5 = "默认值" + end + if _u53d8_u91cfabc == nil then + _u53d8_u91cfabc = 123 + end + if _u6709_u9ed8_u8ba4_u503c == nil then + _u6709_u9ed8_u8ba4_u503c = { } + end + end + do + local _exp_0 = _u5bf9_u8c61tb + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + do + local _obj_0 = _exp_0["字段a"] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + do + local _obj_1 = getmetatable(_obj_0) + local _type_2 = type(_obj_1) + if "table" == _type_2 or "userdata" == _type_2 then + add = _obj_1.__add + end + end + end + end + do + local _obj_0 = _exp_0.b + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + do + local _obj_1 = getmetatable(_obj_0) + local _type_2 = type(_obj_1) + if "table" == _type_2 or "userdata" == _type_2 then + _u5b57_u6bb5 = _obj_1[_u5b57_u6bb5_u540d] + end + end + end + end + if add == nil then + add = _u52a0_u51fd_u6570 + end + if _u5b57_u6bb5 == nil then + _u5b57_u6bb5 = 123 + end + _u6253_u5370(add, _u5b57_u6bb5) + end + end + do + local _exp_0 = tb + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + do + local _obj_0 = _exp_0["字段c"] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + do + local _obj_1 = getmetatable(_obj_0) + local _type_2 = type(_obj_1) + if "table" == _type_2 or "userdata" == _type_2 then + _u5143_u5b57_u6bb5 = _obj_1["字段abc"] + end + end + end + end + if _u5143_u5b57_u6bb5 == nil then + _u5143_u5b57_u6bb5 = "默认值" + end + do + local _obj_0 = getmetatable(_exp_0) + do + local _obj_1 = _obj_0[ [[any string]]] + local _type_1 = type(_obj_1) + if "table" == _type_1 or "userdata" == _type_1 then + _u53d8_u91cfabc = _obj_1["字段d"] + end + end + do + local _obj_1 = _obj_0['字符串'] + local _type_1 = type(_obj_1) + if "table" == _type_1 or "userdata" == _type_1 then + _u6709_u9ed8_u8ba4_u503c = _obj_1["字段e"] + end + end + if _u53d8_u91cfabc == nil then + _u53d8_u91cfabc = 123 + end + if _u6709_u9ed8_u8ba4_u503c == nil then + _u6709_u9ed8_u8ba4_u503c = { } + end + end + _u6253_u5370(_u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c) + end + end +end +return nil diff --git a/spec/outputs/unicode/do.lua b/spec/outputs/unicode/do.lua new file mode 100644 index 0000000..f9c3079 --- /dev/null +++ b/spec/outputs/unicode/do.lua @@ -0,0 +1,48 @@ +do + _u6253_u5370("你好") + _u6253_u5370("世界") +end +local _u53d8_u91cfx +do + _u6253_u5370("你好") + _u53d8_u91cfx = _u6253_u5370("世界") +end +local _u53d8_u91cfy +do + local _u4e1c_u897f = "shhh" + _u53d8_u91cfy = function() + return "你好: " .. _u4e1c_u897f + end +end +local _ +_ = function() + if _u67d0_u6761_u4ef6 then + do + return "好的" + end + end +end +local _u53d8_u91cft = { + ["y字段"] = (function() + local _u6570_u5b57 = 100 + return function(_u53c2_u6570x) + return _u53c2_u6570x + _u6570_u5b57 + end + end)() +} +return function(_u53c2_u6570y, _u53c2_u6570k) + if _u53c2_u6570y == nil then + do + _u53d8_u91cfx = 10 + 2 + _u53c2_u6570y = _u53d8_u91cfx + end + end + if _u53c2_u6570k == nil then + do + _u53c2_u6570k = "没啥" + end + end + do + return "啊" + end +end diff --git a/spec/outputs/unicode/existential.lua b/spec/outputs/unicode/existential.lua new file mode 100644 index 0000000..7cc6089 --- /dev/null +++ b/spec/outputs/unicode/existential.lua @@ -0,0 +1,223 @@ +do + local _obj_0 = _u51fd_u65701 + if _obj_0 ~= nil then + _obj_0() + end +end +do + local _obj_0 = _u51fd_u65702 + if _obj_0 ~= nil then + _obj_0("参数0", 123) + end +end +local _u53d8_u91cfx +do + local _obj_0 = _u8868 + if _obj_0 ~= nil then + _u53d8_u91cfx = _obj_0["值"] + end +end +_u6253_u5370((function() + local _obj_0 = _u5bf9_u8c61abc + if _obj_0 ~= nil then + local _obj_1 = _obj_0["你好 世界"] + if _obj_1 ~= nil then + return _obj_1["字段xyz"] + end + return nil + end + return nil +end)()) +if _u6253_u5370 and (_u53d8_u91cfx ~= nil) then + _u6253_u5370(_u53d8_u91cfx) +end +do + local _obj_0 = self + if _obj_0 ~= nil then + _obj_0["函数"](_obj_0, 998) + end +end +do + local _with_0 + do + local _obj_0 = _u5bf9_u8c61abc + if _obj_0 ~= nil then + do + local _obj_1 = _obj_0() + local _obj_2 = _obj_1["函数"] + if _obj_2 ~= nil then + _with_0 = _obj_2(_obj_1) + end + end + end + end + if (function() + local _obj_0 = _with_0["函数p"] + if _obj_0 ~= nil then + return _obj_0(_with_0, "abc") + end + return nil + end)() then + return 123 + end +end +do + local _des_0 + do + local _obj_0 = _u5bf9_u8c61a + if _obj_0 ~= nil then + do + local _obj_1 = _obj_0["如果"] + if _obj_1 ~= nil then + do + local _obj_2 = _obj_1["然后"] + if _obj_2 ~= nil then + do + local _obj_3 = _obj_2(_obj_1, 123) + if _obj_3 ~= nil then + _des_0 = _obj_3((function() + local _obj_4 = self + if _obj_4 ~= nil then + return _obj_4["方法"](_obj_4, 998) + end + return nil + end)()) + end + end + end + end + end + end + end + end + if _des_0 then + local x_u5b57_u6bb5 = _des_0["x字段"] + _u6253_u5370(x_u5b57_u6bb5) + end +end +local _u7ed3_u679c = ((function() + local _call_0 = _u5bf9_u8c61b["方法"] + local _obj_0 = _call_0["执行"](_call_0) + local _obj_1 = _obj_0["当"] + if _obj_1 ~= nil then + local _call_1 = _obj_1(_obj_0, "没问题") + local _base_0 = _call_1["如果"](_call_1, "默认", 998) + local _fn_0 = _base_0["函数"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end + return nil +end)() ~= nil) +_u6253_u5370(_u7ed3_u679c) +local _u81ea_u6211_u4e3a_u4e2d_u5fc3 +if (_u601d_u60f3 ~= nil) and not (_u4e16_u754c ~= nil) then + _u81ea_u6211_u4e3a_u4e2d_u5fc3 = true +end +local _u901f_u5ea6 = 0 +_u901f_u5ea6 = _u901f_u5ea6 or 15 +local _u811a_u5370 = _u91ce_u4eba or "熊" +local _u4e13_u4e1a = '计算机科学' +if not (_u4e13_u4e1a ~= nil) then + _u9009_u4fee_u8bfe_u7a0b('葡萄酒入门') +end +if (_u7a97_u4f53 ~= nil) then + local _u73af_u5883 = '浏览器(有可能)' +end +local _u90ae_u7f16 +do + local _obj_0 = _u62bd_u5956["中奖者"] + if _obj_0 ~= nil then + do + local _obj_1 = _obj_0()["地址"] + if _obj_1 ~= nil then + _u90ae_u7f16 = _obj_1["邮政编码"] + end + end + end +end +local _u957f_u5ea6 = (function() + local _obj_0 = utf8 + if _obj_0 ~= nil then + return _obj_0["长度"] + end + return nil +end)() or (function() + local _obj_0 = _u5b57_u7b26_u4e32 + if _obj_0 ~= nil then + return _obj_0["长度"] + end + return nil +end)() or function(_u5bf9_u8c61) + return #_u5bf9_u8c61 +end +local _u53d8_u91cfa +do + local _obj_0 = _u88681 + if _obj_0 ~= nil then + do + local _obj_1 = _obj_0["结束"] + if _obj_1 ~= nil then + _u53d8_u91cfa = _obj_1(_obj_0, 123 + (function() + local _obj_2 = _u88682 + if _obj_2 ~= nil then + return _obj_2["然后"](_obj_2, 456) + end + return nil + end)()) + end + end + end +end +local _u53d8_u91cfb = ((function() + local _obj_0 = _u88681 + if _obj_0 ~= nil then + local _base_0 = _obj_0 + local _fn_0 = _base_0["结束"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end + return nil +end)() ~= nil) or (function() + local _obj_0 = _u88682 + if _obj_0 ~= nil then + local _base_0 = _obj_0 + local _fn_0 = _base_0["然后"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end + return nil +end)() +do + local _with_0 = io.open("测试.txt", "w") + if _with_0 ~= nil then + _with_0:write("你好") + _with_0:close() + end +end +do + local _obj_0 = _u8868 + if _obj_0 ~= nil then + do + local _obj_1 = getmetatable(_obj_0).__call + if _obj_1 ~= nil then + _obj_1(123) + end + end + end +end +do + local _with_0 + do + local _obj_0 = getmetatable(_u8868) + if _obj_0 ~= nil then + _with_0 = getmetatable(_obj_0).__index + end + end + if _with_0 ~= nil then + _with_0["字段a"] = 1 + end +end +return nil diff --git a/spec/outputs/unicode/export.lua b/spec/outputs/unicode/export.lua new file mode 100644 index 0000000..ef35fe5 --- /dev/null +++ b/spec/outputs/unicode/export.lua @@ -0,0 +1,338 @@ +local _module_0 = setmetatable({ }, { }) +local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 223, 343, 123 +_module_0["变量a"], _module_0["变量b"], _module_0["变量c"] = _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc +local _u9177 = "🧧" +_module_0["酷"] = _u9177 +local _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff = 3, 2, 1 +_module_0[#_module_0 + 1] = _u53d8_u91cfd +_module_0[#_module_0 + 1] = _u53d8_u91cfe +_module_0[#_module_0 + 1] = _u53d8_u91cff +local _u67d0_u7c7b +do + local _class_0 + local _base_0 = { + ["嗯"] = "酷" + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "某类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u67d0_u7c7b = _class_0 +end +_module_0["_u67d0_u7c7b"] = _u67d0_u7c7b +if _u8fd9_u4e2a then + _module_0[#_module_0 + 1] = 232 +else + _module_0[#_module_0 + 1] = 4343 +end +local _u4ec0_u4e48 +if _u8fd9_u4e2a then + _u4ec0_u4e48 = 232 +else + _u4ec0_u4e48 = 4343 +end +_module_0["什么"] = _u4ec0_u4e48 +local _u53d8_u91cfy +_u53d8_u91cfy = function() + local _u4f60_u597d = 3434 +end +_module_0["变量y"] = _u53d8_u91cfy +do + local _with_0 = _u4e34_u65f6 + local _u53d8_u91cfj = 2000 + _module_0[#_module_0 + 1] = _with_0 +end +local cb_u7684_u503c +do + local _u53d8_u91cfh = 100 + cb_u7684_u503c = _u51fd_u6570(function(_u53c2_u6570) + return _u53c2_u6570(h_u53d8_u91cf) + end) +end +_module_0["cb的值"] = cb_u7684_u503c +local _u4e2b_u4e2b +_u4e2b_u4e2b = function() + local _u53d8_u91cfh = 100 + local _u53d8_u91cfk = 100 +end +_module_0["丫丫"] = _u4e2b_u4e2b +do + local _exp_0 = _u53d8_u91cfh + if 100 == _exp_0 or 150 == _exp_0 then + _module_0[#_module_0 + 1] = 200 + elseif 200 == _exp_0 then + _module_0[#_module_0 + 1] = 300 + else + _module_0[#_module_0 + 1] = 0 + end +end +local _u5e38_u91cf +do + local _exp_0 = _u503c + if "好" == _exp_0 then + _u5e38_u91cf = 1 + elseif "更好" == _exp_0 then + _u5e38_u91cf = 2 + elseif "最好" == _exp_0 then + _u5e38_u91cf = 3 + end +end +_module_0["常量"] = _u5e38_u91cf +local _u9879_u76ee = _u51fd_u6570(123) +_module_0["项目"] = _u9879_u76ee +_module_0[#_module_0 + 1] = _u53d8_u91cfx +_u51fd_u6570((function() + if _u6761_u4ef6a then + return _u503cb + end +end)()) +_u51fd_u6570((function() + return 123 +end)()) +_u51fd_u6570((function() + local _exp_0 = _u5bf9_u8c61a + if _u53d8_u91cfb == _exp_0 then + return _u503cc + end +end)()) +_u51fd_u6570((function() + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_u51fd_u6570((function() + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_u51fd_u6570((function() + local _tbl_0 = { } + for _u952e, _u503c in pairs(_u8868) do + _tbl_0[_u952e] = _u503c + end + return _tbl_0 +end)()) +_u51fd_u6570((function() + local _accum_0 = { } + local _len_0 = 1 + for _u952e, _u503c in pairs(_u8868) do + _accum_0[_len_0] = { + _u952e, + _u503c + } + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_u51fd_u6570((function() + local _accum_0 = { } + local _len_0 = 1 + while _u6761_u4ef6a do + _accum_0[_len_0] = true + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_u51fd_u6570((function() + local _with_0 = _u6761_u4ef6a + _with_0["字段b"] = 123 + return _with_0 +end)()) +_u51fd_u6570((function() + local _obj_0 = _u5bf9_u8c61a + if _obj_0 ~= nil then + return _obj_0["字段b"] + end + return nil +end)()) +_u51fd_u6570((function() + local _base_0 = _u5bf9_u8c61a + local _fn_0 = _base_0["字段b"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end)()) +_u51fd_u6570((function() + local A_u7c7b + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "A类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + A_u7c7b = _class_0 + return _class_0 + end +end)()) +local _ = tostring((function() + if _u6761_u4ef6a then + return _u503cb + end +end)()) +_ = tostring((function() + return 123 +end)()) +_ = tostring((function() + local _exp_0 = _u5bf9_u8c61a + if _u53d8_u91cfb == _exp_0 then + return _u503cc + end +end)()) +_ = tostring((function() + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_ = tostring((function() + local _accum_0 = { } + local _len_0 = 1 + for _u8ba1_u6570 = 1, 10 do + _accum_0[_len_0] = _u8ba1_u6570 + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_ = tostring((function() + local _tbl_0 = { } + for _u952e, _u503c in pairs(_u8868) do + _tbl_0[_u952e] = _u503c + end + return _tbl_0 +end)()) +_ = tostring((function() + local _accum_0 = { } + local _len_0 = 1 + for _u952e, _u503c in pairs(_u8868) do + _accum_0[_len_0] = { + _u952e, + _u503c + } + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_ = tostring((function() + local _accum_0 = { } + local _len_0 = 1 + while _u6761_u4ef6a do + _accum_0[_len_0] = true + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_ = tostring((function() + local _with_0 = _u5bf9_u8c61a + _with_0["字段b"] = 123 + return _with_0 +end)()) +_ = tostring((function() + local _obj_0 = _u5bf9_u8c61a + if _obj_0 ~= nil then + return _obj_0["字段b"] + end + return nil +end)()) +_ = tostring((function() + local _base_0 = _u5bf9_u8c61a + local _fn_0 = _base_0["字段b"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end)()) +_ = tostring((function() + local A_u7c7b + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "A类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + A_u7c7b = _class_0 + return _class_0 + end +end)()) +local _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u7c7b4, _u53d8_u91cf5 +_u53d8_u91cf1 = 1 +_u53d8_u91cf2 = 2 +_module_0["变量2"] = _u53d8_u91cf2 +do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "类4" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u7c7b4 = _class_0 + _u53d8_u91cf3 = _class_0 +end +_module_0["变量3"] = _u53d8_u91cf3 +_u53d8_u91cf5 = 5 +getmetatable(_module_0)["🀄️"] = 1 +getmetatable(_module_0).__name = "导出" +getmetatable(_module_0).__call = function(self) + return { } +end +_module_0["导出-任意-名称"] = 123 +return _module_0 diff --git a/spec/outputs/unicode/export_default.lua b/spec/outputs/unicode/export_default.lua new file mode 100644 index 0000000..6d48af2 --- /dev/null +++ b/spec/outputs/unicode/export_default.lua @@ -0,0 +1,19 @@ +local _module_0 = nil +_u6253_u5370("没问题") +_module_0 = function() + _u6253_u5370("你好") + return 123 +end +if not _u662f_u5426_u7ed3_u675f then + _u51fd_u6570(123, "abc", function(_u53c2_u6570x, _u56de_u8c03y) + _u6253_u5370(_u53c2_u6570x) + return _u56de_u8c03y(function(_u53c2_u6570y, _u7ed3_u679c) + if _u7ed3_u679c then + return _u53d8_u91cfabc + _u53c2_u6570y + else + return _u53d8_u91cfabc + end + end) + end) +end +return _module_0 diff --git a/spec/outputs/unicode/funcs.lua b/spec/outputs/unicode/funcs.lua new file mode 100644 index 0000000..6e94587 --- /dev/null +++ b/spec/outputs/unicode/funcs.lua @@ -0,0 +1,222 @@ +local _u53d8_u91cfx +_u53d8_u91cfx = function() + return _u6253_u5370(_u4ec0_u4e48) +end +local __u65e0_u6548_u53d8_u91cf +__u65e0_u6548_u53d8_u91cf = function() end +__u65e0_u6548_u53d8_u91cf = function() + return function() + return function() end + end +end +_u5230(_u8c37(_u4ed3(_u53bb))) +_u5f00(function() + return _u8fd9_u6247(function() + return _u95e8 + end) +end) +_u5f00(function() + _u8fd9_u6247(_u95e8) + local _u4f60_u597d + _u4f60_u597d = function() + return _u6211_u7684(_u51fd_u6570) + end +end) +local _u53d8_u91cfh +_u53d8_u91cfh = function() + return _ud83d_udc4b +end +_u5403(function() end, _u4e16_u754c); +(function() end)() +_u53d8_u91cfx = function(...) end +_u4f60_u597d() +_u4f60_u597d["世界"]() +__u65e0_u6548_u53d8_u91cf = _u4f60_u597d()["某物"] +__u65e0_u6548_u53d8_u91cf = _u4ec0_u4e48()["🥵🥵🥵"] +_u4ec0()(_u4e48()(_u60c5_u51b5())) +__u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c, _u53c2_u6570d, _u53c2_u6570e) end +__u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570, _u53c2_u6570, _u53c2_u6570, _u53c2_u6570, _u53c2_u6570) + return _u6253_u5370(_u53c2_u6570) +end +__u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570x) + if _u53c2_u6570x == nil then + _u53c2_u6570x = 23023 + end +end +__u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570x) + if _u53c2_u6570x == nil then + _u53c2_u6570x = function(_u53c2_u6570y) + if _u53c2_u6570y == nil then + _u53c2_u6570y = function() end + end + end + end +end +__u65e0_u6548_u53d8_u91cf = function(_u53d8_u91cfx) + if _u53d8_u91cfx == nil then + if _u67d0_u7269 then + _u53d8_u91cfx = _u597d + else + _u53d8_u91cfx = _u574f + end + end +end +local _u67d0_u7269 +_u67d0_u7269 = function(_u4f60_u597d, _u4e16_u754c) + if _u4f60_u597d == nil then + _u4f60_u597d = 100 + end + if _u4e16_u754c == nil then + _u4e16_u754c = function(_u53c2_u6570x) + if _u53c2_u6570x == nil then + _u53c2_u6570x = [[好 酷]] + end + return _u6253_u5370("吃米饭") + end + end + return _u6253_u5370(_u4f60_u597d) +end +__u65e0_u6548_u53d8_u91cf = function(self) end +__u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y) end +__u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y) + self["参数x"] = _u53c2_u6570x + self["参数y"] = _u53c2_u6570y +end +__u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x) + if _u53c2_u6570x == nil then + _u53c2_u6570x = 1 + end +end +__u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y, _u53c2_u6570z) + if _u53c2_u6570x == nil then + _u53c2_u6570x = 1 + end + if _u53c2_u6570z == nil then + _u53c2_u6570z = "你好 世界" + end + self["参数x"] = _u53c2_u6570x + self["参数z"] = _u53c2_u6570z +end +_u53d8_u91cfx(function() + return +end) +_u53d8_u91cfy(function() + return 1 +end) +_u53d8_u91cfz(function() + return 1, "你好", "世界" +end) +_u53d8_u91cfk(function() + if _u662f then + return + else + return + end +end) +__u65e0_u6548_u53d8_u91cf = function() + if _u67d0_u7269 then + return _u771f_u540d + end +end +_u51fd_u6570d(function() + return _u6253_u5370("你好 世界") +end, 10) +_u51fd_u6570d(1, 2, 3, 4, 5, 6, (function() + if _u67d0_u7269 then + _u6253_u5370("okay") + return 10 + end +end)(), 10, 20) +_u51fd_u6570f()()(_u4ec0_u4e48)(function() + return _u6253_u5370("srue") +end, 123) +_u53d8_u91cfx = function(_u53c2_u6570a, _u53c2_u6570b) + return _u6253_u5370("什么") +end +local _u53d8_u91cfy +_u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +local _u53d8_u91cfz +_u53d8_u91cfz = function(_u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +local _u53d8_u91cfj +_u53d8_u91cfj = function(_u53c2_u6570f, _u53c2_u6570g, _u53c2_u6570m, _u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +_u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b, ...) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +_u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b, ...) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +local _u591a_u53c2_u6570 +_u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) + return _u6253_u5370("什么") +end +_u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +_u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +_u591a_u53c2_u6570 = function(_u53c2_u6570f, _u53c2_u6570g, _u53c2_u6570m, _u53c2_u6570a, _u53c2_u6570b) + if _u53c2_u6570a == nil then + _u53c2_u6570a = "hi" + end + if _u53c2_u6570b == nil then + _u53c2_u6570b = 23 + end + return _u6253_u5370("什么") +end +local self +self = function(_u53c2_u6570n) + if _u53c2_u6570n == 0 then + return 1 + end + return _u53c2_u6570n * self(_u53c2_u6570n - 1) +end +return nil diff --git a/spec/outputs/unicode/global.lua b/spec/outputs/unicode/global.lua new file mode 100644 index 0000000..c91db52 --- /dev/null +++ b/spec/outputs/unicode/global.lua @@ -0,0 +1,91 @@ +do + _u5168_u5c40_u53d8_u91cfa, _u5168_u5c40_u53d8_u91cfb, _u5168_u5c40_u53d8_u91cfc = 223, 343, nil + _u9177 = "📉" +end +do + do + local _class_0 + local _base_0 = { + ["嗯"] = "🆒" + } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "全局类" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + _u5168_u5c40_u7c7b = _class_0 + end +end +do + local _u53d8_u91cfc, _u53d8_u91cfd + _u5168_u5c40_u53d8_u91cfa, _u5168_u5c40_u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd = "你好", nil, nil, nil +end +do + local _u4ec0_u4e48 + if _u8fd9_u4e2a then + _u4ec0_u4e48 = 232 + else + _u4ec0_u4e48 = 4343 + end + local _u53e6_u4e00_u4e2a = 3434 + A_u53e6_u4e00_u4e2a = 7890 + if _u5185_u90e8 then + local Y_u597d = "10000" + end + if _u8fd9_u4e2a then + _u4ec0_u4e48 = 232 + else + _u4ec0_u4e48 = 4343 + end +end +do + if _u8fd9_u4e2a then + _u4ec0_u4e48 = 232 + else + _u4ec0_u4e48 = 4343 + end + _u5168_u5c40_u53d8_u91cfx, _u5168_u5c40_u53d8_u91cfy, _u5168_u5c40_u53d8_u91cfz = 1, 2, 3 + _u5168_u5c40_u53d8_u91cfy = function() + local _u597d_u7684 = 3434 + end + do + local _with_0 = _u5168_u5c40_u4e34_u65f6_u53d8_u91cf + local _u53d8_u91cfj = 2000 + end +end +do + _u53d8_u91cfx = 3434 + if _u6761_u4ef6y then + _u53d8_u91cfx = 10 + end +end +do + if _u6761_u4ef6y then + local _u53d8_u91cfx = 10 + end + _u53d8_u91cfx = 3434 +end +do + do + _u53d8_u91cfk = 1212 + do + local _u53d8_u91cfh = 100 + end + _u5168_u5c40_u53d8_u91cfy = function() + local _u53d8_u91cfh = 100 + _u53d8_u91cfk = 100 + end + end + local _u53d8_u91cfh = 100 +end diff --git a/spec/outputs/unicode/goto.lua b/spec/outputs/unicode/goto.lua new file mode 100644 index 0000000..8e2e5a6 --- /dev/null +++ b/spec/outputs/unicode/goto.lua @@ -0,0 +1,67 @@ +do + local _u53d8_u91cfa = 0 + ::_u5f00_u59cb:: + _u53d8_u91cfa = _u53d8_u91cfa + 1 + if _u53d8_u91cfa == 5 then + goto _u7ed3_u675f + end + goto _u5f00_u59cb + ::_u7ed3_u675f:: +end +do + for _u8ba1_u6570z = 1, 10 do + for _u8ba1_u6570y = 1, 10 do + for _u8ba1_u6570x = 1, 10 do + if _u8ba1_u6570x ^ 2 + _u8ba1_u6570y ^ 2 == _u8ba1_u6570z ^ 2 then + _u6253_u5370('找到了毕达哥拉斯三元组:', _u8ba1_u6570x, _u8ba1_u6570y, _u8ba1_u6570z) + goto _u5b8c_u6210 + end + end + end + end + ::_u5b8c_u6210:: +end +do + for _u8ba1_u6570z = 1, 10 do + for _u8ba1_u6570y = 1, 10 do + for _u8ba1_u6570x = 1, 10 do + if _u8ba1_u6570x ^ 2 + _u8ba1_u6570y ^ 2 == _u8ba1_u6570z ^ 2 then + _u6253_u5370('找到了毕达哥拉斯三元组:', _u8ba1_u6570x, _u8ba1_u6570y, _u8ba1_u6570z) + _u6253_u5370('now trying next z...') + goto _u7ee7_u7eedz + end + end + end + ::_u7ee7_u7eedz:: + end +end +do + ::_u91cd_u505a:: + for _u8ba1_u6570x = 1, 10 do + for _u8ba1_u6570y = 1, 10 do + if not _u51fd_u6570f(_u8ba1_u6570x, _u8ba1_u6570y) then + goto _u7ee7_u7eed + end + if not _u51fd_u6570g(_u8ba1_u6570x, _u8ba1_u6570y) then + goto _u8df3_u8fc7 + end + if not _u51fd_u6570h(_u8ba1_u6570x, _u8ba1_u6570y) then + goto _u91cd_u505a + end + ::_u7ee7_u7eed:: + end + end + ::_u8df3_u8fc7:: +end +do + local _list_0 = _u5217_u8868 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cf = _list_0[_index_0] + if _u53d8_u91cf % 2 == 0 then + _u6253_u5370('列表有偶数') + goto _u6709 + end + end + _u6253_u5370('列表没偶数') + ::_u6709:: +end diff --git a/spec/outputs/unicode/import.lua b/spec/outputs/unicode/import.lua new file mode 100644 index 0000000..50acc11 --- /dev/null +++ b/spec/outputs/unicode/import.lua @@ -0,0 +1,112 @@ +local _u4f60_u597d = _u597d_u7684["你好"] +local _u597d_u5440, _u4e16_u754c +do + local _obj_0 = _u8868["酷"] + _u597d_u5440, _u4e16_u754c = _obj_0["好呀"], _obj_0["世界"] +end +local _u5b57_u6bb5x, _u5b57_u6bb5y, _u5b57_u6bb5z = _u9053_u5177_u7ec4["字段x"], (function() + local _base_0 = _u9053_u5177_u7ec4 + local _fn_0 = _base_0["字段y"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end)(), _u9053_u5177_u7ec4["字段z"] +local _u9886_u4e3b, _ud83d_udc7b +do + local _obj_0 = _u627e_u5230("我的表") + _u9886_u4e3b, _ud83d_udc7b = _obj_0["领主"], (function() + local _base_0 = _obj_0 + local _fn_0 = _base_0["👻"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end)() +end +local _obj_0 = 232 +local _u67d0_u7269 +do + local _obj_1 = _u4e00_u4e2a(_u8868_u683c) + _u67d0_u7269 = _obj_1["某物"] +end +if _u7f29_u8fdb then + local _u597d_u5427, _u5f88_u597d + do + local _obj_1 = _u5f88_u591a_u8868[100] + _u597d_u5427, _u5f88_u597d = _obj_1["好吧"], (function() + local _base_0 = _obj_1 + local _fn_0 = _base_0["很好"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end)() + end +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] +end +do + local _u6a21_u5757 = require('模块') + _u6253_u5370(_u6a21_u5757) + local _u6a21_u5757_x = require('模块_x') + _u6253_u5370(_u6a21_u5757_x) + local _u4e0b__u5212__u7ebf__u6a21__u5757__u554a = require("下-划-线-模-块-啊") + _u6253_u5370(_u4e0b__u5212__u7ebf__u6a21__u5757__u554a) + local _u5b50_u6a21_u5757 = require("模块.子模块") + _u6253_u5370(_u5b50_u6a21_u5757) +end +do + local _u5927_u73a9_u5bb6 = require("小玩家") + local C, Ct, Cmt + do + local _obj_1 = require("lpeg库") + C, Ct, Cmt = _obj_1.C, _obj_1.Ct, _obj_1.Cmt + end + local _u4e00, _u4e8c, _u5b57_u7b26 + do + local _obj_1 = require("导出") + _u4e00, _u4e8c, _u5b57_u7b26 = _obj_1[1], _obj_1[2], _obj_1["某键"]["嗯"][1] + end + local _u53c8_u4e00_u4e2a_u7ec4_u4ef6 = require("导出")["又一个组件"] + _u6253_u5370(_u53c8_u4e00_u4e2a_u7ec4_u4ef6) +end +do + _u6a21_u5757 = require('模块') + _u6a21_u5757_x = require('模块_x') + _u6a21_u5757_y = require("组织.包.模块-y") + _u6253_u5370(_u6a21_u5757_y) +end +do + local _u51fd_u6570, _u5982_u679c_u53d8_u91cf + do + local _obj_1 = require("组织.包.模块") + _u51fd_u6570, _u5982_u679c_u53d8_u91cf = _obj_1["函数体"], _obj_1["如果"] + end +end +do + local _u53d8_u91cfb = getmetatable(require("块")).__gc + local index = getmetatable(require("块")).__index + local _u53d8_u91cff, _u53d8_u91cfc + do + local _obj_1 = require("块") + _u53d8_u91cff = _obj_1["字段e"] + _u53d8_u91cfc = getmetatable(_obj_1).__pairs + end + local _u53d8_u91cfd = require("块")["字段c"] + local _u5143_u7d20g, _u53d8_u91cfi + do + local _obj_1 = require("块") + _u5143_u7d20g, _u53d8_u91cfi = _obj_1[1], getmetatable(_obj_1[2]).__close + end +end diff --git a/spec/outputs/unicode/in_expression.lua b/spec/outputs/unicode/in_expression.lua new file mode 100644 index 0000000..62aad05 --- /dev/null +++ b/spec/outputs/unicode/in_expression.lua @@ -0,0 +1,181 @@ +_u51fd_u6570((function() + local _val_0 = -_u53d8_u91cfa ^ 2 + return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 +end)()) +local _u53d8_u91cfa, _u53d8_u91cfb = (function(...) + local _val_0 = _u51fd_u6570x(...) + return not (1 <= _val_0 and _val_0 <= 3) +end)(...), 2 +local _u53d8_u91cfd +do + local _val_0 = (_u5bf9_u8c61["字段x"]["字段y"](...)) + _u53d8_u91cfd = not (1 <= _val_0 and _val_0 <= 3) +end +local _u5728_u7684 +do + local _val_0 = "东" + _u5728_u7684 = "东" == _val_0 or "西" == _val_0 +end +if (1 == _u53d8_u91cfa) and (2 == _u53d8_u91cfb or 3 == _u53d8_u91cfb or 4 == _u53d8_u91cfb) or (function() + local _val_0 = _u53d8_u91cfc + return 1 <= _val_0 and _val_0 <= 10 +end)() then + _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc) +end +do + local _exp_0 = _u503c + if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 then + _u6253_u5370("1, 2, 3") + elseif not (0 < _exp_0 and _exp_0 <= 100) then + _u6253_u5370("非 (0 < 值 <= 100)") + elseif (200 <= _exp_0 and _exp_0 < 300) then + _u6253_u5370("200 <= 值 < 300)") + elseif not (333 == _exp_0 or 444 == _exp_0 or 555 == _exp_0) then + _u6253_u5370("非 333, 444 或 555") + end +end +do + local _val_0 = _u53d8_u91cfy + return not (_u5f00_u59cb < _val_0 and _val_0 < _u7ed3_u675f) +end +do + local _u5b58_u5728 + do + local _check_0 = _u8868 + local _val_0 = _u5143_u7d20 + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + _u5b58_u5728 = _find_0 + end + _u68c0_u67e5((function() + local _check_0 = _u8868 + local _val_0 = _u5143_u7d20 + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return true + end + end + return false + end)()) +end +do + local _u5bf9_u8c61 = _u83b7_u53d6() + local _u5b58_u5728 + do + local _check_0 = _u8868 + local _val_0 = _u5143_u7d20 + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + _u5b58_u5728 = _find_0 + end + _u68c0_u67e5((function() + local _check_0 = _u8868 + local _val_0 = _u5143_u7d20 + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return true + end + end + return false + end)()) +end +do + local _u5bf9_u8c61 = _u83b7_u53d6() + local _u5217_u8868 = { + 1, + 2, + 3 + } + local _u4e0d_u5b58_u5728 + do + local _val_0 = _u5143_u7d20 + local _find_0 = false + for _index_0 = 1, #_u5217_u8868 do + local _item_0 = _u5217_u8868[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + _u4e0d_u5b58_u5728 = not _find_0 + end + _u68c0_u67e5((function() + local _val_0 = _u5143_u7d20 + for _index_0 = 1, #_u5217_u8868 do + if _u5217_u8868[_index_0] == _val_0 then + return true + end + end + return false + end)()) + _u68c0_u67e5((function() + local _val_0 = _u5143_u7d20 + return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 + end)()) + _u68c0_u67e5((function(...) + local _check_0 = { + [1] = 1, + [2] = 2, + [3] = 3 + } + local _val_0 = _u5143_u7d20(...) + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return true + end + end + return false + end)(...)) +end +do + _u68c0_u67e5(function() + local _check_0 = _u6570_u7ec4tb + local _val_0 = _u5bf9_u8c61x + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return true + end + end + return false + end) + _u68c0_u67e5(function() + local _check_0 = _u6570_u7ec4tb + local _val_0 = _u5bf9_u8c61x + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return false + end + end + return true + end) + local _u5bf9_u8c61x, _u6570_u7ec4tb + _u68c0_u67e5(function() + for _index_0 = 1, #_u6570_u7ec4tb do + if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then + return true + end + end + return false + end) + _u68c0_u67e5(function() + for _index_0 = 1, #_u6570_u7ec4tb do + if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then + return false + end + end + return true + end) +end +return nil diff --git a/spec/outputs/unicode/lists.lua b/spec/outputs/unicode/lists.lua new file mode 100644 index 0000000..aafd516 --- /dev/null +++ b/spec/outputs/unicode/lists.lua @@ -0,0 +1,281 @@ +local _u4f60_u597d +do + local _accum_0 = { } + local _len_0 = 1 + for _, _u53d8_u91cfx in ipairs({ + 1, + 2, + 3, + 4 + }) do + _accum_0[_len_0] = _u53d8_u91cfx * 2 + _len_0 = _len_0 + 1 + end + _u4f60_u597d = _accum_0 +end +local _u7269_u54c1 = { + 1, + 2, + 3, + 4, + 5, + 6 +} +local _ +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfz in ipairs(_u7269_u54c1) do + if _u53d8_u91cfz > 4 then + _accum_0[_len_0] = _u53d8_u91cfz + _len_0 = _len_0 + 1 + end + end + _ = _accum_0 +end +local _u534a_u5f84 +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfa in ipairs({ + 1, + 2, + 3, + 4, + 5, + 6 + }) do + if _u597d_u6570_u5b57(_u53d8_u91cfa) then + _accum_0[_len_0] = { + _u53d8_u91cfa + } + _len_0 = _len_0 + 1 + end + end + _u534a_u5f84 = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfz in _u7269_u54c1 do + for _u53d8_u91cfj in _u5217_u8868 do + if _u53d8_u91cfz > 4 then + _accum_0[_len_0] = _u53d8_u91cfz + _len_0 = _len_0 + 1 + end + end + end + _ = _accum_0 +end +require("实用") +local _u503e_u5012 +_u503e_u5012 = function(_u53d8_u91cfx) + return _u6253_u5370(_u5b9e_u7528["倾倒"](_u53d8_u91cfx)) +end +local _u8303_u56f4 +_u8303_u56f4 = function(_u6570_u91cf) + local _u53d8_u91cfi = 0 + return coroutine.wrap(function() + while _u53d8_u91cfi < _u6570_u91cf do + coroutine.yield(_u53d8_u91cfi) + _u53d8_u91cfi = _u53d8_u91cfi + 1 + end + end) +end +_u503e_u5012((function() + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u8303_u56f4(10) do + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + return _accum_0 +end)()) +_u503e_u5012((function() + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u8303_u56f4(5) do + if _u53d8_u91cfx > 2 then + for _u53d8_u91cfy in _u8303_u56f4(5) do + _accum_0[_len_0] = { + _u53d8_u91cfx, + _u53d8_u91cfy + } + _len_0 = _len_0 + 1 + end + end + end + return _accum_0 +end)()) +local _u4e1c_u897f +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u8303_u56f4(10) do + if _u53d8_u91cfx > 5 then + for _u53d8_u91cfy in _u8303_u56f4(10) do + if _u53d8_u91cfy > 7 then + _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy + _len_0 = _len_0 + 1 + end + end + end + end + _u4e1c_u897f = _accum_0 +end +for _u53d8_u91cfx in ipairs({ + 1, + 2, + 4 +}) do + for _u53d8_u91cfy in ipairs({ + 1, + 2, + 3 + }) do + if _u53d8_u91cfx ~= 2 then + _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) + end + end +end +for _u53d8_u91cfx in _u7269_u54c1 do + _u6253_u5370("你好", _u53d8_u91cfx) +end +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u53d8_u91cfx do + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + _ = _accum_0 +end +local _u53d8_u91cfx +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u53d8_u91cfx do + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + _u53d8_u91cfx = _accum_0 +end +for _u53d8_u91cfx in ipairs({ + 1, + 2, + 4 +}) do + for _u53d8_u91cfy in ipairs({ + 1, + 2, + 3 + }) do + if _u53d8_u91cfx ~= 2 then + _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) + end + end +end +local _u53cc_u500d +do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #_u7269_u54c1 do + local _u53d8_u91cfx = _u7269_u54c1[_index_0] + _accum_0[_len_0] = _u53d8_u91cfx * 2 + _len_0 = _len_0 + 1 + end + _u53cc_u500d = _accum_0 +end +for _index_0 = 1, #_u53cc_u500d do + local _u53d8_u91cfx = _u53cc_u500d[_index_0] + _u6253_u5370(_u53d8_u91cfx) +end +local _u5207 +do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #_u7269_u54c1 do + local _u53d8_u91cfx = _u7269_u54c1[_index_0] + if _u53d8_u91cfx > 3 then + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + end + _u5207 = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #_u7269_u54c1 do + local _u53d8_u91cfx = _u7269_u54c1[_index_0] + for _index_1 = 1, #_u7269_u54c1 do + local _u53d8_u91cfy = _u7269_u54c1[_index_1] + _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy + _len_0 = _len_0 + 1 + end + end + _u4f60_u597d = _accum_0 +end +for _index_0 = 1, #_u4f60_u597d do + local _u53d8_u91cfz = _u4f60_u597d[_index_0] + _u6253_u5370(_u53d8_u91cfz) +end +_u53d8_u91cfx = { + 1, + 2, + 3, + 4, + 5, + 6, + 7 +} +local _max_0 = -5 +for _index_0 = 2, _max_0 < 0 and #_u53d8_u91cfx + _max_0 or _max_0, 2 do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +local _max_1 = 3 +for _index_0 = 1, _max_1 < 0 and #_u53d8_u91cfx + _max_1 or _max_1 do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +for _index_0 = 2, #_u53d8_u91cfx do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +for _index_0 = 1, #_u53d8_u91cfx, 2 do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +for _index_0 = 2, #_u53d8_u91cfx, 2 do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 1, 5, 2 +local _max_2 = _u53d8_u91cfb +for _index_0 = _u53d8_u91cfa, _max_2 < 0 and #_u53d8_u91cfx + _max_2 or _max_2, _u53d8_u91cfc do + local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] + _u6253_u5370(_u53d8_u91cfy) +end +local _u6b63_u5e38 +_u6b63_u5e38 = function(_u4f60_u597d) + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u55ef_u54fc do + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + return _accum_0 +end +local _u6d4b_u8bd5 = _u53d8_u91cfx(1, 2, 3, 4, 5) +for _index_0 = 1, #_u6d4b_u8bd5 do + local _u4e8b_u60c5 = _u6d4b_u8bd5[_index_0] + _u6253_u5370(_u4e8b_u60c5) +end +return function() + local _list_0 = _u884c_u4eec + for _index_0 = 1, #_list_0 do + local _u884c = _list_0[_index_0] + _u53d8_u91cfa = _u53d8_u91cfb + end +end diff --git a/spec/outputs/unicode/literals.lua b/spec/outputs/unicode/literals.lua new file mode 100644 index 0000000..ccd32f1 --- /dev/null +++ b/spec/outputs/unicode/literals.lua @@ -0,0 +1,36 @@ +local _u6570_u636e = { + 121, + 121.2323, + 121.2323e-1, + 121.2323e13434, + 2323E34, + 0x12323, + 0xfF2323, + 0xabcdef, + 0xABCDEF, + 0x123p-123, + 0xABCP+321, + 0x.1p-111, + 0xABCP-321, + .2323, + .2323e-1, + .2323e13434, + 1LL, + 1ULL, + 9332LL, + 9332, + 0x2aLL, + 0x2aULL, + 1000000.0000001, + 1234e5678, + 1234E-5678, + 0xDEADBEEF, + [[ 你好 世界 ]], + [=[ 你好 世界 ]=], + [====[ 你好 世界 ]====], + "另一个 世界", + '哪个 世界', + "\n 你好 世界\n ", + '是的\n 发生了什么\n 这里有些很酷的东西' +} +return _u7a7a_u503c diff --git a/spec/outputs/unicode/local.lua b/spec/outputs/unicode/local.lua new file mode 100644 index 0000000..170144b --- /dev/null +++ b/spec/outputs/unicode/local.lua @@ -0,0 +1,157 @@ +do + local _u53d8_u91cfa + local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc + local _u53d8_u91cfg + _u53d8_u91cfb, _u53d8_u91cfg = 23232, nil +end +do + local _u53d8_u91cfx = 1212 + local _u67d0_u4e8b + _u67d0_u4e8b = function() + local _u53d8_u91cfx + _u53d8_u91cfx = 1212 + end +end +do + local _u53d8_u91cfy, _u53d8_u91cfz + _u53d8_u91cfy = 2323 + _u53d8_u91cfz = 2323 +end +do + _u6253_u5370("啥也没有!") +end +do + local X_u5927_u5199, Y_u5927_u5199 + local x_u53d8_u91cf = 3434 + local y_u53d8_u91cf = 3434 + X_u5927_u5199 = 3434 + Y_u5927_u5199 = "好" +end +do + local x_u53d8_u91cf, y_u53d8_u91cf = "a", "b" +end +do + local x_u53d8_u91cf, y_u53d8_u91cf + x_u53d8_u91cf, y_u53d8_u91cf = "a", "b" +end +do + if _u67d0_u4e8b then + local x_u53d8_u91cf = 2323 + end +end +do + local _u53d8_u91cfx + do + _u53d8_u91cfx = "一" + end + _u53d8_u91cfx = 100 + do + _u53d8_u91cfx = "二" + end +end +do + local _u53d8_u91cfk, _u53d8_u91cfx, _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc + if _u4ec0_u4e48 then + _u53d8_u91cfk = 10 + end + _u53d8_u91cfx = 100 + do + local _obj_0 = _u53d8_u91cfy + _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = _obj_0[1], _obj_0[2], _obj_0[3] + end +end +do + local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd + _u53d8_u91cfa = 100 + _u6253_u5370("嗨") + _u53d8_u91cfb = 200 + _u53d8_u91cfc = 100 + _u6253_u5370("嗨") + _u53d8_u91cfd = 200 + _u53d8_u91cfd = 2323 +end +do + local A_u5927_u5199, O_u4e00, T_u4e8c + local a_u5c0f_u5199 = 5 + A_u5927_u5199 = 3 + do + local _class_0 + local F_u4e94 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "O一" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + F_u4e94 = 6 + O_u4e00 = _class_0 + end + do + local _class_0 + local N_u65e0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "T二" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + do + local _class_1 + local _base_1 = { } + if _base_1.__index == nil then + _base_1.__index = _base_1 + end + _class_1 = setmetatable({ + __init = function() end, + __base = _base_1, + __name = "N无" + }, { + __index = _base_1, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_1) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_1.__class = _class_1 + N_u65e0 = _class_1 + end + T_u4e8c = _class_0 + end +end +do + local _list_0 = { } + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfa = _list_0[_index_0] + local _ = _u53d8_u91cfa + end +end +do + local _u53d8_u91cfx + _u53d8_u91cfx = _u53d8_u91cfa or _u53d8_u91cfb +end +local _u53d8_u91cfg = 2323 diff --git a/spec/outputs/unicode/loops.lua b/spec/outputs/unicode/loops.lua new file mode 100644 index 0000000..d630343 --- /dev/null +++ b/spec/outputs/unicode/loops.lua @@ -0,0 +1,337 @@ +for _u53d8_u91cfx = 1, 10 do + _u6253_u5370("yeah") +end +for _u53d8_u91cfx = 1, #_u67d0_u7269 do + _u6253_u5370("yeah") +end +for _u53d8_u91cfy = 100, 60, -3 do + _u6253_u5370("倒计时", _u53d8_u91cfy) +end +for _u53d8_u91cfa = 1, 10 do + _u6253_u5370("好的") +end +for _u53d8_u91cfa = 1, 10 do + for _u53d8_u91cfb = 2, 43 do + _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) + end +end +for _u53d8_u91cfi in _u8fed_u4ee3_u5668 do + for _u53d8_u91cfj in _u662f_u7684 do + local _u53d8_u91cfx = 343 + _u53d8_u91cfi + _u53d8_u91cfj + _u6253_u5370(_u53d8_u91cfi, _u53d8_u91cfj) + end +end +local _list_0 = _u67d0_u7269 +for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx = _list_0[_index_0] + _u6253_u5370(_u53d8_u91cfx) +end +for _u952e, _u503c in pairs(_u4f60_u597d) do + _u6253_u5370(_u952e, _u503c) +end +for _u53d8_u91cfx in _u53d8_u91cfy, _u53d8_u91cfz do + _u6253_u5370(_u53d8_u91cfx) +end +for _u53d8_u91cfx in _u53d8_u91cfy, _u53d8_u91cfz, _u952e do + _u6253_u5370(_u53d8_u91cfx) +end +local _list_1 = _u6a21_u5757 +for _index_0 = 1, #_list_1 do + local _u540d_u79f0, _u6210_u5458_u4eec = _list_1[_index_0] + _u6253_u5370(_u540d_u79f0, _u6210_u5458) +end +local _u53d8_u91cfx +_u53d8_u91cfx = function() + for _u53d8_u91cfx in _u53d8_u91cfy do + local _u53d8_u91cf_ = _u53d8_u91cfy + end +end +local _u4f60_u597d = { + 1, + 2, + 3, + 4, + 5 +} +do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #_u4f60_u597d do + local _u53d8_u91cfy = _u4f60_u597d[_index_0] + if _u53d8_u91cfy % 2 == 0 then + _accum_0[_len_0] = _u53d8_u91cfy + end + _len_0 = _len_0 + 1 + end + _u53d8_u91cfx = _accum_0 +end +_u53d8_u91cfx = function() + for _index_0 = 1, #_u4f60_u597d do + local _u53d8_u91cfx = _u4f60_u597d[_index_0] + local _u53d8_u91cf_ = _u53d8_u91cfy + end +end +local _u8868_u683c +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfi = 10, 20 do + _accum_0[_len_0] = _u53d8_u91cfi * 2 + _len_0 = _len_0 + 1 + end + _u8868_u683c = _accum_0 +end +local _u54e6 = 0 +local _u53d8_u91cfy +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfj = 3, 30, 8 do + _u54e6 = _u54e6 + 1 + _accum_0[_len_0] = _u53d8_u91cfj * _u54e6 + _len_0 = _len_0 + 1 + end + _u53d8_u91cfy = _accum_0 +end +local _u53d8_u91cf_ +_u53d8_u91cf_ = function() + for _u53d8_u91cfk = 10, 40 do + _u53d8_u91cf_ = "好的" + end +end +_u53d8_u91cf_ = function() + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfk = 10, 40 do + _accum_0[_len_0] = "好的" + _len_0 = _len_0 + 1 + end + return _accum_0 +end +while true do + _u6253_u5370("名称") +end +while 5 + 5 do + _u6253_u5370("好的 世界") + _u5de5_u4f5c(_u4eba) +end +while _u8fd8_u6709 do + _u6211(_u4e5f(_u5de5_u4f5c)) + _u53d8_u91cf_ = "好的" +end +local _u53d8_u91cfi = 0 +do + local _accum_0 = { } + local _len_0 = 1 + while _u53d8_u91cfi < 10 do + _u53d8_u91cfi = _u53d8_u91cfi + 1 + _accum_0[_len_0] = _u53d8_u91cfi + _len_0 = _len_0 + 1 + end + _u53d8_u91cfx = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + local _list_2 = 3 + for _index_0 = 1, #_list_2 do + local _u4e1c_u897f = _list_2[_index_0] + _u53d8_u91cfy = "你好" + break + _len_0 = _len_0 + 1 + end + _u53d8_u91cfx = _accum_0 +end +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx = 1, 2 do + _u53d8_u91cfy = "你好" + _accum_0[_len_0] = _u53d8_u91cfy + _len_0 = _len_0 + 1 + end + _u53d8_u91cfx = _accum_0 +end +while true do + if false then + goto _continue_0 + end + _u6253_u5370("是的") + if true then + break + end + _u6253_u5370("不") + ::_continue_0:: +end +for _u53d8_u91cfi = 1, 10 do + while true do + if not true then + goto _continue_1 + end + break + ::_continue_1:: + end +end +local _u53d8_u91cfa = 1 +repeat + _u53d8_u91cfa = _u53d8_u91cfa + 1 + if _u53d8_u91cfa == 5 then + goto _continue_2 + end + if _u53d8_u91cfa == 6 then + break + end + _u6253_u5370(_u53d8_u91cfa) + ::_continue_2:: +until _u53d8_u91cfa == 10 +_u53d8_u91cfx = 0 +repeat + _u53d8_u91cfx = _u53d8_u91cfx + 1 + _u53d8_u91cfy = _u53d8_u91cfx + if _u53d8_u91cfx < 5 then + goto _continue_3 + end + _u6253_u5370(_u53d8_u91cfy) + ::_continue_3:: +until _u53d8_u91cfy == 10 +_u53d8_u91cfa = 3 +while not (_u53d8_u91cfa == 0) do + _u53d8_u91cfa = _u53d8_u91cfa - 1 +end +local _u5b8c_u6210 = false +while not _u5b8c_u6210 do + _u5b8c_u6210 = true +end +repeat + _u6253_u5370("你好") +until true +while not _u5b8c_u6210 do + _u53d8_u91cfx = 10 + repeat + _u53d8_u91cfx = _u53d8_u91cfx - 1 + until _u53d8_u91cfx == 0 +end +while not _u6761_u4ef6 do + _u6253_u5370("好的") +end +for _u53d8_u91cfx = 1, 10 do + if _u53d8_u91cfx > 3 and _u53d8_u91cfx < 7 then + goto _continue_4 + end + _u6253_u5370(_u53d8_u91cfx) + ::_continue_4:: +end +local _u5217_u8868 +do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx = 1, 10 do + if _u53d8_u91cfx > 3 and _u53d8_u91cfx < 7 then + goto _continue_5 + end + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + ::_continue_5:: + end + _u5217_u8868 = _accum_0 +end +local _list_2 = { + 1, + 2, + 3, + 4, + 5, + 6 +} +for _index_0 = 1, #_list_2 do + local _u53d8_u91cfa = _list_2[_index_0] + if _u53d8_u91cfa == 1 then + goto _continue_6 + end + if _u53d8_u91cfa == 3 then + goto _continue_6 + end + _u6253_u5370(_u53d8_u91cfa) + ::_continue_6:: +end +for _u53d8_u91cfx = 1, 10 do + if _u53d8_u91cfx % 2 == 0 then + goto _continue_7 + end + for _u53d8_u91cfy = 2, 12 do + if _u53d8_u91cfy % 3 == 0 then + goto _continue_8 + end + ::_continue_8:: + end + ::_continue_7:: +end +while true do + if false then + goto _continue_9 + end + break + ::_continue_9:: +end +while true do + if false then + goto _continue_10 + end + do + return 22 + end + ::_continue_10:: +end +do + local _u4e09_u91cdx = { + 1, + 2, + 3, + 4 + } + for _index_0 = 1, #_u4e09_u91cdx do + local _u4e1c_u897f = _u4e09_u91cdx[_index_0] + _u6253_u5370(_u4e1c_u897f) + end +end +do + for _u53d8_u91cfi = 1, 10 do + repeat + do + local _with_0 = _u5bf9_u8c61tb + if _with_0 ~= nil then + _with_0["字段a"] = 1 + if _with_0["字段b"] then + goto _continue_12 + end + do + if _with_0["字段c"] then + break + end + end + end + end + ::_continue_12:: + until true + if 123 == _u53d8_u91cfx then + break + else + goto _continue_11 + end + if _u53d8_u91cfy then + goto _continue_11 + else + break + end + do + do + do + _u6253_u5370(_u53d8_u91cfi) + goto _continue_11 + end + end + end + _u6253_u5370("abc") + ::_continue_11:: + end +end diff --git a/spec/outputs/unicode/macro.lua b/spec/outputs/unicode/macro.lua new file mode 100644 index 0000000..2ae5dce --- /dev/null +++ b/spec/outputs/unicode/macro.lua @@ -0,0 +1,321 @@ +assert(_u5bf9_u8c61 == nil) +local _u7ed3_u679c = (_u5bf9_u8c61 == nil) +if _u51fd_u65701() then + _u6253_u5370("没问题") +end +if (_u51fd_u65701() and _u51fd_u65702() and _u51fd_u65703()) then + _u6253_u5370("没问题") +end +local _u5bf9_u8c61 +do + local __u6e90_, __u76ee_u6807_ + do + __u76ee_u6807_ = { + ["位置"] = { }, + ["标签"] = (function() + local _call_0 = _u6807_u7b7e + return _call_0["转数字"](_call_0) + end)() + } + do + __u6e90_ = self + __u76ee_u6807_["标识"] = __u6e90_["标识"] + __u76ee_u6807_["连接们"] = __u6e90_["连接们"] + __u76ee_u6807_["位置"]["x坐标"] = __u6e90_["位置"]["x坐标"] + __u76ee_u6807_["位置"]["y坐标"] = __u6e90_["位置"]["y坐标"] + __u76ee_u6807_["位置"]["z坐标"] = __u6e90_["位置"]["z坐标"] + end + _u5bf9_u8c61 = __u76ee_u6807_ + end +end +if (_u53d8_u91cfx == "🍎" or _u53d8_u91cfx == "🐷" or _u53d8_u91cfx == "🐶") then + _u6253_u5370("存在") +end +local _list_0 = (function() + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = (function() + local _accum_1 = { } + local _len_1 = 1 + local _list_0 = { + 1, + 2, + 3 + } + for _index_0 = 1, #_list_0 do + local _ = _list_0[_index_0] + _accum_1[_len_1] = _ * 2 + _len_1 = _len_1 + 1 + end + return _accum_1 + end)() + for _index_0 = 1, #_list_0 do + local _ = _list_0[_index_0] + if _ > 4 then + _accum_0[_len_0] = _ + _len_0 = _len_0 + 1 + end + end + return _accum_0 +end)() +for _index_0 = 1, #_list_0 do + local _ = _list_0[_index_0] + _u6253_u5370(_) +end +local _list_1 = (function() + local _accum_0 = { } + local _len_0 = 1 + local _list_1 = (function() + local _accum_1 = { } + local _len_1 = 1 + local _list_1 = { + 1, + 2, + 3 + } + for _index_0 = 1, #_list_1 do + local _ = _list_1[_index_0] + _accum_1[_len_1] = _ * 2 + _len_1 = _len_1 + 1 + end + return _accum_1 + end)() + for _index_0 = 1, #_list_1 do + local _ = _list_1[_index_0] + if _ > 4 then + _accum_0[_len_0] = _ + _len_0 = _len_0 + 1 + end + end + return _accum_0 +end)() +for _index_0 = 1, #_list_1 do + local _ = _list_1[_index_0] + _u6253_u5370(_) +end +local _u503c +do + local _2 + do + local _accum_0 = { } + local _len_0 = 1 + local _list_2 = { + 1, + 2, + 3 + } + for _index_0 = 1, #_list_2 do + local _ = _list_2[_index_0] + _accum_0[_len_0] = _ * 2 + _len_0 = _len_0 + 1 + end + _2 = _accum_0 + end + local _3 + do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #_2 do + local _ = _2[_index_0] + if _ > 4 then + _accum_0[_len_0] = _ + _len_0 = _len_0 + 1 + end + end + _3 = _accum_0 + end + local _4 + if #_3 == 0 then + _4 = 0 + else + local _1 = 0 + for _index_0 = 1, #_3 do + local _2 = _3[_index_0] + _1 = _1 + _2 + end + _4 = _1 + end + _u503c = _4 +end +local _call_0 = (1 + 2) +_call_0["调用"](_call_0, 123) +_u7ed3_u679c = (1 + 2) +local f +f = function(_u53c2_u6570x) + return function(_u53c2_u6570y) + return function(_u53c2_u6570z) + return _u6253_u5370(_u53c2_u6570x, _u53c2_u6570y, _u53c2_u6570z) + end + end +end +do + local _u53d8_u91cfa = 8 + do + _u53d8_u91cfa = 1 + _u53d8_u91cfa = _u53d8_u91cfa + 1 + end + _u53d8_u91cfa = _u53d8_u91cfa + (function() + _u53d8_u91cfa = 1 + return _u53d8_u91cfa + 1 + end)() + _u6253_u5370(_u53d8_u91cfa) +end +do + local _u53d8_u91cfa = 8 + _u53d8_u91cfa = (function() + local _u53d8_u91cfa + _u53d8_u91cfa = 1 + return _u53d8_u91cfa + 1 + end)() + _u53d8_u91cfa = _u53d8_u91cfa + (function() + local _u53d8_u91cfa + _u53d8_u91cfa = 1 + return _u53d8_u91cfa + 1 + end)() + _u6253_u5370(_u53d8_u91cfa) +end +local _u53d8_u91cfx = 0 +local function f(a) + return a + 1 +end +x = x + f(3) +function tb:func() + print(123) +end +_u6253_u5370(_u53d8_u91cfx) +local sel +sel = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) + if _u53c2_u6570a then + return _u53c2_u6570b + else + return _u53c2_u6570c + end +end +local function sel(a, b, c) + if a then + return b + else + return c + end +end +local function dummy() + +end +-- 这有个注释 +local _ = require('下划线') +local _call_1 = (_({ + 1, + 2, + 3, + 4, + -2, + 3 +})) +_call_1 = _call_1["链"](_call_1, _call_1, _call_1, _call_1, _call_1, _call_1, _call_1, _call_1) +_call_1 = _call_1["映射"](_call_1, _call_1, _call_1, _call_1, function(self) + return self * 2 +end) +_call_1 = _call_1["过滤"](_call_1, _call_1, function(self) + return self > 3 +end) +local _u7ed3_u679ca = _call_1["取值"](_call_1) +local _call_2 = (_({ + 1, + 2, + 3, + 4, + -2, + 3 +})) +_call_2 = _call_2["链"](_call_2, _call_2, _call_2, _call_2, _call_2, _call_2, _call_2, _call_2) +_call_2 = _call_2["映射"](_call_2, _call_2, _call_2, _call_2, function(self) + return self * 2 +end) +_call_2 = _call_2["过滤"](_call_2, _call_2, function(self) + return self > 3 +end) +_call_2["每一个"](_call_2, function(self) + return _u6253_u5370(self) +end) +local _call_3 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] +_call_3 = _call_3["父节点"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) +_call_3 = _call_3["后代"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) +_call_3 = _call_3["选择启用"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) +_call_3 = _call_3["选择可见"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) +_call_3 = _call_3["标签等于"](_call_3, _call_3, _call_3, _call_3, "fx") +_call_3 = _call_3["其中"](_call_3, _call_3, function(x) + local _call_4 = x["名称"] + return _call_4["结尾为"](_call_4, _call_4, "(克隆)") +end) +_u7ed3_u679c = _call_3["摧毁"](_call_3) +do + local _1 + local _call_4 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] + _1 = _call_4["父节点"](_call_4) + local _2 + _2 = _1["后代"](_1) + local _3 + _3 = _2["选择启用"](_2) + local _4 + _4 = _3["选择可见"](_3) + local _5 + _5 = _4["标签等于"](_4, "fx") + local _6 + _6 = _5["其中"](_5, function(x) + local _call_5 = x["名称"] + return _call_5["结尾为"](_call_5, "(克隆)") + end) + _6["摧毁"](_6) +end +local _call_0 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] +_call_0["父节点"](_call_0):_u540e_u4ee3():_u9009_u62e9_u542f_u7528():_u9009_u62e9_u53ef_u89c1():_u6807_u7b7e_u7b49_u4e8e("fx"):_u5176_u4e2d(function(x) + local _call_0 = x["名称"] + return _call_0["结尾为"](_call_0, "(克隆)") +end):_u6467_u6bc1() +_u6253_u5370((setmetatable({ + 'abc', + ["字段a"] = 123, +}, { + __call = function(self) + return 998 + end +}))[1], (setmetatable({ + 'abc', + ["字段a"] = 123, +}, { + __call = function(self) + return 998 + end +}))["字段a"], (setmetatable({ + 'abc', + ["字段a"] = 123, +}, { + __call = function(self) + return 998 + end +}))(), setmetatable({ + 'abc', + ["字段a"] = 123, +}, { + __call = function(self) + return 998 + end +})) +_u6253_u5370("当前代码行数: " .. tostring(268)) +-- 待实现 +do + _u6253_u5370(1) +end +local _1 +_1 = function() + _u6253_u5370(1) + local _accum_0 = { } + local _len_0 = 1 + while false do + break + _len_0 = _len_0 + 1 + end + return _accum_0 +end +_u6253_u5370('abc') +return 123 diff --git a/spec/outputs/unicode/metatable.lua b/spec/outputs/unicode/metatable.lua new file mode 100644 index 0000000..b6ee48a --- /dev/null +++ b/spec/outputs/unicode/metatable.lua @@ -0,0 +1,168 @@ +local _u53d8_u91cfa = setmetatable({ + ["关闭"] = true, +}, { + __close = function(self) + return _u6253_u5370("离开作用域") + end +}) +local _u53d8_u91cfb = setmetatable({ }, { + __add = function(_u5de6, _u53f3) + return _u53f3 - _u5de6 + end +}) +local _u53d8_u91cfc = setmetatable({ + ["键1"] = true, + ["键2"] = true +}, { + __add = add +}) +local _u53d8_u91cfw = setmetatable({ }, { + [_u540d_u79f0] = 123, + ["新建"] = function(self, _u503c) + return { + _u503c + } + end +}) +getmetatable(_u53d8_u91cfw)["新建"](getmetatable(_u53d8_u91cfw)[_u540d_u79f0]) +do + local _ = setmetatable({ }, { + __close = function() + return _u6253_u5370("离开作用域") + end + }) +end +local _u53d8_u91cfd, _u53d8_u91cfe = _u53d8_u91cfa["关闭"], getmetatable(_u53d8_u91cfa).__close +local _u53d8_u91cff = getmetatable(_u53d8_u91cfa):__close(1) +getmetatable(_u53d8_u91cfa).__add = function(x, y) + return x + y +end +do + local _u65b0 = _u53d8_u91cfa["新"] + local close, _u5173_u95edA + do + local _obj_0 = getmetatable(_u53d8_u91cfa) + close, _u5173_u95edA = _obj_0.__close, _obj_0.__close + end + _u6253_u5370(_u65b0, close, _u5173_u95edA) +end +do + local _u53d8_u91cfx, _u65b0, _u53d8_u91cf, close, _u5173_u95edA, num, add, sub + do + local _obj_0, _obj_1 + _u53d8_u91cfx, _obj_0, _obj_1 = 123, _u53d8_u91cfa["变量b"]["变量c"], _u51fd_u6570() + _u65b0, _u53d8_u91cf = _obj_0["新"], _obj_0["变量"] + do + local _obj_2 = getmetatable(_obj_0) + close, _u5173_u95edA = _obj_2.__close, _obj_2.__close + end + num = _obj_1.num + do + local _obj_2 = getmetatable(_obj_1) + add, sub = _obj_2.__add, _obj_2.__sub + end + end +end +setmetatable(_u53d8_u91cfa["变量b"], { }) +_u53d8_u91cfx.abc = 123 +setmetatable(_u51fd_u6570(), mt) +setmetatable(_u53d8_u91cfb["变量c"], mt) +_u53d8_u91cfa, _u53d8_u91cfd, _u53d8_u91cfe = 1, "abc", nil +local _u76f8_u540c = getmetatable(_u53d8_u91cfa).__index == getmetatable(_u53d8_u91cfa).__index +setmetatable(_u53d8_u91cfa, { + __index = _u8868 +}) +getmetatable(_u53d8_u91cfa).__index = _u8868 +getmetatable(_u53d8_u91cfa).__index = _u8868 +local mt = getmetatable(_u53d8_u91cfa) +local _call_0 = _u8868 +_call_0["函数"](_call_0, #_u5217_u8868) +do + local _obj_0 = getmetatable(_u8868) + _obj_0["函数"](_obj_0, _u5217_u8868) +end +do + local _obj_0 = getmetatable(_u8868) + _obj_0["函数"](_obj_0, _u5217_u8868) +end +local index, _u8bbe_u7f6e_u51fd_u6570 +do + local _obj_0 = getmetatable(require("模块")) + index, _u8bbe_u7f6e_u51fd_u6570 = _obj_0.__index, _obj_0.__newindex +end +do + local _with_0 = _u8868 + _u6253_u5370(getmetatable(_with_0).__add, getmetatable(_with_0.x):__index("key")) + do + local _obj_0 = getmetatable(getmetatable(getmetatable(_with_0).__index).__add) + _u53d8_u91cfa = _obj_0["新建"](_obj_0, 123) + end + _u53d8_u91cfb = t(#getmetatable(_with_0).__close["测试"]) + _u53d8_u91cfc = t(#getmetatable(_with_0).__close(_with_0["测试"])) +end +mt = getmetatable(_u53d8_u91cfa) +_u53d8_u91cfa = setmetatable({ }, mt) +_u53d8_u91cfa = setmetatable({ }, { + __index = mt +}) +local index +local _u7d22_u5f15 = getmetatable(_u53d8_u91cfa).__index +index = getmetatable(_u53d8_u91cfa).__index +do + local _u6784_u9020, _u66f4_u65b0 + do + local _obj_0 = getmetatable(_u53d8_u91cfa) + _u6784_u9020, _u66f4_u65b0 = _obj_0["新"], _obj_0["更新"] + end +end +do + local _u6784_u9020, _u66f4_u65b0 + do + local _obj_0 = getmetatable(_u53d8_u91cfa) + _u6784_u9020, _u66f4_u65b0 = _obj_0["新"], _obj_0["更新"] + end +end +local _u8868 = { } +do + do + local _obj_0 = getmetatable(_u8868) + _u53d8_u91cff = _obj_0["值" .. tostring(x < y)](_obj_0, 123, ...) + end + _u53d8_u91cff((function(...) + local _obj_0 = getmetatable(_u8868) + return _obj_0['值'](_obj_0, 123, ...) + end)(...)) + do + local _obj_0 = getmetatable(_u8868) + _obj_0[ [[ 值 + 1 + ]]](_obj_0, 123, ...) + end + local _obj_0 = getmetatable(_u8868) + return _obj_0["值" .. tostring(x > y)](_obj_0, 123, ...) +end +do + do + local _obj_0 = getmetatable(_u8868) + _u53d8_u91cff = _obj_0['值'](_obj_0, 123, ...) + end + _u53d8_u91cff((function(...) + local _obj_0 = getmetatable(_u8868) + return _obj_0['值'](_obj_0, 123, ...) + end)(...)) + do + local _obj_0 = getmetatable(_u8868) + _obj_0['值'](_obj_0, 123, ...) + end + local _obj_0 = getmetatable(_u8868) + return _obj_0['值'](_obj_0, 123, ...) +end +do + _u53d8_u91cff = getmetatable(_u8868)["值"](123, ...) + _u53d8_u91cff = getmetatable(_u8868)["值" .. tostring(x < y)](123, ...) + _u53d8_u91cff(getmetatable(_u8868)['值'](123, ...)) + getmetatable(_u8868)[ [[ 值 +1]]](123, ...) + return getmetatable(_u8868)["值" .. tostring(x > y)](123, ...) +end +return nil diff --git a/spec/outputs/unicode/multiline_chain.lua b/spec/outputs/unicode/multiline_chain.lua new file mode 100644 index 0000000..90fdf0b --- /dev/null +++ b/spec/outputs/unicode/multiline_chain.lua @@ -0,0 +1,135 @@ +local _u53d8_u91cfx = _u53d8_u91cfa["变量b"]["变量c"]["变量d"] +local _call_0 = _u53d8_u91cfa["变量b"] +_u53d8_u91cfx["变量y"] = _call_0["变量c"](_call_0) +_u51fd_u6570(1, (function() + local _call_1 = _u53c2_u65702["值"] + return _call_1["获取"](_call_1) +end)(), (function() + local _call_1 = _u53c2_u65703["值"] + return _call_1["获取"](_call_1) +end)(), { + 1, + ((function() + if _u53d8_u91cfx ~= nil then + local _obj_0 = _u53d8_u91cfx["变量y"] + if _obj_0 ~= nil then + return _obj_0["变量z"] + end + return nil + end + return nil + end)() ~= nil), + 3 +}) +local _u8868bb = { + ["键1"] = (function() + local _call_1 = _u53d8_u91cfa + return _call_1["变量b"](_call_1, 123)["变量c"]() + end)(), + ["键2"] = { + ["键w1"] = (function() + local _call_1 = _u53d8_u91cfa()["变量b"] + return _call_1["变量c"](_call_1) + end)() + } +} +local _u8868b +do + local _obj_0 = _u51fd_u65702 + if _obj_0 ~= nil then + _u8868b = _obj_0("abc", _u51fd_u65701({ })["变量a"]) + end +end +local _u51fd_u6570 +_u51fd_u6570 = function() + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u503c_u96c6_u5408 + for _index_0 = 1, #_list_0 do + local _des_0 = _list_0[_index_0] + local _u53d8_u91cfa = _des_0[1] + local _call_1 = _u53d8_u91cfa["变量b"] + _accum_0[_len_0] = _call_1["变量c"](_call_1, 123) + _len_0 = _len_0 + 1 + end + return _accum_0 +end +local _u51fd_u65701 +_u51fd_u65701 = function() + return _u53d8_u91cfx, (function() + local _call_1 = _u53d8_u91cfa + return _call_1["变量b"](_call_1, 123)["变量c"]("abc") + end)() +end +local _call_1 = _u539f_u59cb["转换"].root.gameObject +local _call_2 = _call_1["父节点"](_call_1) +local _call_3 = _call_2["后代节点"](_call_2) +local _call_4 = _call_3["选择启用"](_call_3) +local _call_5 = _call_4["选择可见"](_call_4) +local _call_6 = _call_5["标签相等"](_call_5, "fx") +local _call_7 = _call_6["筛选"](_call_6, function(_u5143_u7d20) + if _u5143_u7d20["是否目标"](_u5143_u7d20, _u5143_u7d20) then + return false + end + local _call_7 = _u5143_u7d20["名称"] + return _call_7["结束于"](_call_7, _call_7, "(Clone)") +end) +local _u7ed3_u679c = _call_7["销毁"](_call_7) +local _call_8 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] +local _call_9 = _call_8["父节点"](_call_8) +local _call_10 = _call_9["后代节点"](_call_9) +local _call_11 = _call_10["选择启用"](_call_10) +local _call_12 = _call_11["选择可见"](_call_11) +local _call_13 = _call_12["标签相等"](_call_12, "fx") +local _call_14 = _call_13["筛选"](_call_13, function(_u5143_u7d20) + local _call_14 = _u5143_u7d20["名称"] + return _call_14["结束于"](_call_14, _call_14, "(Clone)") +end) +_call_14["销毁"](_call_14) +do + local _with_0 = _u9879_u76ee + _with_0["项目字段A"] = 123 + local _call_15 = _with_0["调用方法"](_with_0) + _call_15["连续调用"](_call_15) + local _call_16 = _with_0["调用方法"](_with_0) + _call_16["连续调用"](_call_16) + _with_0["连续调用"](_with_0) + do + local _call_17 = _with_0["项目字段B"] + local _exp_0 = _call_17["取值"](_call_17) + if "Valid" == _exp_0 or _with_0["获取项目状态"](_with_0) == _exp_0 then + local _call_18 = _with_0["项目方法A"](_with_0) + _call_18["取值"](_call_18) + else + local _call_18 = _with_0["项目方法B"](_with_0) + _call_18["取值"](_call_18) + end + end + local _u53d8_u91cfa + if _with_0["项目字段C"] then + _u53d8_u91cfa = _with_0["项目字段D"] + else + _u53d8_u91cfa = _with_0["项目字段E"] + end + local _list_0 = _u503c_u96c6_u5408 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfv = _list_0[_index_0] + _with_0["项目方法C"](_with_0, _u53d8_u91cfv) + end + for _u53d8_u91cfi = 1, _u8ba1_u6570_u5668 do + _with_0["项目方法C"](_with_0, _u53d8_u91cfi) + end + if not _with_0["变量b"] then + do + local _accum_0 = { } + local _len_0 = 1 + while _with_0["项目字段D"] do + local _call_17 = _with_0["下一个项目"](_with_0) + _accum_0[_len_0] = _call_17["取得"](_call_17) + _len_0 = _len_0 + 1 + end + _with_0["变量c"] = _accum_0 + end + end +end +return nil diff --git a/spec/outputs/unicode/nil_coalescing.lua b/spec/outputs/unicode/nil_coalescing.lua new file mode 100644 index 0000000..90fd097 --- /dev/null +++ b/spec/outputs/unicode/nil_coalescing.lua @@ -0,0 +1,182 @@ +do + local _u53d8_u91cfa + do + local _exp_0 = _u53d8_u91cfb + if _exp_0 ~= nil then + _u53d8_u91cfa = _exp_0 + else + _u53d8_u91cfa = _u53d8_u91cfc + end + end +end +do + local _u5b57_u6bb5a + do + local _exp_0 = _u53d8_u91cfb + if _exp_0 ~= nil then + _u5b57_u6bb5a = _exp_0["字段a"] + else + _u5b57_u6bb5a = _u53d8_u91cfc["字段a"] + end + end +end +do + local _u53d8_u91cfa = _u51fd_u6570() + if _u53d8_u91cfa == nil then + _u53d8_u91cfa = false + end +end +do + local _u53d8_u91cfa + if _u53d8_u91cfa == nil then + _u53d8_u91cfa = _u51fd_u6570() + end +end +do + local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe + if _u53d8_u91cfb ~= nil then + _u53d8_u91cfa = _u53d8_u91cfb + else + if _u53d8_u91cfc ~= nil then + _u53d8_u91cfa = _u53d8_u91cfc + else + if _u53d8_u91cfd ~= nil then + _u53d8_u91cfa = _u53d8_u91cfd + else + _u53d8_u91cfa = _u53d8_u91cfe + end + end + end +end +do + local _u53d8_u91cfa + do + local _exp_0 = _u53d8_u91cfb + if _exp_0 ~= nil then + _u53d8_u91cfa = _exp_0 + else + do + local _exp_1 = _u53d8_u91cfc + if _exp_1 ~= nil then + _u53d8_u91cfa = _exp_1 + else + do + local _exp_2 = _u53d8_u91cfd + if _exp_2 ~= nil then + _u53d8_u91cfa = _exp_2 + else + _u53d8_u91cfa = _u53d8_u91cfe + end + end + end + end + end + end +end +do + _u51fd_u6570((function() + local _exp_0 = _u53d8_u91cfx + if _exp_0 ~= nil then + return _exp_0 + else + return "你好" + end + end)()) +end +do + do + local _with_0 + do + local _exp_0 = _u51fd_u6570A() + if _exp_0 ~= nil then + _with_0 = _exp_0 + else + _with_0 = _u51fd_u6570B() + end + end + _u6253_u5370(_with_0["字段"]) + end +end +do + local _u53d8_u91cfa = 1 + 2 + (function() + local _exp_0 = _u53d8_u91cfb + if _exp_0 ~= nil then + return _exp_0 + else + return _u53d8_u91cfc + 3 + 4 + end + end)() +end +do + local _u53d8_u91cfa = 1 + 2 + ((function() + local _exp_0 = _u53d8_u91cfb + if _exp_0 ~= nil then + return _exp_0 + else + return _u53d8_u91cfc + end + end)()) + 3 + 4 +end +do + local _u5b57_u6bb5a, _u5b57_u6bb5b + do + local _obj_0 = _u51fd_u6570() + _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] + end + local _u53d8_u91cfa = _u53d8_u91cfa or 1 + local _u53d8_u91cfb + if _u53d8_u91cfb == nil then + do + local _exp_0 = _u53d8_u91cfc + if _exp_0 ~= nil then + _u53d8_u91cfb = _exp_0 + else + _u53d8_u91cfb = 2 + end + end + end +end +do + local _u53d8_u91cfa + do + local _exp_0 = 1 + if _exp_0 ~= nil then + _u53d8_u91cfa = _exp_0 + else + do + local _exp_1 = 2 + if _exp_1 ~= nil then + _u53d8_u91cfa = _exp_1 + else + _u53d8_u91cfa = 3 + end + end + end + end +end +do + local _obj_0 = _u53d8_u91cfa["字段"] + if _obj_0["字段"] == nil then + _obj_0["字段"] = 1 + end + local _u53d8_u91cfa + do + local _exp_0 = _u53d8_u91cfb["字段"] + if _exp_0 ~= nil then + _u53d8_u91cfa = _exp_0 + else + do + local _exp_1 = _u53d8_u91cfc["字段"] + if _exp_1 ~= nil then + _u53d8_u91cfa = _exp_1 + else + _u53d8_u91cfa = _u53d8_u91cfd["字段"] + end + end + end + end + if _u53d8_u91cfa["字段"] == nil then + _u53d8_u91cfa["字段"] = 1 + end +end +return nil diff --git a/spec/outputs/unicode/operators.lua b/spec/outputs/unicode/operators.lua new file mode 100644 index 0000000..c515dd1 --- /dev/null +++ b/spec/outputs/unicode/operators.lua @@ -0,0 +1,29 @@ +local _u6570_u5b57x = 1 + 3 +local _u6570_u5b57y = 1 + 3 +local _u6570_u5b57z = 1 + 3 + 4 +local _u6570_u5b57k = _u53d8_u91cfb and _u53d8_u91cfc and _u53d8_u91cfg +local _u53d8_u91cfh = _u4e1c_u897f and function() + return _u6253_u5370("你好 世界") +end +local _u53d8_u91cfi = _u4e1c_u897f or function() + return _u6253_u5370("你好 世界") +end +local _u53d8_u91cfp = _u4e1c_u897f and function() end +_u6253_u5370("你好 世界") +local _u53d8_u91cfs = _u4e1c_u897f or function() end and 234 +local _u53d8_u91cfu = { + ["颜色"] = 1 and 2 and 3, + 4, + 4 +} +local _u53d8_u91cfv = { + ["颜色"] = 1 and function() + return "yeah" + end, + "great", + ["好的"] = 3 ^ 2 +} +local _u53d8_u91cfnno = (_u662f_u7684 + 2) +local _u53d8_u91cfnn = (_u662f_u7684 + 2) +local _u53d8_u91cfn = _u4f60_u597d(_u53d8_u91cfb)(function() end) +return _u4f60_u597d(_u53d8_u91cfa, (_u662f_u7684 + 2) - _u597d_u7684) diff --git a/spec/outputs/unicode/pipe.lua b/spec/outputs/unicode/pipe.lua new file mode 100644 index 0000000..6e262ae --- /dev/null +++ b/spec/outputs/unicode/pipe.lua @@ -0,0 +1,135 @@ +_u6bcf_u4e00_u4e2a({ + "abc", + 123, + 998 +}, _u6253_u5370) +_u6253_u5370(_u5408_u5e76(_u8fc7_u6ee4(_u6620_u5c04({ + 1, + 2, + 3 +}, function(_u53d8_u91cfx) + return _u53d8_u91cfx * 2 +end), function(_u53d8_u91cfx) + return _u53d8_u91cfx > 4 +end), 0, function(_u53d8_u91cfa, _u53d8_u91cfb) + return _u53d8_u91cfa + _u53d8_u91cfb +end)) +_u6253_u5370(table.concat((function() + local _accum_0 = { } + local _len_0 = 1 + for i = 0, 10 do + _accum_0[_len_0] = tostring(i) + _len_0 = _len_0 + 1 + end + return _accum_0 +end)(), ",")) +local _u53d8_u91cfb = 1 + 2 + (_u6253_u5370(tostring(4), 1) or 123) +do + local _u53d8_u91cfx = math.max(233, 998) + if _u53d8_u91cfx then + _u6253_u5370(_u53d8_u91cfx) + end +end +do + local _with_0 + do + local _obj_0 = _u521b_u5efa + if _obj_0 ~= nil then + _with_0 = _obj_0(_u53d8_u91cfb, "new") + end + end + _with_0.value = 123 + _u6253_u5370(_with_0["工作"](_with_0)) +end +do + local _obj_0 = _u51fd_u6570f + if _obj_0 ~= nil then + _obj_0(123) + end +end +do + local _obj_0 = _u51fd_u65702 + if _obj_0 ~= nil then + _obj_0((function() + local _obj_1 = _u51fd_u65701 + if _obj_1 ~= nil then + return _obj_1("abc") + end + return nil + end)()) + end +end +local _u53d8_u91cfc +do + local _obj_0 = _u51fd_u65702 + if _obj_0 ~= nil then + _u53d8_u91cfc = _obj_0((function() + local _obj_1 = _u51fd_u65701 + if _obj_1 ~= nil then + return _obj_1("abc") + end + return nil + end)()) + end +end +local _u51fd_u6570f +_u51fd_u6570f = function() + local _obj_0 = x.y + if _obj_0 ~= nil then + return _obj_0["如果"](_obj_0, _u53c2_u6570) + end + return nil +end +_u51fd_u65702(998, "abc", _u51fd_u65701(_u51fd_u65700(233))) +_u51fd_u65702(_u51fd_u65701(_u51fd_u65700(998, "abc", 233))) +_u51fd_u6570f(1, 2, 3, 4, 5) +_u51fd_u6570f(1, _u503c(2), 3, 4, 5) +_u51fd_u6570f(1, 2, _u6570_u7ec4[3], 4, 5) +local _u53d8_u91cfa = _u51fd_u65702(1, _u51fd_u65701(1, 2, 3, tonumber(table.concat({ + "1", + "2", + "3" +}, ""))), 3) +_u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) +_u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) +_u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) +_u51fd_u6570f(not _u51fd_u6570(123)) +do + local _1 = abc(123, -_u51fd_u6570((function() + local _call_0 = _u5217_u8868({ + "abc", + "xyz", + "123" + }) + local _call_1 = _call_0["映射"](_call_0, "#") + return _call_1["值"](_call_1) + end)()), "x") + _2, _3, _4 = 1, 2, _u51fd_u6570f(3) + local _5 + _5 = _u51fd_u65704(_u51fd_u65703(_u51fd_u65702(_u51fd_u65701(_u53d8_u91cfv, 1), 2), 3), 4) +end +local _u53d8_u91cfx = _u51fd_u6570b(_u51fd_u6570a(123)) or _u51fd_u6570d(_u51fd_u6570c(456)) or (function() + local _call_0 = _u51fd_u6570a["if"] + return _call_0["那么"](_call_0, "abc") +end)() or (function() + local _obj_0 = _u51fd_u6570a + if _obj_0 ~= nil then + local _obj_1 = _obj_0["函数b"] + local _obj_2 = _obj_1["函数c"] + if _obj_2 ~= nil then + return _obj_2(_obj_1, 123) + end + return nil + end + return nil +end)() or (function() + local _base_0 = _u53d8_u91cfx + local _fn_0 = _base_0["函数y"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end)() +local _u53d8_u91cfx1 = 3 * _u51fd_u6570f(-4) +local _u53d8_u91cfx2 = 3 * _u51fd_u6570f(-2 ^ 2) +local _u53d8_u91cfy = 1 + _u51fd_u6570b(3, (_u51fd_u6570a ^ _u51fd_u6570c)(not #2)) * _u51fd_u65701(_u51fd_u6570f(4 ^ -123)) or 123 +return nil diff --git a/spec/outputs/unicode/plus.lua b/spec/outputs/unicode/plus.lua new file mode 100644 index 0000000..75e4aac --- /dev/null +++ b/spec/outputs/unicode/plus.lua @@ -0,0 +1,73 @@ +local _call_0 = _u53d8_u91cfx +_call_0["执行"](_call_0, "工作") +_u65b9_u6cd5((function() + local _call_1 = _u53d8_u91cfa + local _call_2 = _call_1["执行"](_call_1) + local _call_3 = _call_2["结束"](_call_2, "好") + return _call_3["如果"](_call_3, "abc", 123) +end)()) +local _call_1 = _u53d8_u91cfb["函数"] +local _call_2 = _call_1["执行"](_call_1) +local _call_3 = _call_2["当"](_call_2, "好") +local _u7ed3_u679c = _call_3["如果"](_call_3, "def", 998) +local _call_4 = _u53d8_u91cfc["重复"]["如果"] +local _call_5 = _call_4["然后"](_call_4, "xyz") +_call_5["否则"](_call_5, _u7ed3_u679c) +_u6253_u5370(self["循环"], self.__class["函数"](self.__class, 123)) +do + local _call_6 = _u6d88_u606f + local _u989c_u8272 = _call_6["匹配"](_call_6, "<%w*>") + if _u989c_u8272 then + local _call_7 = _u6d88_u606f + local _u6d88_u606f = _call_7["替换"](_call_7, "<%->", _u989c_u8272) + end +end +local _u6d88_u606f +do + local _u989c_u8272 = _u6d88_u606f["匹配"](_u6d88_u606f, "<%w*>") + if _u989c_u8272 then + _u6d88_u606f = _u6d88_u606f["替换"](_u6d88_u606f, "<%->", _u989c_u8272) + end +end +local _u6570_u503cA +do + local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() + if _u65b9_u6cd5 then + _u6570_u503cA = _u65b9_u6cd5() + end +end +local _u6570_u503cA +do + local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() + if _u65b9_u6cd5 then + _u6570_u503cA = _u65b9_u6cd5() + end +end +local _u6570_u503cB +do + local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() + if _u65b9_u6cd5 ~= nil then + _u6570_u503cB = _u65b9_u6cd5() + end +end +_u80cc_u5305 = { + ["东西"] = { + ["好的"] = 200, + ["他们"] = function() + _u6253_u5370("你好") + return _u4f60_u7684_u811a("小") + end, + ["美丽"] = _u5934_u53d1, + ["黄金"] = _u55ef_u54fc + }, + ["为什么"] = 1000, + ["吃"] = _u98df_u7269, + ["好的"] = _u670b_u53cb +} +local _u5f00_u59cb = { + ["东西"] = "冷" +} +local _u6d17_u6fa1 +_u6d17_u6fa1 = { + ["在"] = "火" +} diff --git a/spec/outputs/unicode/return.lua b/spec/outputs/unicode/return.lua new file mode 100644 index 0000000..250932d --- /dev/null +++ b/spec/outputs/unicode/return.lua @@ -0,0 +1,126 @@ +local _ +_ = function() + local _list_0 = _u7269_u54c1 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx = _list_0[_index_0] + _ = _u53d8_u91cfx + end +end +_ = function() + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u7269_u54c1 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx = _list_0[_index_0] + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + return _accum_0 +end +do + local _list_0 = _u7269_u54c1 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx = _list_0[_index_0] + return _u53d8_u91cfx + end +end +do + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u7269_u54c1 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx = _list_0[_index_0] + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + return _accum_0 +end +do + local _tbl_0 = { } + local _list_0 = _u7269_u54c1 + for _index_0 = 1, #_list_0 do + local _u53d8_u91cfx, _u53d8_u91cfy = _list_0[_index_0] + _tbl_0[_u53d8_u91cfx] = _u53d8_u91cfy + end + return _tbl_0 +end +_ = function() + if _u53d8_u91cfa then + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + elseif _u53d8_u91cfb then + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + else + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + end +end +do + if _u53d8_u91cfa then + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + elseif _u53d8_u91cfb then + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + else + if _u53d8_u91cfa then + return _u53d8_u91cfa + else + return _u53d8_u91cfb + end + end +end +do + return { + ["值"] = _u503c, + ["物品A"] = 123, + ["物品B"] = "abc" + } +end +do + local _tab_0 = { + 1, + 2 + } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u4e09) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0[#_tab_0 + 1] = 4 + return _tab_0 +end +_ = function() + local _base_0 = _u53d8_u91cfa + local _fn_0 = _base_0["变量b"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end +do + local _base_0 = _u53d8_u91cfa + local _fn_0 = _base_0["变量b"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end diff --git a/spec/outputs/unicode/string.lua b/spec/outputs/unicode/string.lua new file mode 100644 index 0000000..6bfb033 --- /dev/null +++ b/spec/outputs/unicode/string.lua @@ -0,0 +1,53 @@ +local _u4f60_u597d = "你好" +local _u95ee_u5019 = "啥事,好吧" +_u6253_u5370(_u4f60_u597d) +local _u55ef = '嗯' +local _u8fd9_u91cc, _u53e6_u4e00_u4e2a = "好的", '世界' +local _u5440 = "YU'M" +_u4f60('我说:"嗯"') +_u6253_u5370(_u5440, _u4f60) +_u53e6_u4e00_u4e2a = [[ 你好 世界 ]] +local _u4f60_u597d__u90a3_u91cc = [[ 你好呀 +]] +local _u597d_u5427 = [==[ "helo" ]==] +local _u54c8_u55bd = [===[ eat noots]===] +local _u55ef_u55ef = [[well trhere]] +local _u6587_u5b57 = [[ +nil +Fail to compile +]] +_u6587_u5b57[ [[abc]]] = [["#{变量i}" for 变量i = 1, 10] for 变量i = 1, 10]] +local _u54e6_u54e6 = "" +local _u53d8_u91cfx = "\\" +_u53d8_u91cfx = "a\\b" +_u53d8_u91cfx = "\\\n" +_u53d8_u91cfx = "\"" +local _u53d8_u91cfa = "你好 " .. tostring(_u95ee_u5019) .. " 你好" +local _u53d8_u91cfb = tostring(_u95ee_u5019) .. " 你好" +local _u53d8_u91cfc = "你好 " .. tostring(5 + 1) +local _u53d8_u91cfd = tostring(_u4f60_u597d(_u4e16_u754c)) +local _u53d8_u91cfe = tostring(1) .. " " .. tostring(2) .. " " .. tostring(3) +local _u53d8_u91cff = [[你好 #{世界} 世界]] +local _u53d8_u91cfg = "#{你好 世界}" +_u53d8_u91cfa = '你好 #{问候} 你好' +_u53d8_u91cfb = '#{问候} 你好' +_u53d8_u91cfc = '你好 #{问候}' +local _u53d8_u91cf_ = "你好" +local _call_0 = ("你好") +_call_0["格式"](_call_0, 1) +local _call_1 = ("你好") +_call_1["格式"](_call_1, 1, 2, 3) +local _call_2 = ("你好") +_call_2["格式"](_call_2, 1, 2, 3)(1, 2, 3) +local _call_3 = ("你好") +_call_3["世界"](_call_3) +local _call_4 = ("你好") +_call_4["格式"](_call_4)["问候"](1, 2, 3) +local _call_5 = ("你好") +_call_5["格式"](_call_5, 1, 2, 3) +local _call_6 = _u67d0_u4e8b("你好") +_call_6["世界"](_call_6) +return _u67d0_u4e8b((function() + local _call_7 = ("你好") + return _call_7["世界"](_call_7) +end)()) diff --git a/spec/outputs/unicode/stub.lua b/spec/outputs/unicode/stub.lua new file mode 100644 index 0000000..5f183a1 --- /dev/null +++ b/spec/outputs/unicode/stub.lua @@ -0,0 +1,26 @@ +local _u53d8_u91cfx = { + ["值"] = 100, + ["你好"] = function(self) + return _u6253_u5370(self.val) + end +} +local _u51fd_u6570 +do + local _base_0 = _u53d8_u91cfx + local _fn_0 = _base_0["值"] + _u51fd_u6570 = _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end +_u6253_u5370(_u51fd_u6570()) +_u6253_u5370(_u53d8_u91cfx["值"](_u53d8_u91cfx)); +(function(...) + do + local _base_0 = _u4f60_u597d(...) + local _fn_0 = _base_0["世界"] + _u53d8_u91cfx = _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end +end)() +return nil diff --git a/spec/outputs/unicode/switch.lua b/spec/outputs/unicode/switch.lua new file mode 100644 index 0000000..6b8bbdc --- /dev/null +++ b/spec/outputs/unicode/switch.lua @@ -0,0 +1,401 @@ +do + local _exp_0 = _u503c + if "酷" == _exp_0 then + _u6253_u5370("你好,世界") + end +end +do + local _exp_0 = _u503c + if "酷" == _exp_0 then + _u6253_u5370("你好,世界") + else + _u6253_u5370("好的,很棒") + end +end +do + local _exp_0 = _u503c + if "酷" == _exp_0 then + _u6253_u5370("你好,世界") + elseif "是的" == _exp_0 then + local _u53d8_u91cf_ = [[FFFF]] + [[MMMM]] + elseif (2323 + 32434) == _exp_0 then + _u6253_u5370("好的") + else + _u6253_u5370("好的,很棒") + end +end +local _u8f93_u51fa +do + local _exp_0 = _u503c + if "酷" == _exp_0 then + _u8f93_u51fa = _u6253_u5370("你好,世界") + else + _u8f93_u51fa = _u6253_u5370("好的,很棒") + end +end +do + local _exp_0 = _u503c + if "酷" == _exp_0 then + _u8f93_u51fa = _u53d8_u91cfx + elseif "哦" == _exp_0 then + _u8f93_u51fa = 34340 + else + _u8f93_u51fa = error("这大大地失败了") + end +end +do + local _with_0 = _u4e1c_u897f + do + local _exp_0 = _with_0["值"](_with_0) + if _with_0["确定"] == _exp_0 then + local _u53d8_u91cf_ = "世界" + else + local _u53d8_u91cf_ = "是的" + end + end +end +_u4fee_u590d(_u8fd9_u4e2a) +call_func((function() + local _exp_0 = _u67d0_u7269 + if 1 == _exp_0 then + return "是" + else + return "否" + end +end)()) +do + local _exp_0 = _u55e8 + if (_u4f60_u597d or _u4e16_u754c) == _exp_0 then + local _u53d8_u91cf_ = _u7eff_u8272 + end +end +do + local _exp_0 = _u55e8 + if "一个" == _exp_0 or "两个" == _exp_0 then + _u6253_u5370("酷") + elseif "爸爸" == _exp_0 then + local _u53d8_u91cf_ = _u5426 + end +end +do + local _exp_0 = _u55e8 + if (3 + 1) == _exp_0 or _u4f60_u597d() == _exp_0 or (function() + return 4 + end)() == _exp_0 then + local _u53d8_u91cf_ = _u9ec4_u8272 + else + _u6253_u5370("酷") + end +end +do + local _u5b57_u5178 = { + { }, + { + 1, + 2, + 3 + }, + ["变量a"] = { + ["变量b"] = { + ["变量c"] = 1 + } + }, + ["变量x"] = { + ["变量y"] = { + ["变量z"] = 1 + } + } + } + do + local _type_0 = type(_u5b57_u5178) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + local _u7b2c_u4e00 = _u5b57_u5178[1] + local _u4e00_u4e2a + do + local _obj_0 = _u5b57_u5178[2] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + _u4e00_u4e2a = _obj_0[1] + end + end + local _u4e24_u4e2a + do + local _obj_0 = _u5b57_u5178[2] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + _u4e24_u4e2a = _obj_0[2] + end + end + local _u4e09_u4e2a + do + local _obj_0 = _u5b57_u5178[2] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + _u4e09_u4e2a = _obj_0[3] + end + end + local _u53d8_u91cfc + do + local _obj_0 = _u5b57_u5178["变量a"] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + do + local _obj_1 = _obj_0["变量b"] + local _type_2 = type(_obj_1) + if "table" == _type_2 or "userdata" == _type_2 then + _u53d8_u91cfc = _obj_1["变量c"] + end + end + end + end + local _u53d8_u91cfz + do + local _obj_0 = _u5b57_u5178["变量x"] + local _type_1 = type(_obj_0) + if "table" == _type_1 or "userdata" == _type_1 then + do + local _obj_1 = _obj_0["变量y"] + local _type_2 = type(_obj_1) + if "table" == _type_2 or "userdata" == _type_2 then + _u53d8_u91cfz = _obj_1["变量z"] + end + end + end + end + if _u7b2c_u4e00 ~= nil and _u4e00_u4e2a ~= nil and _u4e24_u4e2a ~= nil and _u4e09_u4e2a ~= nil and _u53d8_u91cfc ~= nil and _u53d8_u91cfz ~= nil then + _u6253_u5370(_u7b2c_u4e00, _u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a, _u53d8_u91cfc, _u53d8_u91cfz) + end + end + end +end +do + local _u7269_u54c1 = { + { + ["变量x"] = 100, + ["变量y"] = 200 + }, + { + ["宽度"] = 300, + ["高度"] = 400 + }, + false + } + for _index_0 = 1, #_u7269_u54c1 do + local _u7269 = _u7269_u54c1[_index_0] + do + local _type_0 = type(_u7269) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + local _match_0 = false + if _tab_0 then + local _u53d8_u91cfx = _u7269["变量x"] + local _u53d8_u91cfy = _u7269["变量y"] + if _u53d8_u91cfx ~= nil and _u53d8_u91cfy ~= nil then + _match_0 = true + _u6253_u5370("Vec2 " .. tostring(_u53d8_u91cfx) .. ", " .. tostring(_u53d8_u91cfy)) + end + end + if not _match_0 then + local _match_1 = false + if _tab_0 then + local _u5bbd_u5ea6 = _u7269["宽度"] + local _u9ad8_u5ea6 = _u7269["高度"] + if _u5bbd_u5ea6 ~= nil and _u9ad8_u5ea6 ~= nil then + _match_1 = true + _u6253_u5370("Size " .. tostring(_u5bbd_u5ea6) .. ", " .. tostring(_u9ad8_u5ea6)) + end + end + if not _match_1 then + if false == _u7269 then + _u6253_u5370("没有") + else + local _match_2 = false + if _tab_0 then + local _u7c7b = _u7269["__类"] + if _u7c7b ~= nil then + _match_2 = true + if _u7c7b_u522bA == _u7c7b then + _u6253_u5370("对象 A") + elseif _u7c7b_u522bB == _u7c7b then + _u6253_u5370("对象 B") + end + end + end + if not _match_2 then + local _match_3 = false + if _tab_0 then + local _u8868 = getmetatable(_u7269) + if _u8868 ~= nil then + _match_3 = true + _u6253_u5370("带有元表的表") + end + end + if not _match_3 then + _u6253_u5370("物品不被接受!") + end + end + end + end + end + end + end +end +do + local _u8868_u683c = { } + do + local _type_0 = type(_u8868_u683c) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + local _u53d8_u91cfa = _u8868_u683c["变量a"] + local _u53d8_u91cfb = _u8868_u683c["变量b"] + if _u53d8_u91cfa == nil then + _u53d8_u91cfa = 1 + end + if _u53d8_u91cfb == nil then + _u53d8_u91cfb = 2 + end + _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) + end + end + do + local _type_0 = type(_u8868_u683c) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + local _u53d8_u91cfa = _u8868_u683c["变量a"] + local _u53d8_u91cfb = _u8868_u683c["变量b"] + if _u53d8_u91cfb == nil then + _u53d8_u91cfb = 2 + end + if _u53d8_u91cfa ~= nil then + _u6253_u5370("部分匹配", _u53d8_u91cfa, _u53d8_u91cfb) + end + end + end + do + local _type_0 = type(_u8868_u683c) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + local _match_0 = false + if _tab_0 then + local _u53d8_u91cfa = _u8868_u683c["变量a"] + local _u53d8_u91cfb = _u8868_u683c["变量b"] + if _u53d8_u91cfa ~= nil and _u53d8_u91cfb ~= nil then + _match_0 = true + _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) + end + end + if not _match_0 then + _u6253_u5370("没有匹配") + end + end +end +do + local _u8868_u683c = { + ["变量x"] = "abc" + } + do + local _type_0 = type(_u8868_u683c) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + local _match_0 = false + if _tab_0 then + local _u53d8_u91cfx = _u8868_u683c["变量x"] + local _u53d8_u91cfy = _u8868_u683c["变量y"] + if _u53d8_u91cfx ~= nil and _u53d8_u91cfy ~= nil then + _match_0 = true + _u6253_u5370("变量x: " .. tostring(_u53d8_u91cfx) .. " 和 变量y: " .. tostring(_u53d8_u91cfy)) + end + end + if not _match_0 then + if _tab_0 then + local _u53d8_u91cfx = _u8868_u683c["变量x"] + if _u53d8_u91cfx ~= nil then + _u6253_u5370("只有 变量x: " .. tostring(_u53d8_u91cfx)) + end + end + end + end +end +do + local _u5339_u914d + do + local _exp_0 = _u8868_u683c + if 1 == _exp_0 then + _u5339_u914d = "1" + else + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + local _match_0 = false + if _tab_0 then + local _u53d8_u91cfx = _exp_0["变量x"] + if _u53d8_u91cfx ~= nil then + _match_0 = true + _u5339_u914d = _u53d8_u91cfx + end + end + if not _match_0 then + if false == _exp_0 then + _u5339_u914d = "false" + else + _u5339_u914d = nil + end + end + end + end +end +do + local _exp_0 = _u8868_u683c + if nil == _exp_0 then + return "无效" + else + do + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + local _match_0 = false + if _tab_0 then + local _u53d8_u91cfa = _exp_0["变量a"] + local _u53d8_u91cfb = _exp_0["变量b"] + if _u53d8_u91cfa ~= nil and _u53d8_u91cfb ~= nil then + _match_0 = true + return tostring(_u53d8_u91cfa + _u53d8_u91cfb) + end + end + if not _match_0 then + if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 or 4 == _exp_0 or 5 == _exp_0 then + return "数字 1 - 5" + else + local _match_1 = false + if _tab_0 then + local _u5339_u914d_u4efb_u4f55_u8868_u683c = _exp_0["匹配任何表格"] + if _u5339_u914d_u4efb_u4f55_u8868_u683c == nil then + _u5339_u914d_u4efb_u4f55_u8868_u683c = "后备" + end + _match_1 = true + return _u5339_u914d_u4efb_u4f55_u8868_u683c + end + if not _match_1 then + return "除非它不是一个表格,否则不应到达这里" + end + end + end + end + end +end +do + do + local _exp_0 = _u53d8_u91cfy + local _type_0 = type(_exp_0) + local _tab_0 = "table" == _type_0 or "userdata" == _type_0 + if _tab_0 then + local _u8868 = (function() + local _obj_0 = _exp_0["变量x"] + if _obj_0 ~= nil then + return getmetatable(_obj_0) + end + return nil + end)() + if _u8868 ~= nil then + _u6253_u5370(_u8868) + end + end + end +end +return nil diff --git a/spec/outputs/unicode/syntax.lua b/spec/outputs/unicode/syntax.lua new file mode 100644 index 0000000..664fa46 --- /dev/null +++ b/spec/outputs/unicode/syntax.lua @@ -0,0 +1,431 @@ +local _u53d8_u91cfa = 1 + 2 * 3 / 6 +local _u4e00_u5806, _u53bb, _u8fd9_u91cc +_u53d8_u91cfa, _u4e00_u5806, _u53bb, _u8fd9_u91cc = _u53e6_u5916, _u4e16_u754c, nil, nil +_u51fd_u6570(_u53c2_u65701, _u53c2_u65702, _u53e6_u5916, _u53c2_u65703) +local _u6211_u4eec +_u8fd9_u91cc, _u6211_u4eec = function() end, _u662f_u7684 +local _u8fd9_u4e2a, _u4e0d_u540c +_u8fd9_u4e2a, _u4e0d_u540c = function() + return _u65b9_u6cd5 +end, _u662f_u7684 +_u7238_u7238() +_u7238_u7238(_u4e3b) +_u4f60_u597d(_u4e00, _u4e8c)(); +(5 + 5)(_u4e16_u754c) +_u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb) +_u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb) +_u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb, _u574f(_u4f60_u597d)) +_u4f60_u597d(_u4e16_u754c(_u4f60_u5728_u8fd9_u91cc_u505a_u4ec0_u4e48)) +_u4ec0_u4e48(_u8fd9_u4e2a)[3243](_u4e16_u754c, _u54ce_u5440) +_u6bdb_u8338_u8338[_u624b][_u662f](_u6076_u5fc3)(_u597d_u7684(_u597d_u7684[_u4e16_u754c])) +local _ = (_u5f97_u5230[_u67d0_u4e8b] + 5)[_u5e74] +local _u53d8_u91cfi, _u53d8_u91cfx = 200, 300 +local _u662f_u7684 = (1 + 5) * 3 +_u662f_u7684 = ((1 + 5) * 3) / 2 +_u662f_u7684 = ((1 + 5) * 3) / 2 + _u53d8_u91cfi % 100 +local _u54c7 = (1 + 2) * (3 + 4) * (4 + 5) +_ = function() + if _u67d0_u4e8b then + return 1, 2, 4 + end + return _u6253_u5370("你好") +end +_ = function() + if _u4f60_u597d then + return "你好", "世界" + else + return _u4e0d, _u65b9_u6cd5 + end +end +_ = function() + return 1, 2, 34 +end +return 5 + function() + return 4 + 2 +end +return 5 + (function() + return 4 +end) + 2 +_u6253_u5370(5 + function() + _ = 34 + return _u597d(_u7403) +end) +_u67d0_u4e8b('其他', "是") +_u67d0_u4e8b('其他') +_u67d0_u4e8b("其他") +_ = _u67d0_u4e8b([[嘿]]) * 2 +_ = _u67d0_u4e8b([======[嘿]======]) * 2 +_ = _u67d0_u4e8b[ [======[嘿]======]] * 2 +_, _ = _u67d0_u4e8b('其他'), 2 +_, _ = _u67d0_u4e8b("其他"), 2 +_, _ = _u67d0_u4e8b([[其他]]), 2 +_, _ = _u67d0_u4e8b[ [[其他]]], 2 +_u67d0_u4e8b('其他', 2) +_u67d0_u4e8b("其他", 2) +_u67d0_u4e8b([[其他]], 2) +_ = _u8fd9_u91cc(_u6211_u4eec)("去")[12123] +local _call_0 = _u5206_u88c2("abc xyz 123") +local _call_1 = _call_0["映射"](_call_0, "#") +_call_1["打印全部"](_call_1) +_ = f("")[_u53d8_u91cfa] +local _call_2 = f("") +_ = _call_2["变量b"](_call_2) +_ = f("")["变量c"]() +f(("")[_u53d8_u91cfa]) +f((function() + local _call_3 = ("") + return _call_3["变量b"](_call_3) +end)()) +f(("")["变量c"]()) +local _call_3 = _u5217_u8868({ + "abc", + "xyz", + "123" +}) +local _call_4 = _call_3["映射"](_call_3, "#") +_call_4["打印全部"](_call_4) +_ = f({ })[_u53d8_u91cfa] +local _call_5 = f({ }) +_ = _call_5["变量b"](_call_5) +_ = f({ })["变量c"]() +local _u67d0_u4e8b = { + ["测试"] = 12323, + ["什么"] = function() + return _u6253_u5370("你好 世界") + end +} +_u6253_u5370(_u67d0_u4e8b["测试"]) +local _u5929_u54ea = { + ["你好"] = "世界" +} +local _u6c29 = { + ["数字"] = 100, + ["世界"] = function(_u81ea_u5df1) + _u6253_u5370(_u81ea_u5df1["数字"]) + return { + ["某事"] = function() + return _u6253_u5370("嗨 从某事") + end + } + end, + ["某事"] = function(_u81ea_u5df1, _u5b57_u7b26_u4e32) + _u6253_u5370("字符串是", _u5b57_u7b26_u4e32) + return { + ["世界"] = function(_u53d8_u91cfa, _u53d8_u91cfb) + return _u6253_u5370("总和", _u53d8_u91cfa + _u53d8_u91cfb) + end + } + end +} +_u67d0_u4e8b["什么"]() +_u6c29["世界"](_u6c29)["某事"]() +_u6c29["某事"](_u6c29, "200")["世界"](1, 2) +_u53d8_u91cfx = -434 +_u53d8_u91cfx = -_u4f60_u597d(_u4e16_u754c(_u4e00(_u4e8c))) +local _u55e8 = -"herfef" +_u53d8_u91cfx = -(function() + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfx in _u53d8_u91cfx do + _accum_0[_len_0] = _u53d8_u91cfx + _len_0 = _len_0 + 1 + end + return _accum_0 +end)() +if _u9177 then + _u6253_u5370("你好") +end +if not _u9177 then + _u6253_u5370("你好") +end +if not (1212 and 3434) then + _u6253_u5370("你好") +end +for i = 1, 10 do + _u6253_u5370("你好") +end +_u6253_u5370("疯子") +if _u4f60_u597d then + _ = 343 +end +if _u9177 then + _u6253_u5370("什么") +end +while not (function() + local _call_6 = _u9605_u8bfb_u8005 + return _call_6["结束"](_call_6) + end)() do + local _call_6 = _u9605_u8bfb_u8005 + _call_6["解析_行"](_call_6) +end +while not (function() + local _call_6 = _u9605_u8bfb_u8005 + return _call_6["结束"](_call_6) + end)() do + local _call_6 = _u9605_u8bfb_u8005 + _call_6["解析_行"](_call_6) +end +(function(...) + local _u53c2_u6570 = { + ... + } +end)() +_u53d8_u91cfx = function(...) + return dump({ + ... + }) +end +_u53d8_u91cfx = not true +local _u53d8_u91cfy = not (5 + 5) +_u53d8_u91cfy = #"你好" +_u53d8_u91cfx = #{ + #{ }, + #{ + 1 + }, + #{ + 1, + 2 + } +} +_, _ = _u4f60_u597d, _u4e16_u754c +_u67d0_u4e8b["你好"](_u67d0_u4e8b, _u4ec0_u4e48)(_u53d8_u91cfa, _u53d8_u91cfb) +_u67d0_u4e8b["你好"](_u67d0_u4e8b, _u4ec0_u4e48) +local _call_6 = _u67d0_u4e8b["你好"] +_call_6["世界"](_call_6, _u53d8_u91cfa, _u53d8_u91cfb) +local _call_7 = _u67d0_u4e8b["你好"] +_call_7["世界"](_call_7, 1, 2, 3)(_u53d8_u91cfa, _u53d8_u91cfb) +_u53d8_u91cfx = 1232 +_u53d8_u91cfx = _u53d8_u91cfx + (10 + 3) +local _u53d8_u91cfj = _u53d8_u91cfj - "你好" +_u53d8_u91cfy = _u53d8_u91cfy * 2 +_u53d8_u91cfy = _u53d8_u91cfy / 100 +_u53d8_u91cfy = _u53d8_u91cfy // 100 +local _u53d8_u91cfm = _u53d8_u91cfm % 2 +local _u4f60_u597d = _u4f60_u597d .. "世界" +self.__class["某事"] = self.__class["某事"] + 10 +self["某事"] = self["某事"] + 10 +local _update_0 = "你好" +_u53d8_u91cfa[_update_0] = _u53d8_u91cfa[_update_0] + 10 +local _update_1 = "你好" .. tostring(tostring(ff)) +_u53d8_u91cfa[_update_1] = _u53d8_u91cfa[_update_1] + 10 +local _obj_0 = _u53d8_u91cfa[_u56db] +_obj_0["字段x"] = _obj_0["字段x"] + 10 +_u53d8_u91cfa["变量b"] = _u53d8_u91cfa["变量b"] + 1 +local _obj_1 = _u53d8_u91cfa["变量b"][1]["变量c"] +local _update_2 = 2 + 3 +_obj_1[_update_2] = _obj_1[_update_2] + 1 +do + local _with_0 = _u8868 + local _obj_2 = _with_0["字段a"] + _obj_2["变量c"] = _obj_2["变量c"] + 1 +end +do + local _obj_2 = _u8868 + _obj_2[#_obj_2 + 1] = 10 +end +do + local _obj_2 = _u53d8_u91cfa["变量b"]["变量c"] + _obj_2[#_obj_2 + 1] = 1 +end +if _u6761_u4ef6v then + _u53d8_u91cfx[#_u53d8_u91cfx + 1] = 1 +else + _u53d8_u91cfx[#_u53d8_u91cfx + 1] = 2 +end +do + local _with_0 = _u8868 + do + local _obj_2 = _with_0["变量b"]["变量c"] + do + local _with_1 = _u5411_u91cf + _with_1["字段x"] = 1 + _with_1["字段y"] = 2 + _obj_2[#_obj_2 + 1] = _with_1 + end + end +end +do + local _call_8 = _u5bf9_u8c61a["变量b"]["变量c"]["变量d"] + local _obj_2 = _call_8["函数"](_call_8)["变量g"] + _obj_2[#_obj_2 + 1] = 1 +end +local _u8868 = { } +_u8868[#_u8868 + 1] = 1 +_u8868[#_u8868 + 1] = 2 +_u8868[#_u8868 + 1] = 3 +_u53d8_u91cfx = 0 +local _list_0 = _u503c +for _index_0 = 1, #_list_0 do + local _u53d8_u91cfv = _list_0[_index_0] + if ntype(_u53d8_u91cfv) == "函数定义" then + _ = _u53d8_u91cfx + 1 + end +end +_u4f60_u597d = { + ["某物"] = _u4e16_u754c, + ["如果"] = "你好", + ["否则"] = 3434, + ["函数"] = "好的", + ["好的"] = 230203 +} +_u8868 = { + ["执行"] = _u53d8_u91cfb, + _u6267_u884c({ + ["变量b"] = _u53d8_u91cfb + }) +} +div({ + ["类"] = "酷" +}) +_ = 5 + _u4ec0_u4e48(_u65e0_u804a) +_u4ec0_u4e48(_u65e0_u804a + 5) +_ = 5 - _u4ec0_u4e48(_u65e0_u804a) +_u4ec0_u4e48(_u65e0_u804a - 5) +_u53d8_u91cfx = _u4f60_u597d - _u4e16_u754c - _u67d0_u7269; +(function(_u67d0_u7269) + if _u67d0_u7269 == nil then + _u67d0_u7269 = _u4e0e((function() + local _call_8 = _u4ec0_u4e48 + return _call_8["酷"](_call_8, 100) + end)()) + end + return _u6253_u5370(_u67d0_u7269) +end)() +if _u67d0_u7269 then + _ = 03589 +else + _ = 3434 +end +if _u67d0_u7269 then + _ = _u662f_u7684 +elseif "嗯嗯嗯" then + _u6253_u5370("酷") +else + _ = _u597d_u7684 +end +_u53d8_u91cfx = _u4e0d_u662f_u67d0_u7269 +_u53d8_u91cfy = _u5982_u679c_u67d0_u7269 +local _u53d8_u91cfz = _u53d8_u91cfx(_u4e0e(_u53d8_u91cfb)) +_u53d8_u91cfz = _u53d8_u91cfx(_u4e0eb) +while 10 > _u67d0_u7269({ + ["某物"] = "世界" + }) do + _u6253_u5370("是的") +end +_u53d8_u91cfx = { + ["好的"] = _u786e_u5b9a +} +_u662f_u7684({ + ["好的"] = _u7537_u4eba, + ["确定"] = _u5148_u751f +}) +_u4f60_u597d("无逗号", { + ["是的"] = _u7238_u7238, + ["另一个"] = _u4e16_u754c +}) +_u4f60_u597d("逗号", { + ["某物"] = _u4f60_u597d__u4e16_u754c, + ["骂人"] = _u4f60 +}) +_u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { + ["是的"] = _u7537_u4eba, + ["好的"] = _u662f_u7684, + ["好"] = _u597d_u7684 +}) +_u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { + ["是的"] = _u7537_u4eba, + ["好的"] = _u662f_u7684, + { + ["好"] = _u597d_u7684, + ["好的"] = 1 + }, + { + ["好"] = _u597d_u7684, + ["好的"] = 2 + } +}) +_u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { + ["是的"] = _u7537_u4eba, + ["好的"] = _u662f_u7684 +}) +_u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { + ["是的"] = _u7537_u4eba({ + ["好的"] = _u662f_u7684 + }) +}) +_u963f_u8d3e_u514b_u65af(_u5730_u5740, function(_u6570_u636e) + return _u5904_u7406(_u6570_u636e) +end, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) +end) +_u53d8_u91cfa = _u53d8_u91cfa + (3 - 5) +_u53d8_u91cfa = _u53d8_u91cfa * (3 + 5) +_u53d8_u91cfa = _u53d8_u91cfa * 3 +_u53d8_u91cfa = _u53d8_u91cfa >> 3 +_u53d8_u91cfa = _u53d8_u91cfa << 3 +_u53d8_u91cfa = _u53d8_u91cfa / _u51fd_u6570("酷") +_u53d8_u91cfx["然后"] = "你好" +_u53d8_u91cfx["当"]["真"] = "你好" +_u53d8_u91cfx["当"]["真"] = "你好" +_u53d8_u91cfx = _u53d8_u91cfx or "你好" +_u53d8_u91cfx = _u53d8_u91cfx and "你好" +_u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb +_u53d8_u91cfz = _u53d8_u91cfa(-_u53d8_u91cfb) +_u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb +_u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb +local _u5b57_u7b26_u4e32 = _u5b57_u7b26_u4e32A .. _u5b57_u7b26_u4e32B .. _u5b57_u7b26_u4e32C +_u51fd_u6570(3000, "192.168.1.1") +local f +f = function() + return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff +end +f = function() + return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff +end +do + local _with_0 = _u5bf9_u8c61 + _u8c03_u7528(_with_0["函数"](_with_0), 123, "abc") +end +_u8c03_u7528A(_u8c03_u7528B(_u8c03_u7528C(123))) +_u8c03_u7528A(_u8c03_u7528B(_u8c03_u7528C(123))) +local _u53d8_u91cfv = { + _u53d8_u91cfa(-1), + _u53d8_u91cfa(-1), + _u53d8_u91cfa - 1, + _u53d8_u91cfa - 1, + _u53d8_u91cfa - 1, + _u53d8_u91cfa - 1, + _u53d8_u91cfa - 1, + _u53d8_u91cfa - 1, + _u53d8_u91cfa(~1), + _u53d8_u91cfa(~1), + _u53d8_u91cfa ~ 1, + _u53d8_u91cfa ~ 1, + _u53d8_u91cfa ~ 1, + _u53d8_u91cfa ~ 1, + _u53d8_u91cfa ~ 1, + _u53d8_u91cfa ~ 1 +} +do + _u53d8_u91cfa = 1 + 2 * 3 / 4 + local _u53d8_u91cf_1 = f1(-1 + 2 + 3) + local _u53d8_u91cf_2 = f1 - 1 + 2 + 3 + local f2 + f2 = function(_u53d8_u91cfx) + return _u6253_u5370(_u53d8_u91cfx + 1) + end + _u53d8_u91cfa = f2() + f2(-1) + _u53d8_u91cfa = f2() - f2(1) + local _u53d8_u91cf_3, _u53d8_u91cf_4 + _u53d8_u91cf_1, _u53d8_u91cf_2, _u53d8_u91cf_3, _u53d8_u91cf_4 = 1, f(2, 3, f(4, 4)) +end +do + f = function(_u53d8_u91cfa, _u53d8_u91cfb) + return _u53d8_u91cfa + _u53d8_u91cfb + end + f(_u53d8_u91cfa, _u53d8_u91cfb) + f() +end +return nil diff --git a/spec/outputs/unicode/tables.lua b/spec/outputs/unicode/tables.lua new file mode 100644 index 0000000..28ad6e2 --- /dev/null +++ b/spec/outputs/unicode/tables.lua @@ -0,0 +1,594 @@ +local _u80cc_u5305 = { + ["东西"] = { + ["是的"] = 200, + ["他们"] = function() + print("你好") + return _u4f60_u7684_u811a("小") + end, + ["美丽"] = _u5934_u53d1_u53d8_u91cf, + ["金"] = _u55ef_u53d8_u91cf + }, + ["您"] = 1000, + ["吃"] = goo_u53d8_u91cf, + ["是的"] = dudd_u53d8_u91cf +} +local _u5f00_u59cb = { + ["东西"] = "冷" +} +local _u6d74 = { + ["开"] = "火" +} +local _u53e6_u4e00_u4e2a = { + [4] = 232, + ["好食物"] = "是最好的" +} +local fwip_u53d8_u91cf = { + ["东西"] = _u4f60_u597d("什么"), + ["数字"] = 2323, + ["什么"] = yo_u53d8_u91cf("妈妈", "是的"), + ["水果"] = basket_u53d8_u91cf, + ["坚果"] = day_u53d8_u91cf +} +local frick_u53d8_u91cf = { + ["你好"] = "世界" +} +local frack_u53d8_u91cf, _u6700_u597d = { + ["你好"] = "世界", + ["米饭"] = 3434 +}, "什么" +local ya_u53d8_u91cf = { + 1, + 2, + 3, + ["键"] = 100, + 343, + "你好", + ["嗯"] = 232 +} +local x_u53d8_u91cf = { + 1, + 2, + 4343, + 343, + 343 +} +local g_u53d8_u91cf, p_u53d8_u91cf = { + 1, + 2, + ["nowy变量"] = "是", + 3, + 4, + ["嘿"] = 232, + ["另一个"] = "天" +}, 234 +local annother_u53d8_u91cf = { + 1, + 2, + 3, + 3, + 4, + 5, + 6, + 7, + 8 +} +local _u662f_u7684_u53d8_u91cf = { + [232] = 3434, + "你好", + ["冰"] = "蛋糕" +} +local whatabout_u53d8_u91cf = { + _u4f60_u597d(_u4e16_u754c, _u53e6_u4e00_u4e2a_u53d8_u91cf), + _u4ec0_u4e48, + _u5173_u4e8e, + _u73b0_u5728, + _u4f60_u597d("世界"), + _u662f_u7684_u53d8_u91cf, + _u4f60_u597d("世界", _u662f_u7684_u53d8_u91cf) +} +x_u53d8_u91cf = { + ["东西"] = function(self) + return "你好" + end, + ["酷"] = { + ["床"] = { + 2323, + 2323 + }, + ["红"] = 2343 + }, + ["名字"] = function(self, node_u53d8_u91cf) + return self:value(node_u53d8_u91cf) + end +} +x_u53d8_u91cf = { + ["东西"] = _u4e1c_u897f, + ["东西"] = _u4e1c_u897f_u53d8_u91cf +} +local y_u53d8_u91cf = { + ["你好"] = _u4f60_u597d, + ["那里"] = _u90a3_u91cc, + ["怎么样"] = _u600e_u4e48_u6837, + ["你"] = _u4f60, + ["事情"] = _u4e8b_u60c5 +} +_u7535_u8bdd_u6211("你好", { + ["x变量"] = x_u53d8_u91cf, + ["y变量"] = y_u53d8_u91cf, + ["z变量"] = z_u53d8_u91cf +}) +local t_u53d8_u91cf = { + ["a变量"] = 'a', + [b_u53d8_u91cf] = 'b' +} +local xam_u53d8_u91cf = { + ["你好"] = 1234, + ["你好"] = 12354, + [ [[你好变量]]] = 12354, + ["你好"] = 12354, + [ [[你好变量]]] = 12354 +} +local kam_u53d8_u91cf = { + ["你好"] = 12, + ["好奶酪"] = "嗯", + ["是的"] = 12 + 232, + ["让我们"] = keepit({ + ["继续"] = _u771f_u7684, + ["好的"] = "是的" + }), + ["更多"] = { + 1, + (function() + local _accum_0 = { } + local _len_0 = 1 + for x_u53d8_u91cf = 1, 10 do + _accum_0[_len_0] = x_u53d8_u91cf + _len_0 = _len_0 + 1 + end + return _accum_0 + end)() + }, + [{ + "一个", + "两个" + }] = _u4e00_u4ef6_u4e8b_u60c5(function(self) end) +} +keepit({ + ["继续"] = _u771f_u7684, + ["好的"] = "是的", + ["workd变量"] = "好的" +}) +_u4e8b_u60c5({ + ["什么"] = "伟大", + ["没有"] = "更多", + ["好的"] = 123 +}) +_u4e8b_u60c5({ + ["什么"] = "伟大", + ["没有"] = "更多" +}) +local __u53d8_u91cf = { + ["好的"] = 123 +} +local k_u53d8_u91cf = { + ["你好"] = "世界" +} +k_u53d8_u91cf = { + ['你好'] = '世界' +} +k_u53d8_u91cf = { + ["你好"] = '世界', + ["帽子"] = "zat变量" +} +_u8bf7({ + ["你好"] = "世界" +}) +k_u53d8_u91cf = { + ["你好"] = "世界", + ["一个"] = "区域" +} +local f1_u53d8_u91cf, f2_u53d8_u91cf, f3_u53d8_u91cf = "一个", { + ["两个"] = three_u53d8_u91cf +}, "四" +f1_u53d8_u91cf, f2_u53d8_u91cf = { + ["两个"] = three_u53d8_u91cf +}, "四" +f1_u53d8_u91cf = { + "一个", + ["两个"] = three_u53d8_u91cf, + "四" +} +local j1_u53d8_u91cf, j2_u53d8_u91cf, j3_u53d8_u91cf, j4_u53d8_u91cf = "一个", { + ["两个"] = three_u53d8_u91cf, + ["四"] = five_u53d8_u91cf +}, 6, 7 +local _u5973_u82f1_u96c4 = { + ["名字"] = "克里斯蒂娜", + ["年龄"] = 18, + ["工作"] = "公主", + ["喜欢"] = { + { + ["名字"] = "小猫", + ["img变量"] = "/image/kittens.png" + }, + { + ["名字"] = "花", + ["img变量"] = "/image/flower.png" + } + }, + ["物品"] = { + { + ["名字"] = "戒指", + ["数量"] = 2 + }, + { + ["名字"] = "项链", + ["数量"] = 1 + } + }, + ["状态"] = { + ["desc变量"] = "弱", + { + ["属性"] = "健康", + ["价值"] = 50 + }, + { + ["属性"] = "魔法", + ["价值"] = 100 + } + } +} +local _u5e93_u5b58 = { + ["设备"] = { + "剑", + "盾" + }, + ["物品"] = { + { + ["名字"] = "药水", + ["计数"] = 10 + }, + { + ["名字"] = "面包", + ["计数"] = 3 + } + } +} +local _u7269_u54c1 = { + _u51fd_u6570(), + (function() + local _with_0 = _u53d8_u91cftb + _with_0.abc = 123 + return _with_0 + end)(), + { + 1, + 2, + 3 + }, + _u51fd_u6570({ + 1, + 2, + 3 + }), + _u51fd_u6570({ + 1, + 2, + 3 + }), + (function() + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfi = 1, 3 do + _accum_0[_len_0] = _u53d8_u91cfi + _len_0 = _len_0 + 1 + end + return _accum_0 + end)(), + tostring((function() + if _u53d8_u91cfa then + return _u53d8_u91cfb + end + end)()) +} +local _u53cc_u9879 = { + { + "国王", + "王后" + }, + { + "英雄", + "公主" + } +} +_u7269_u54c1 = { + { + ["名称"] = "戒指", + ["数量"] = 2 + }, + { + ["名称"] = "项链", + ["数量"] = 1 + } +} +local _u83dc_u5355 = { + { + ["文本"] = "保存", + ["子菜单"] = { + { + ["文本"] = "插槽1:" .. (_u63d2_u69fd[1]["名称"] or "无"), + ["点击"] = function() end + }, + { + ["文本"] = { + "插槽2" + }, + ["点击"] = function() end + }, + { + ["文本"] = [[插槽3]], + ["点击"] = function() end + }, + { + ["文本"] = (function() + local _call_0 = ("插槽4") + return _call_0["名称"](_call_0) + end)(), + ["点击"] = function() end + }, + { + ["文本"] = (function() + local _call_0 = ({ + { + "插槽5" + } + })[1] + return _call_0["名称"](_call_0) + end)(), + ["点击"] = function() end + }, + [6] = { + ["文本"] = ("插槽6"), + ["点击"] = function() end + } + } + } +} +local _u53d8_u91cftb +do + local _tab_0 = { } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u5176_u4ed6) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _u53d8_u91cftb = _tab_0 +end +local tb_u6df7_u5408 +do + local _tab_0 = { + 1, + 2, + 3 + } + local _obj_0 + _u7269_u54c1.x = 1 + _u7269_u54c1["函数"](_u7269_u54c1) + _obj_0 = _u7269_u54c1 + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_obj_0) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0[#_tab_0 + 1] = "a" + _tab_0[#_tab_0 + 1] = "b" + _tab_0[#_tab_0 + 1] = "c" + local _obj_1 + do + local _obj_2 = _u51fd_u6570 + if _obj_2 ~= nil then + _obj_1 = _obj_2() + end + end + local _idx_1 = 1 + for _key_0, _value_0 in pairs(_obj_1) do + if _idx_1 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_1 = _idx_1 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0["键"] = "值" + for _index_0 = 1, select('#', ...) do + _tab_0[#_tab_0 + 1] = select(_index_0, ...) + end + tb_u6df7_u5408 = _tab_0 +end +local tb_u6df7_u5408A +do + local _tab_0 = { } + local _obj_0 + do + local _accum_0 = { } + local _len_0 = 1 + for _u53d8_u91cfi = 1, 10 do + _accum_0[_len_0] = _u53d8_u91cfi + _len_0 = _len_0 + 1 + end + _obj_0 = _accum_0 + end + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_obj_0) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0[#_tab_0 + 1] = 11 + tb_u6df7_u5408A = _tab_0 +end +local tb_u6df7_u5408B +do + local _tab_0 = { } + local _obj_0 = ... + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_obj_0) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + local _obj_1 = { + ... + } + local _idx_1 = 1 + for _key_0, _value_0 in pairs(_obj_1) do + if _idx_1 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_1 = _idx_1 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + local _obj_2 + do + local _tab_1 = { } + local _obj_3 = ... + local _idx_2 = 1 + for _key_0, _value_0 in pairs(_obj_3) do + if _idx_2 == _key_0 then + _tab_1[#_tab_1 + 1] = _value_0 + _idx_2 = _idx_2 + 1 + else + _tab_1[_key_0] = _value_0 + end + end + _obj_2 = _tab_1 + end + local _idx_2 = 1 + for _key_0, _value_0 in pairs(_obj_2) do + if _idx_2 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_2 = _idx_2 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0[#_tab_0 + 1] = 1 + _tab_0[#_tab_0 + 1] = 2 + _tab_0[#_tab_0 + 1] = 3 + tb_u6df7_u5408B = _tab_0 +end +local _u6a21_u677f = { + foo = "你好", + bar = "世界", + baz = "!" +} +local _u4e13_u95e8_u5316 = (function() + local _tab_0 = { } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u6a21_u677f) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0.bar = "鲍勃" + return _tab_0 +end)() +local _u4e13_u95e8_u5316B +do + local _tab_0 = { + ["函数"] = function() end + } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u6a21_u677f) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0["结束"] = function() end + _tab_0["如果"] = true + _tab_0["否则"] = false + _u4e13_u95e8_u5316B = _tab_0 +end +local _u90e8_u5206 = { + "肩膀", + "膝盖" +} +local _u6b4c_u8bcd +do + local _tab_0 = { + "头" + } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u90e8_u5206) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0[#_tab_0 + 1] = "和" + _tab_0[#_tab_0 + 1] = "脚趾" + _u6b4c_u8bcd = _tab_0 +end +local tb_u5757 = { + ["子菜单"] = (function(...) + local _tab_0 = { + ["值"] = _u503c + } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u7269_u54c1) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + for _index_0 = 1, select('#', ...) do + _tab_0[#_tab_0 + 1] = select(_index_0, ...) + end + return _tab_0 + end)(...) +} +_u51fd_u6570((function(...) + local _tab_0 = { } + local _idx_0 = 1 + for _key_0, _value_0 in pairs(_u7269_u54c1) do + if _idx_0 == _key_0 then + _tab_0[#_tab_0 + 1] = _value_0 + _idx_0 = _idx_0 + 1 + else + _tab_0[_key_0] = _value_0 + end + end + _tab_0["值"] = _u503c + _tab_0[#_tab_0 + 1] = ... + _tab_0.k = _u53d8_u91cfv + for _index_0 = 1, select('#', ...) do + _tab_0[#_tab_0 + 1] = select(_index_0, ...) + end + return _tab_0 +end)(...)) +return nil diff --git a/spec/outputs/unicode/try_catch.lua b/spec/outputs/unicode/try_catch.lua new file mode 100644 index 0000000..fde63d6 --- /dev/null +++ b/spec/outputs/unicode/try_catch.lua @@ -0,0 +1,61 @@ +xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) +end, 1, 2, 3) +xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) +end, 1, 2, 3) +pcall(function() + _u6253_u5370("正在try") + return _u51fd_u6570(1, 2, 3) +end) +do + local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) + end, 1, 2, 3) + _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, 1, 2, 3) +end +pcall(_u8868["函数"]) +pcall(_u8868["函数"]) +pcall(_u8868["函数"]) +pcall((_u8868["函数"])) +pcall(((function() + local _base_0 = _u8868 + local _fn_0 = _base_0["函数"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end +end)()), 1, 2, 3) +pcall(_u8868["函数"], 1) +pcall(_u8868["函数"], 1) +if (xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) +end, 1)) then + _u6253_u5370("好的") +end +if xpcall((_u51fd_u6570), function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) +end, 1) then + _u6253_u5370("好的") +end +do + do + local _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, "abc", 123) + if _u6210_u529f then + _u6253_u5370(_u7ed3_u679c) + end + end + local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) + end, "abc", 123) + _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) + return _u6253_u5370(_u9519_u8bef) + end, "abc", 123) + if _u6210_u529f then + _u6253_u5370(_u7ed3_u679c) + end +end +do +pcall(_u51fd_u6570, 1, 2, 3) +pcall(_u51fd_u6570, 1, 2, 3) +end +return nil diff --git a/spec/outputs/unicode/unless_else.lua b/spec/outputs/unicode/unless_else.lua new file mode 100644 index 0000000..38b2e63 --- /dev/null +++ b/spec/outputs/unicode/unless_else.lua @@ -0,0 +1,7 @@ +if _u53d8_u91cfa then + if not _u53d8_u91cfb then + return _u6253_u5370("嗨") + elseif _u53d8_u91cfc then + return _u6253_u5370("不嗨") + end +end diff --git a/spec/outputs/unicode/using.lua b/spec/outputs/unicode/using.lua new file mode 100644 index 0000000..8b6bd1c --- /dev/null +++ b/spec/outputs/unicode/using.lua @@ -0,0 +1,30 @@ +local _u4f60_u597d = "你好" +local _u4e16_u754c = "世界" +local _ +_ = function() + local _u4f60_u597d = 3223 +end +_ = function(_u53c2_u6570a) + local _u4f60_u597d = 3223 + _u53c2_u6570a = 323 +end +_ = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) + _u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c = 1, 2, 3 + local _u4e16_u754c = 12321 +end +_ = function(_u53c2_u6570a, _u53c2_u6570e, _u53c2_u6570f) + local _u53c2_u6570b, _u53c2_u6570c + _u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c = 1, 2, 3 + local _u4f60_u597d = 12321 + local _u4e16_u754c = "yeah" +end +_ = function() + local _u4f60_u597d = _u4f60_u597d or 2 +end +do + local _u53d8_u91cfa = { } + _(function() + local _u5143_u7d20x, _u5143_u7d20y = _u53d8_u91cfa[1], _u53d8_u91cfa[2] + end) +end +return nil diff --git a/spec/outputs/unicode/vararg.lua b/spec/outputs/unicode/vararg.lua new file mode 100644 index 0000000..782bf22 --- /dev/null +++ b/spec/outputs/unicode/vararg.lua @@ -0,0 +1,301 @@ +local _u8fde_u63a5 +_u8fde_u63a5 = function(...) + _u5e26_u6709((function() + local _with_0 = _u53d8_u91cfa + _with_0["函数"](_with_0) + return _with_0 + end)()) + _u5e26_u6709((function(...) + local _with_0 = _u53d8_u91cfa + _with_0["函数"](_with_0, ...) + return _with_0 + end)(...)) + _u5217_u8868_u751f_u6210((function() + local _accum_0 = { } + local _len_0 = 1 + for i = 1, 10 do + _accum_0[_len_0] = _u9879_u76ee[i] + _len_0 = _len_0 + 1 + end + return _accum_0 + end)()) + _u5217_u8868_u751f_u6210((function(...) + local _accum_0 = { } + local _len_0 = 1 + for i = 1, 10 do + _accum_0[_len_0] = _u9879_u76ee[i](...) + _len_0 = _len_0 + 1 + end + return _accum_0 + end)(...)) + _u5217_u8868_u751f_u6210((function() + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u9879_u76ee + for _index_0 = 1, #_list_0 do + local _u7269_u54c1 = _list_0[_index_0] + _accum_0[_len_0] = _u7269_u54c1 + _len_0 = _len_0 + 1 + end + return _accum_0 + end)()) + _u5217_u8868_u751f_u6210((function(...) + local _accum_0 = { } + local _len_0 = 1 + local _list_0 = _u9879_u76ee + for _index_0 = 1, #_list_0 do + local _u7269_u54c1 = _list_0[_index_0] + _accum_0[_len_0] = _u7269_u54c1(...) + _len_0 = _len_0 + 1 + end + return _accum_0 + end)(...)) + _u7c7b_u751f_u6210((function() + local _u53d8_u91cfA + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "变量A" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _u51fd_u6570() + _u53d8_u91cfA = _class_0 + return _class_0 + end + end)()) + _u7c7b_u751f_u6210((function(...) + local _u53d8_u91cfA + do + local _class_0 + local _base_0 = { } + if _base_0.__index == nil then + _base_0.__index = _base_0 + end + _class_0 = setmetatable({ + __init = function() end, + __base = _base_0, + __name = "变量A" + }, { + __index = _base_0, + __call = function(cls, ...) + local _self_0 = setmetatable({ }, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + local self = _class_0; + _u51fd_u6570(...) + _u53d8_u91cfA = _class_0 + return _class_0 + end + end)(...)) + _u8868_u751f_u6210((function() + local _tbl_0 = { } + for _u952e, _u503c in pairs(_u8868) do + _tbl_0[_u952e] = _u503c + end + return _tbl_0 + end)()) + _u8868_u751f_u6210((function(...) + local _tbl_0 = { } + for _u952e, _u503c in pairs(_u8868) do + _tbl_0[_u952e] = _u503c(...) + end + return _tbl_0 + end)(...)) + _u8868_u751f_u6210((function() + local _tbl_0 = { } + local _list_0 = _u9879_u76ee + for _index_0 = 1, #_list_0 do + local _u7269_u54c1 = _list_0[_index_0] + _tbl_0[_u7269_u54c1] = true + end + return _tbl_0 + end)()) + _u8868_u751f_u6210((function(...) + local _tbl_0 = { } + local _list_0 = _u9879_u76ee + for _index_0 = 1, #_list_0 do + local _u7269_u54c1 = _list_0[_index_0] + _tbl_0[_u7269_u54c1(...)] = true + end + return _tbl_0 + end)(...)) + _u505a_u64cd_u4f5c((function() + return _u51fd_u6570() + end)()) + _u505a_u64cd_u4f5c((function(...) + return _u51fd_u6570(...) + end)(...)) + _u5f53_u64cd_u4f5c((function() + local _accum_0 = { } + local _len_0 = 1 + while false do + _accum_0[_len_0] = _u51fd_u6570() + _len_0 = _len_0 + 1 + end + return _accum_0 + end)()) + _u5f53_u64cd_u4f5c((function(...) + local _accum_0 = { } + local _len_0 = 1 + while false do + _accum_0[_len_0] = _u51fd_u6570(...) + _len_0 = _len_0 + 1 + end + return _accum_0 + end)(...)) + _u5982_u679c_u64cd_u4f5c((function() + if false then + return _u51fd_u6570() + end + end)()) + _u5982_u679c_u64cd_u4f5c((function(...) + if false then + return _u51fd_u6570(...) + end + end)(...)) + _u9664_u975e_u64cd_u4f5c((function() + if not true then + return _u51fd_u6570() + end + end)()) + _u9664_u975e_u64cd_u4f5c((function(...) + if not true then + return _u51fd_u6570(...) + end + end)(...)) + _u5207_u6362_u64cd_u4f5c((function() + local _exp_0 = _u53d8_u91cfx + if "abc" == _exp_0 then + return _u51fd_u6570() + end + end)()) + _u5207_u6362_u64cd_u4f5c((function(...) + local _exp_0 = _u53d8_u91cfx + if "abc" == _exp_0 then + return _u51fd_u6570(...) + end + end)(...)) + _u8868_u8fbe_u5f0f_u64cd_u4f5c((function() + local _obj_0 = _u51fd_u6570 + if _obj_0 ~= nil then + return _obj_0() + end + return nil + end)()) + _u8868_u8fbe_u5f0f_u64cd_u4f5c((function(...) + local _obj_0 = _u51fd_u6570 + if _obj_0 ~= nil then + return _obj_0(...) + end + return nil + end)(...)) + _u5192_u53f7((function() + local _base_0 = f() + local _fn_0 = _base_0["函数"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end)()) + _u5192_u53f7((function(...) + local _base_0 = f(...) + local _fn_0 = _base_0["函数"] + return _fn_0 and function(...) + return _fn_0(_base_0, ...) + end + end)(...)) + local _ + _ = function() + local _u5217_u8868 = { + 1, + 2, + 3, + 4, + 5 + } + local _u51fd_u6570_u540d + _u51fd_u6570_u540d = function(_u786e_u5b9a) + return _u786e_u5b9a, table.unpack(_u5217_u8868) + end + return (function(_arg_0, ...) + local _u786e_u5b9a = _arg_0 + _u6253_u5370(_u786e_u5b9a, ...) + local _u591a_u53c2_u6570_u51fd_u6570 + _u591a_u53c2_u6570_u51fd_u6570 = function() + return 10, nil, 20, nil, 30 + end + return (function(...) + _u6253_u5370(select("#", ...)) + return _u6253_u5370(...) + end)(_u591a_u53c2_u6570_u51fd_u6570()) + end)(_u51fd_u6570_u540d(true)) + end + do + (function(...) + return _u6253_u5370(...) + end)((function() + if true then + return 1, 2 + end + end)()) + end + do + (function(_arg_0, ...) + local _u53d8_u91cfa = _arg_0 + return _u6253_u5370(_u53d8_u91cfa, select('#', ...)) + end)((function() + if not true then + return 1, 2 + end + end)()) + end + do + (function(...) + return _u6253_u5370(...) + end)((function() + local _exp_0 = _u53d8_u91cfx + if 1 == _exp_0 then + local _with_0 = _u8868 + _with_0["变量x"] = 123 + return _with_0 + else + return _u88682 + end + end)()) + end + do + (function(...) + return _u6253_u5370(...) + end)(1, 2, (function() + if _u6761_u4ef6 then + return 3, 4, 5 + end + end)()) + end + do + (function(_arg_0, ...) + local _u8868 = _arg_0 + return _u6253_u5370(...) + end)({ + ["名字"] = "abc", + ["值"] = 123 + }) + end + return nil +end diff --git a/spec/outputs/unicode/whitespace.lua b/spec/outputs/unicode/whitespace.lua new file mode 100644 index 0000000..d026abb --- /dev/null +++ b/spec/outputs/unicode/whitespace.lua @@ -0,0 +1,98 @@ +local _ = { + 1, + 2 +} +_ = { + 1, + 2 +} +_ = { + 1, + 2 +} +_ = { + 1, + 2 +} +_ = { + 1, + 2 +} +_ = { + _u4e8b_u60c5(1, 2, 4, 5, 6), + 3, + 4, + 5 +} +_ = { + _u53d8_u91cfa(1, 2, 3), + 4, + 5, + 6, + 1, + 2, + 3 +} +_ = { + _u53d8_u91cfb(1, 2, 3, 4, 5, 6), + 1, + 2, + 3, + 1, + 2, + 3 +} +_ = { + 1, + 2, + 3 +} +_ = { + _u53d8_u91cfc(1, 2, 3) +} +_u4f60_u597d(1, 2, 3, 4, 1, 2, 3, 4, 4, 5) +_u53d8_u91cfx(1, 2, 3, 4, 5, 6) +_u4f60_u597d(1, 2, 3, _u4e16_u754c(4, 5, 6, 5, 6, 7, 8)) +_u4f60_u597d(1, 2, 3, _u4e16_u754c(4, 5, 6, 5, 6, 7, 8), 9, 9) +_ = { + _u4f60_u597d(1, 2), + 3, + 4, + 5, + 6 +} +local _u53d8_u91cfx = { + _u4f60_u597d(1, 2, 3, 4, 5, 6, 7), + 1, + 2, + 3, + 4 +} +if _u4f60_u597d(1, 2, 3, _u4e16_u754c, _u4e16_u754c) then + _u6253_u5370("你好") +end +if _u4f60_u597d(1, 2, 3, _u4e16_u754c, _u4e16_u754c) then + _u6253_u5370("你好") +end +_u53d8_u91cfa(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a) +_u53d8_u91cfb(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a) +_u53d8_u91cfc(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a, _u56db_u4e2a) +local v +v = function() + return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc +end +local v1, v2, v3 +v1, v2, v3 = function() + return _u53d8_u91cfa +end, _u53d8_u91cfb, _u53d8_u91cfc +local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff = 1, f2({ + abc = abc +}), 3, 4, _u51fd_u65705(abc), 6 +for _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc in pairs(_u5bf9_u8c61tb) do + _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc) +end +for i = 1, 10, -1 do + _u6253_u5370(i) +end +local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc +return nil diff --git a/spec/outputs/unicode/with.lua b/spec/outputs/unicode/with.lua new file mode 100644 index 0000000..0dcd4a7 --- /dev/null +++ b/spec/outputs/unicode/with.lua @@ -0,0 +1,222 @@ +do + local _u53d8_u91cfa + _u53d8_u91cfa = function() + local _with_0 = _u4e1c_u897f + _u6253_u5370(_with_0["你好"]) + _u6253_u5370(_u4f60_u597d) + _u6253_u5370("世界") + return _with_0 + end +end +do + do + local _with_0 = _u53f6_u5b50 + _with_0["世界"]() + _with_0["世界"](1, 2, 3) + local _u53d8_u91cfg = _with_0["什么"]["是"]["这"] + _with_0["你好"](1, 2, 3) + _with_0["你好"](_with_0, 1, 2)["世界"](2323) + _with_0["你好"](_with_0, "是的", "伙计") + _with_0["世界"] = 200 + end +end +do + local _u6ecb_u6ecb_u6ecb + do + local _with_0 = _u4e1c_u897f + _with_0["设置状态"]("你好 世界") + _u6ecb_u6ecb_u6ecb = _with_0 + end +end +do + local _u53d8_u91cfx = 5 + (function() + local _with_0 = _u67d0_u4e8b() + _with_0["写"](_with_0, "你好 世界") + return _with_0 + end)() +end +do + local _u53d8_u91cfx = { + ["你好"] = (function() + local _with_0 = _u597d_u7684 + _with_0["确定"](_with_0) + return _with_0 + end)() + } +end +do + do + local _with_0 = _u4e1c_u897f + local _ = _with_0["属性"](_with_0, "某物")["你好"] + local _call_0 = _with_0["属性"] + _call_0["发送"](_call_0, _u4e00_u4e2a) + local _call_1 = _with_0["属性"] + _call_1["发送"](_call_1, _u4e00_u4e2a) + end +end +do + do + local _with_0 = _u53d8_u91cfa + _u6253_u5370(_with_0["世界"]) + end + local _u6a21_u5757 + do + local __u6a21_u5757 = { } + __u6a21_u5757["事物"] = "你好" + _u6a21_u5757 = __u6a21_u5757 + end + do + local _u53d8_u91cfa, _u53d8_u91cfb = _u4e1c_u897f, _u5e03 + _u6253_u5370(_u53d8_u91cfa["世界"]) + end + local _u53d8_u91cfx + do + local _u53d8_u91cfa, _u53d8_u91cfb = 1, 2 + _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) + _u53d8_u91cfx = _u53d8_u91cfa + end + _u6253_u5370((function() + local _u53d8_u91cfa, _u53d8_u91cfb = 1, 2 + _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) + return _u53d8_u91cfa + end)()) + local p + do + local _with_0 = 1 + _u4f60_u597d()["字段x"], _u4e16_u754c()["字段y"] = _with_0, 2 + _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) + p = _with_0 + end +end +do + local _u53d8_u91cfx = "你好" + _u53d8_u91cfx["大写"](_u53d8_u91cfx) +end +do + do + local _u53d8_u91cfk = "乔" + _u6253_u5370(_u53d8_u91cfk["大写"](_u53d8_u91cfk)) + end +end +do + do + local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = "", "", "" + _u6253_u5370(_u53d8_u91cfa["大写"](_u53d8_u91cfa)) + end +end +do + local _u53d8_u91cfa = "床铺" + do + local _u53d8_u91cfb, _u53d8_u91cfc + _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = "", "", "" + _u6253_u5370(_u53d8_u91cfa["大写"](_u53d8_u91cfa)) + end +end +do + do + local _with_0 = _u53d8_u91cfj + _u6253_u5370(_with_0["大写"](_with_0)) + end +end +do + do + local _with_0 = "乔" + _u53d8_u91cfk["变量j"] = _with_0 + _u6253_u5370(_with_0["大写"](_with_0)) + end +end +do + do + local _with_0 = _u53d8_u91cfa + _u6253_u5370(_with_0.b) + do + local _with_1 = _with_0.c + _u6253_u5370(_with_1.d) + end + end +end +do + do + local _with_0 = _u53d8_u91cfa + do + local _with_1 = 2 + _with_0.b = _with_1 + _u6253_u5370(_with_1.c) + end + end +end +do + local _ + _ = function() + local _with_0 = _u55e8 + return _with_0.a, _with_0.b + end +end +do + do + local _with_0 = _u8868_u683c + local _call_0 = _u9879_u76ee["字段"] + _with_0.x = _call_0["函数"](_call_0, 123) + end +end +do + do + local _with_0 = _u7238_u7238 + _with_0["如果"]("是的") + local _u53d8_u91cfy = _with_0["结束"]["函数"] + end +end +do + do + local _with_0 = _u8868_u683c + do + local _obj_0 = _with_0[2] + if _obj_0 ~= nil then + _with_0[1] = _obj_0["函数"](_obj_0) + end + end + _with_0["%a-b-c%"] = 123 + _with_0[ [[x y z]]] = _with_0[_u53d8_u91cf] + _u6253_u5370(_with_0[_with_0[3]]) + do + local _with_1 = _with_0[4] + _with_1[1] = 1 + end + _with_0[#_with_0 + 1] = "abc" + _with_0[#_with_0 + 1] = { + ["类型"] = "你好", + { + ["名字"] = "xyz", + ["值"] = 998 + } + } + end +end +do + do + local _with_0 = _u5b9e_u5fc3_u77e9_u5f62({ + ["宽"] = w, + ["高"] = h, + ["颜色"] = 0x66000000 + }) + _u63a9_u7801 = _with_0 + if _with_0 ~= nil then + _with_0["触摸启用"] = true + _with_0["吞噬触摸"] = true + end + end +end +do + do + local _u63a9_u7801 = _u5b9e_u5fc3_u77e9_u5f62({ + ["宽"] = w, + ["高"] = h, + ["颜色"] = 0x66000000 + }) + if _u63a9_u7801 ~= nil then + _u63a9_u7801["触摸启用"] = true + _u63a9_u7801["吞噬触摸"] = true + end + end +end +return nil -- cgit v1.2.3-55-g6feb