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/lists.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/lists.lua')
| -rw-r--r-- | spec/outputs/unicode/lists.lua | 281 |
1 files changed, 281 insertions, 0 deletions
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 @@ | |||
| 1 | local _u4f60_u597d | ||
| 2 | do | ||
| 3 | local _accum_0 = { } | ||
| 4 | local _len_0 = 1 | ||
| 5 | for _, _u53d8_u91cfx in ipairs({ | ||
| 6 | 1, | ||
| 7 | 2, | ||
| 8 | 3, | ||
| 9 | 4 | ||
| 10 | }) do | ||
| 11 | _accum_0[_len_0] = _u53d8_u91cfx * 2 | ||
| 12 | _len_0 = _len_0 + 1 | ||
| 13 | end | ||
| 14 | _u4f60_u597d = _accum_0 | ||
| 15 | end | ||
| 16 | local _u7269_u54c1 = { | ||
| 17 | 1, | ||
| 18 | 2, | ||
| 19 | 3, | ||
| 20 | 4, | ||
| 21 | 5, | ||
| 22 | 6 | ||
| 23 | } | ||
| 24 | local _ | ||
| 25 | do | ||
| 26 | local _accum_0 = { } | ||
| 27 | local _len_0 = 1 | ||
| 28 | for _u53d8_u91cfz in ipairs(_u7269_u54c1) do | ||
| 29 | if _u53d8_u91cfz > 4 then | ||
| 30 | _accum_0[_len_0] = _u53d8_u91cfz | ||
| 31 | _len_0 = _len_0 + 1 | ||
| 32 | end | ||
| 33 | end | ||
| 34 | _ = _accum_0 | ||
| 35 | end | ||
| 36 | local _u534a_u5f84 | ||
| 37 | do | ||
| 38 | local _accum_0 = { } | ||
| 39 | local _len_0 = 1 | ||
| 40 | for _u53d8_u91cfa in ipairs({ | ||
| 41 | 1, | ||
| 42 | 2, | ||
| 43 | 3, | ||
| 44 | 4, | ||
| 45 | 5, | ||
| 46 | 6 | ||
| 47 | }) do | ||
| 48 | if _u597d_u6570_u5b57(_u53d8_u91cfa) then | ||
| 49 | _accum_0[_len_0] = { | ||
| 50 | _u53d8_u91cfa | ||
| 51 | } | ||
| 52 | _len_0 = _len_0 + 1 | ||
| 53 | end | ||
| 54 | end | ||
| 55 | _u534a_u5f84 = _accum_0 | ||
| 56 | end | ||
| 57 | do | ||
| 58 | local _accum_0 = { } | ||
| 59 | local _len_0 = 1 | ||
| 60 | for _u53d8_u91cfz in _u7269_u54c1 do | ||
| 61 | for _u53d8_u91cfj in _u5217_u8868 do | ||
| 62 | if _u53d8_u91cfz > 4 then | ||
| 63 | _accum_0[_len_0] = _u53d8_u91cfz | ||
| 64 | _len_0 = _len_0 + 1 | ||
| 65 | end | ||
| 66 | end | ||
| 67 | end | ||
| 68 | _ = _accum_0 | ||
| 69 | end | ||
| 70 | require("实用") | ||
| 71 | local _u503e_u5012 | ||
| 72 | _u503e_u5012 = function(_u53d8_u91cfx) | ||
| 73 | return _u6253_u5370(_u5b9e_u7528["倾倒"](_u53d8_u91cfx)) | ||
| 74 | end | ||
| 75 | local _u8303_u56f4 | ||
| 76 | _u8303_u56f4 = function(_u6570_u91cf) | ||
| 77 | local _u53d8_u91cfi = 0 | ||
| 78 | return coroutine.wrap(function() | ||
| 79 | while _u53d8_u91cfi < _u6570_u91cf do | ||
| 80 | coroutine.yield(_u53d8_u91cfi) | ||
| 81 | _u53d8_u91cfi = _u53d8_u91cfi + 1 | ||
| 82 | end | ||
| 83 | end) | ||
| 84 | end | ||
| 85 | _u503e_u5012((function() | ||
| 86 | local _accum_0 = { } | ||
| 87 | local _len_0 = 1 | ||
| 88 | for _u53d8_u91cfx in _u8303_u56f4(10) do | ||
| 89 | _accum_0[_len_0] = _u53d8_u91cfx | ||
| 90 | _len_0 = _len_0 + 1 | ||
| 91 | end | ||
| 92 | return _accum_0 | ||
| 93 | end)()) | ||
| 94 | _u503e_u5012((function() | ||
| 95 | local _accum_0 = { } | ||
| 96 | local _len_0 = 1 | ||
| 97 | for _u53d8_u91cfx in _u8303_u56f4(5) do | ||
| 98 | if _u53d8_u91cfx > 2 then | ||
| 99 | for _u53d8_u91cfy in _u8303_u56f4(5) do | ||
| 100 | _accum_0[_len_0] = { | ||
| 101 | _u53d8_u91cfx, | ||
| 102 | _u53d8_u91cfy | ||
| 103 | } | ||
| 104 | _len_0 = _len_0 + 1 | ||
| 105 | end | ||
| 106 | end | ||
| 107 | end | ||
| 108 | return _accum_0 | ||
| 109 | end)()) | ||
| 110 | local _u4e1c_u897f | ||
| 111 | do | ||
| 112 | local _accum_0 = { } | ||
| 113 | local _len_0 = 1 | ||
| 114 | for _u53d8_u91cfx in _u8303_u56f4(10) do | ||
| 115 | if _u53d8_u91cfx > 5 then | ||
| 116 | for _u53d8_u91cfy in _u8303_u56f4(10) do | ||
| 117 | if _u53d8_u91cfy > 7 then | ||
| 118 | _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy | ||
| 119 | _len_0 = _len_0 + 1 | ||
| 120 | end | ||
| 121 | end | ||
| 122 | end | ||
| 123 | end | ||
| 124 | _u4e1c_u897f = _accum_0 | ||
| 125 | end | ||
| 126 | for _u53d8_u91cfx in ipairs({ | ||
| 127 | 1, | ||
| 128 | 2, | ||
| 129 | 4 | ||
| 130 | }) do | ||
| 131 | for _u53d8_u91cfy in ipairs({ | ||
| 132 | 1, | ||
| 133 | 2, | ||
| 134 | 3 | ||
| 135 | }) do | ||
| 136 | if _u53d8_u91cfx ~= 2 then | ||
| 137 | _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) | ||
| 138 | end | ||
| 139 | end | ||
| 140 | end | ||
| 141 | for _u53d8_u91cfx in _u7269_u54c1 do | ||
| 142 | _u6253_u5370("你好", _u53d8_u91cfx) | ||
| 143 | end | ||
| 144 | do | ||
| 145 | local _accum_0 = { } | ||
| 146 | local _len_0 = 1 | ||
| 147 | for _u53d8_u91cfx in _u53d8_u91cfx do | ||
| 148 | _accum_0[_len_0] = _u53d8_u91cfx | ||
| 149 | _len_0 = _len_0 + 1 | ||
| 150 | end | ||
| 151 | _ = _accum_0 | ||
| 152 | end | ||
| 153 | local _u53d8_u91cfx | ||
| 154 | do | ||
| 155 | local _accum_0 = { } | ||
| 156 | local _len_0 = 1 | ||
| 157 | for _u53d8_u91cfx in _u53d8_u91cfx do | ||
| 158 | _accum_0[_len_0] = _u53d8_u91cfx | ||
| 159 | _len_0 = _len_0 + 1 | ||
| 160 | end | ||
| 161 | _u53d8_u91cfx = _accum_0 | ||
| 162 | end | ||
| 163 | for _u53d8_u91cfx in ipairs({ | ||
| 164 | 1, | ||
| 165 | 2, | ||
| 166 | 4 | ||
| 167 | }) do | ||
| 168 | for _u53d8_u91cfy in ipairs({ | ||
| 169 | 1, | ||
| 170 | 2, | ||
| 171 | 3 | ||
| 172 | }) do | ||
| 173 | if _u53d8_u91cfx ~= 2 then | ||
| 174 | _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) | ||
| 175 | end | ||
| 176 | end | ||
| 177 | end | ||
| 178 | local _u53cc_u500d | ||
| 179 | do | ||
| 180 | local _accum_0 = { } | ||
| 181 | local _len_0 = 1 | ||
| 182 | for _index_0 = 1, #_u7269_u54c1 do | ||
| 183 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
| 184 | _accum_0[_len_0] = _u53d8_u91cfx * 2 | ||
| 185 | _len_0 = _len_0 + 1 | ||
| 186 | end | ||
| 187 | _u53cc_u500d = _accum_0 | ||
| 188 | end | ||
| 189 | for _index_0 = 1, #_u53cc_u500d do | ||
| 190 | local _u53d8_u91cfx = _u53cc_u500d[_index_0] | ||
| 191 | _u6253_u5370(_u53d8_u91cfx) | ||
| 192 | end | ||
| 193 | local _u5207 | ||
| 194 | do | ||
| 195 | local _accum_0 = { } | ||
| 196 | local _len_0 = 1 | ||
| 197 | for _index_0 = 1, #_u7269_u54c1 do | ||
| 198 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
| 199 | if _u53d8_u91cfx > 3 then | ||
| 200 | _accum_0[_len_0] = _u53d8_u91cfx | ||
| 201 | _len_0 = _len_0 + 1 | ||
| 202 | end | ||
| 203 | end | ||
| 204 | _u5207 = _accum_0 | ||
| 205 | end | ||
| 206 | do | ||
| 207 | local _accum_0 = { } | ||
| 208 | local _len_0 = 1 | ||
| 209 | for _index_0 = 1, #_u7269_u54c1 do | ||
| 210 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
| 211 | for _index_1 = 1, #_u7269_u54c1 do | ||
| 212 | local _u53d8_u91cfy = _u7269_u54c1[_index_1] | ||
| 213 | _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy | ||
| 214 | _len_0 = _len_0 + 1 | ||
| 215 | end | ||
| 216 | end | ||
| 217 | _u4f60_u597d = _accum_0 | ||
| 218 | end | ||
| 219 | for _index_0 = 1, #_u4f60_u597d do | ||
| 220 | local _u53d8_u91cfz = _u4f60_u597d[_index_0] | ||
| 221 | _u6253_u5370(_u53d8_u91cfz) | ||
| 222 | end | ||
| 223 | _u53d8_u91cfx = { | ||
| 224 | 1, | ||
| 225 | 2, | ||
| 226 | 3, | ||
| 227 | 4, | ||
| 228 | 5, | ||
| 229 | 6, | ||
| 230 | 7 | ||
| 231 | } | ||
| 232 | local _max_0 = -5 | ||
| 233 | for _index_0 = 2, _max_0 < 0 and #_u53d8_u91cfx + _max_0 or _max_0, 2 do | ||
| 234 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 235 | _u6253_u5370(_u53d8_u91cfy) | ||
| 236 | end | ||
| 237 | local _max_1 = 3 | ||
| 238 | for _index_0 = 1, _max_1 < 0 and #_u53d8_u91cfx + _max_1 or _max_1 do | ||
| 239 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 240 | _u6253_u5370(_u53d8_u91cfy) | ||
| 241 | end | ||
| 242 | for _index_0 = 2, #_u53d8_u91cfx do | ||
| 243 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 244 | _u6253_u5370(_u53d8_u91cfy) | ||
| 245 | end | ||
| 246 | for _index_0 = 1, #_u53d8_u91cfx, 2 do | ||
| 247 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 248 | _u6253_u5370(_u53d8_u91cfy) | ||
| 249 | end | ||
| 250 | for _index_0 = 2, #_u53d8_u91cfx, 2 do | ||
| 251 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 252 | _u6253_u5370(_u53d8_u91cfy) | ||
| 253 | end | ||
| 254 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 1, 5, 2 | ||
| 255 | local _max_2 = _u53d8_u91cfb | ||
| 256 | for _index_0 = _u53d8_u91cfa, _max_2 < 0 and #_u53d8_u91cfx + _max_2 or _max_2, _u53d8_u91cfc do | ||
| 257 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
| 258 | _u6253_u5370(_u53d8_u91cfy) | ||
| 259 | end | ||
| 260 | local _u6b63_u5e38 | ||
| 261 | _u6b63_u5e38 = function(_u4f60_u597d) | ||
| 262 | local _accum_0 = { } | ||
| 263 | local _len_0 = 1 | ||
| 264 | for _u53d8_u91cfx in _u55ef_u54fc do | ||
| 265 | _accum_0[_len_0] = _u53d8_u91cfx | ||
| 266 | _len_0 = _len_0 + 1 | ||
| 267 | end | ||
| 268 | return _accum_0 | ||
| 269 | end | ||
| 270 | local _u6d4b_u8bd5 = _u53d8_u91cfx(1, 2, 3, 4, 5) | ||
| 271 | for _index_0 = 1, #_u6d4b_u8bd5 do | ||
| 272 | local _u4e8b_u60c5 = _u6d4b_u8bd5[_index_0] | ||
| 273 | _u6253_u5370(_u4e8b_u60c5) | ||
| 274 | end | ||
| 275 | return function() | ||
| 276 | local _list_0 = _u884c_u4eec | ||
| 277 | for _index_0 = 1, #_list_0 do | ||
| 278 | local _u884c = _list_0[_index_0] | ||
| 279 | _u53d8_u91cfa = _u53d8_u91cfb | ||
| 280 | end | ||
| 281 | end | ||
