diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
| commit | e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch) | |
| tree | 6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/outputs/unicode/vararg.lua | |
| parent | 289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff) | |
| download | yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2 yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip | |
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/outputs/unicode/vararg.lua')
| -rw-r--r-- | spec/outputs/unicode/vararg.lua | 301 |
1 files changed, 301 insertions, 0 deletions
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 @@ | |||
| 1 | local _u8fde_u63a5 | ||
| 2 | _u8fde_u63a5 = function(...) | ||
| 3 | _u5e26_u6709((function() | ||
| 4 | local _with_0 = _u53d8_u91cfa | ||
| 5 | _with_0["函数"](_with_0) | ||
| 6 | return _with_0 | ||
| 7 | end)()) | ||
| 8 | _u5e26_u6709((function(...) | ||
| 9 | local _with_0 = _u53d8_u91cfa | ||
| 10 | _with_0["函数"](_with_0, ...) | ||
| 11 | return _with_0 | ||
| 12 | end)(...)) | ||
| 13 | _u5217_u8868_u751f_u6210((function() | ||
| 14 | local _accum_0 = { } | ||
| 15 | local _len_0 = 1 | ||
| 16 | for i = 1, 10 do | ||
| 17 | _accum_0[_len_0] = _u9879_u76ee[i] | ||
| 18 | _len_0 = _len_0 + 1 | ||
| 19 | end | ||
| 20 | return _accum_0 | ||
| 21 | end)()) | ||
| 22 | _u5217_u8868_u751f_u6210((function(...) | ||
| 23 | local _accum_0 = { } | ||
| 24 | local _len_0 = 1 | ||
| 25 | for i = 1, 10 do | ||
| 26 | _accum_0[_len_0] = _u9879_u76ee[i](...) | ||
| 27 | _len_0 = _len_0 + 1 | ||
| 28 | end | ||
| 29 | return _accum_0 | ||
| 30 | end)(...)) | ||
| 31 | _u5217_u8868_u751f_u6210((function() | ||
| 32 | local _accum_0 = { } | ||
| 33 | local _len_0 = 1 | ||
| 34 | local _list_0 = _u9879_u76ee | ||
| 35 | for _index_0 = 1, #_list_0 do | ||
| 36 | local _u7269_u54c1 = _list_0[_index_0] | ||
| 37 | _accum_0[_len_0] = _u7269_u54c1 | ||
| 38 | _len_0 = _len_0 + 1 | ||
| 39 | end | ||
| 40 | return _accum_0 | ||
| 41 | end)()) | ||
| 42 | _u5217_u8868_u751f_u6210((function(...) | ||
| 43 | local _accum_0 = { } | ||
| 44 | local _len_0 = 1 | ||
| 45 | local _list_0 = _u9879_u76ee | ||
| 46 | for _index_0 = 1, #_list_0 do | ||
| 47 | local _u7269_u54c1 = _list_0[_index_0] | ||
| 48 | _accum_0[_len_0] = _u7269_u54c1(...) | ||
| 49 | _len_0 = _len_0 + 1 | ||
| 50 | end | ||
| 51 | return _accum_0 | ||
| 52 | end)(...)) | ||
| 53 | _u7c7b_u751f_u6210((function() | ||
| 54 | local _u53d8_u91cfA | ||
| 55 | do | ||
| 56 | local _class_0 | ||
| 57 | local _base_0 = { } | ||
| 58 | if _base_0.__index == nil then | ||
| 59 | _base_0.__index = _base_0 | ||
| 60 | end | ||
| 61 | _class_0 = setmetatable({ | ||
| 62 | __init = function() end, | ||
| 63 | __base = _base_0, | ||
| 64 | __name = "变量A" | ||
| 65 | }, { | ||
| 66 | __index = _base_0, | ||
| 67 | __call = function(cls, ...) | ||
| 68 | local _self_0 = setmetatable({ }, _base_0) | ||
| 69 | cls.__init(_self_0, ...) | ||
| 70 | return _self_0 | ||
| 71 | end | ||
| 72 | }) | ||
| 73 | _base_0.__class = _class_0 | ||
| 74 | local self = _class_0; | ||
| 75 | _u51fd_u6570() | ||
| 76 | _u53d8_u91cfA = _class_0 | ||
| 77 | return _class_0 | ||
| 78 | end | ||
| 79 | end)()) | ||
| 80 | _u7c7b_u751f_u6210((function(...) | ||
| 81 | local _u53d8_u91cfA | ||
| 82 | do | ||
| 83 | local _class_0 | ||
| 84 | local _base_0 = { } | ||
| 85 | if _base_0.__index == nil then | ||
| 86 | _base_0.__index = _base_0 | ||
| 87 | end | ||
| 88 | _class_0 = setmetatable({ | ||
| 89 | __init = function() end, | ||
| 90 | __base = _base_0, | ||
| 91 | __name = "变量A" | ||
| 92 | }, { | ||
| 93 | __index = _base_0, | ||
| 94 | __call = function(cls, ...) | ||
| 95 | local _self_0 = setmetatable({ }, _base_0) | ||
| 96 | cls.__init(_self_0, ...) | ||
| 97 | return _self_0 | ||
| 98 | end | ||
| 99 | }) | ||
| 100 | _base_0.__class = _class_0 | ||
| 101 | local self = _class_0; | ||
| 102 | _u51fd_u6570(...) | ||
| 103 | _u53d8_u91cfA = _class_0 | ||
| 104 | return _class_0 | ||
| 105 | end | ||
| 106 | end)(...)) | ||
| 107 | _u8868_u751f_u6210((function() | ||
| 108 | local _tbl_0 = { } | ||
| 109 | for _u952e, _u503c in pairs(_u8868) do | ||
| 110 | _tbl_0[_u952e] = _u503c | ||
| 111 | end | ||
| 112 | return _tbl_0 | ||
| 113 | end)()) | ||
| 114 | _u8868_u751f_u6210((function(...) | ||
| 115 | local _tbl_0 = { } | ||
| 116 | for _u952e, _u503c in pairs(_u8868) do | ||
| 117 | _tbl_0[_u952e] = _u503c(...) | ||
| 118 | end | ||
| 119 | return _tbl_0 | ||
| 120 | end)(...)) | ||
| 121 | _u8868_u751f_u6210((function() | ||
| 122 | local _tbl_0 = { } | ||
| 123 | local _list_0 = _u9879_u76ee | ||
| 124 | for _index_0 = 1, #_list_0 do | ||
| 125 | local _u7269_u54c1 = _list_0[_index_0] | ||
| 126 | _tbl_0[_u7269_u54c1] = true | ||
| 127 | end | ||
| 128 | return _tbl_0 | ||
| 129 | end)()) | ||
| 130 | _u8868_u751f_u6210((function(...) | ||
| 131 | local _tbl_0 = { } | ||
| 132 | local _list_0 = _u9879_u76ee | ||
| 133 | for _index_0 = 1, #_list_0 do | ||
| 134 | local _u7269_u54c1 = _list_0[_index_0] | ||
| 135 | _tbl_0[_u7269_u54c1(...)] = true | ||
| 136 | end | ||
| 137 | return _tbl_0 | ||
| 138 | end)(...)) | ||
| 139 | _u505a_u64cd_u4f5c((function() | ||
| 140 | return _u51fd_u6570() | ||
| 141 | end)()) | ||
| 142 | _u505a_u64cd_u4f5c((function(...) | ||
| 143 | return _u51fd_u6570(...) | ||
| 144 | end)(...)) | ||
| 145 | _u5f53_u64cd_u4f5c((function() | ||
| 146 | local _accum_0 = { } | ||
| 147 | local _len_0 = 1 | ||
| 148 | while false do | ||
| 149 | _accum_0[_len_0] = _u51fd_u6570() | ||
| 150 | _len_0 = _len_0 + 1 | ||
| 151 | end | ||
| 152 | return _accum_0 | ||
| 153 | end)()) | ||
| 154 | _u5f53_u64cd_u4f5c((function(...) | ||
| 155 | local _accum_0 = { } | ||
| 156 | local _len_0 = 1 | ||
| 157 | while false do | ||
| 158 | _accum_0[_len_0] = _u51fd_u6570(...) | ||
| 159 | _len_0 = _len_0 + 1 | ||
| 160 | end | ||
| 161 | return _accum_0 | ||
| 162 | end)(...)) | ||
| 163 | _u5982_u679c_u64cd_u4f5c((function() | ||
| 164 | if false then | ||
| 165 | return _u51fd_u6570() | ||
| 166 | end | ||
| 167 | end)()) | ||
| 168 | _u5982_u679c_u64cd_u4f5c((function(...) | ||
| 169 | if false then | ||
| 170 | return _u51fd_u6570(...) | ||
| 171 | end | ||
| 172 | end)(...)) | ||
| 173 | _u9664_u975e_u64cd_u4f5c((function() | ||
| 174 | if not true then | ||
| 175 | return _u51fd_u6570() | ||
| 176 | end | ||
| 177 | end)()) | ||
| 178 | _u9664_u975e_u64cd_u4f5c((function(...) | ||
| 179 | if not true then | ||
| 180 | return _u51fd_u6570(...) | ||
| 181 | end | ||
| 182 | end)(...)) | ||
| 183 | _u5207_u6362_u64cd_u4f5c((function() | ||
| 184 | local _exp_0 = _u53d8_u91cfx | ||
| 185 | if "abc" == _exp_0 then | ||
| 186 | return _u51fd_u6570() | ||
| 187 | end | ||
| 188 | end)()) | ||
| 189 | _u5207_u6362_u64cd_u4f5c((function(...) | ||
| 190 | local _exp_0 = _u53d8_u91cfx | ||
| 191 | if "abc" == _exp_0 then | ||
| 192 | return _u51fd_u6570(...) | ||
| 193 | end | ||
| 194 | end)(...)) | ||
| 195 | _u8868_u8fbe_u5f0f_u64cd_u4f5c((function() | ||
| 196 | local _obj_0 = _u51fd_u6570 | ||
| 197 | if _obj_0 ~= nil then | ||
| 198 | return _obj_0() | ||
| 199 | end | ||
| 200 | return nil | ||
| 201 | end)()) | ||
| 202 | _u8868_u8fbe_u5f0f_u64cd_u4f5c((function(...) | ||
| 203 | local _obj_0 = _u51fd_u6570 | ||
| 204 | if _obj_0 ~= nil then | ||
| 205 | return _obj_0(...) | ||
| 206 | end | ||
| 207 | return nil | ||
| 208 | end)(...)) | ||
| 209 | _u5192_u53f7((function() | ||
| 210 | local _base_0 = f() | ||
| 211 | local _fn_0 = _base_0["函数"] | ||
| 212 | return _fn_0 and function(...) | ||
| 213 | return _fn_0(_base_0, ...) | ||
| 214 | end | ||
| 215 | end)()) | ||
| 216 | _u5192_u53f7((function(...) | ||
| 217 | local _base_0 = f(...) | ||
| 218 | local _fn_0 = _base_0["函数"] | ||
| 219 | return _fn_0 and function(...) | ||
| 220 | return _fn_0(_base_0, ...) | ||
| 221 | end | ||
| 222 | end)(...)) | ||
| 223 | local _ | ||
| 224 | _ = function() | ||
| 225 | local _u5217_u8868 = { | ||
| 226 | 1, | ||
| 227 | 2, | ||
| 228 | 3, | ||
| 229 | 4, | ||
| 230 | 5 | ||
| 231 | } | ||
| 232 | local _u51fd_u6570_u540d | ||
| 233 | _u51fd_u6570_u540d = function(_u786e_u5b9a) | ||
| 234 | return _u786e_u5b9a, table.unpack(_u5217_u8868) | ||
| 235 | end | ||
| 236 | return (function(_arg_0, ...) | ||
| 237 | local _u786e_u5b9a = _arg_0 | ||
| 238 | _u6253_u5370(_u786e_u5b9a, ...) | ||
| 239 | local _u591a_u53c2_u6570_u51fd_u6570 | ||
| 240 | _u591a_u53c2_u6570_u51fd_u6570 = function() | ||
| 241 | return 10, nil, 20, nil, 30 | ||
| 242 | end | ||
| 243 | return (function(...) | ||
| 244 | _u6253_u5370(select("#", ...)) | ||
| 245 | return _u6253_u5370(...) | ||
| 246 | end)(_u591a_u53c2_u6570_u51fd_u6570()) | ||
| 247 | end)(_u51fd_u6570_u540d(true)) | ||
| 248 | end | ||
| 249 | do | ||
| 250 | (function(...) | ||
| 251 | return _u6253_u5370(...) | ||
| 252 | end)((function() | ||
| 253 | if true then | ||
| 254 | return 1, 2 | ||
| 255 | end | ||
| 256 | end)()) | ||
| 257 | end | ||
| 258 | do | ||
| 259 | (function(_arg_0, ...) | ||
| 260 | local _u53d8_u91cfa = _arg_0 | ||
| 261 | return _u6253_u5370(_u53d8_u91cfa, select('#', ...)) | ||
| 262 | end)((function() | ||
| 263 | if not true then | ||
| 264 | return 1, 2 | ||
| 265 | end | ||
| 266 | end)()) | ||
| 267 | end | ||
| 268 | do | ||
| 269 | (function(...) | ||
| 270 | return _u6253_u5370(...) | ||
| 271 | end)((function() | ||
| 272 | local _exp_0 = _u53d8_u91cfx | ||
| 273 | if 1 == _exp_0 then | ||
| 274 | local _with_0 = _u8868 | ||
| 275 | _with_0["变量x"] = 123 | ||
| 276 | return _with_0 | ||
| 277 | else | ||
| 278 | return _u88682 | ||
| 279 | end | ||
| 280 | end)()) | ||
| 281 | end | ||
| 282 | do | ||
| 283 | (function(...) | ||
| 284 | return _u6253_u5370(...) | ||
| 285 | end)(1, 2, (function() | ||
| 286 | if _u6761_u4ef6 then | ||
| 287 | return 3, 4, 5 | ||
| 288 | end | ||
| 289 | end)()) | ||
| 290 | end | ||
| 291 | do | ||
| 292 | (function(_arg_0, ...) | ||
| 293 | local _u8868 = _arg_0 | ||
| 294 | return _u6253_u5370(...) | ||
| 295 | end)({ | ||
| 296 | ["名字"] = "abc", | ||
| 297 | ["值"] = 123 | ||
| 298 | }) | ||
| 299 | end | ||
| 300 | return nil | ||
| 301 | end | ||
