diff options
| author | Li Jin <dragon-fly@qq.com> | 2025-06-04 16:07:06 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2025-06-04 16:07:06 +0800 |
| commit | 0e72454a11f65d9ac800dedb698ddfcc15933785 (patch) | |
| tree | 6cded6335c22c4dd204f7d3bc66efa0f76a41ef0 /spec/outputs/unicode | |
| parent | 548ab1d9ff5b831050f14f1355a3314a41163ad6 (diff) | |
| download | yuescript-0e72454a11f65d9ac800dedb698ddfcc15933785.tar.gz yuescript-0e72454a11f65d9ac800dedb698ddfcc15933785.tar.bz2 yuescript-0e72454a11f65d9ac800dedb698ddfcc15933785.zip | |
Added more reversed index support for slice. [skip CI]
Diffstat (limited to 'spec/outputs/unicode')
| -rw-r--r-- | spec/outputs/unicode/comprehension.lua | 10 | ||||
| -rw-r--r-- | spec/outputs/unicode/lists.lua | 23 |
2 files changed, 22 insertions, 11 deletions
diff --git a/spec/outputs/unicode/comprehension.lua b/spec/outputs/unicode/comprehension.lua index 894e78f..92bce69 100644 --- a/spec/outputs/unicode/comprehension.lua +++ b/spec/outputs/unicode/comprehension.lua | |||
| @@ -243,8 +243,11 @@ end | |||
| 243 | do | 243 | do |
| 244 | local _accum_0 = { } | 244 | local _accum_0 = { } |
| 245 | local _len_0 = 1 | 245 | local _len_0 = 1 |
| 246 | local _min_0 = 1 + 2 | ||
| 246 | local _max_0 = 3 + 4 | 247 | local _max_0 = 3 + 4 |
| 247 | for _index_0 = 1 + 2, _max_0 < 0 and #_u5217_u8868 + _max_0 + 1 or _max_0 do | 248 | _min_0 = _min_0 < 0 and #_u5217_u8868 + _min_0 + 1 or _min_0 |
| 249 | _max_0 = _max_0 < 0 and #_u5217_u8868 + _max_0 + 1 or _max_0 | ||
| 250 | for _index_0 = _min_0, _max_0 do | ||
| 248 | local _u9879_u76ee = _u5217_u8868[_index_0] | 251 | local _u9879_u76ee = _u5217_u8868[_index_0] |
| 249 | _accum_0[_len_0] = _u9879_u76ee | 252 | _accum_0[_len_0] = _u9879_u76ee |
| 250 | _len_0 = _len_0 + 1 | 253 | _len_0 = _len_0 + 1 |
| @@ -254,8 +257,11 @@ end | |||
| 254 | do | 257 | do |
| 255 | local _accum_0 = { } | 258 | local _accum_0 = { } |
| 256 | local _len_0 = 1 | 259 | local _len_0 = 1 |
| 260 | local _min_0 = _u4f60_u597d() * 4 | ||
| 257 | local _max_0 = 2 - _u4e1c_u897f[4] | 261 | local _max_0 = 2 - _u4e1c_u897f[4] |
| 258 | for _index_0 = _u4f60_u597d() * 4, _max_0 < 0 and #_u5217_u8868 + _max_0 + 1 or _max_0 do | 262 | _min_0 = _min_0 < 0 and #_u5217_u8868 + _min_0 + 1 or _min_0 |
| 263 | _max_0 = _max_0 < 0 and #_u5217_u8868 + _max_0 + 1 or _max_0 | ||
| 264 | for _index_0 = _min_0, _max_0 do | ||
| 259 | local _u9879_u76ee = _u5217_u8868[_index_0] | 265 | local _u9879_u76ee = _u5217_u8868[_index_0] |
| 260 | _accum_0[_len_0] = _u9879_u76ee | 266 | _accum_0[_len_0] = _u9879_u76ee |
| 261 | _len_0 = _len_0 + 1 | 267 | _len_0 = _len_0 + 1 |
diff --git a/spec/outputs/unicode/lists.lua b/spec/outputs/unicode/lists.lua index a3c329b..3bf6f50 100644 --- a/spec/outputs/unicode/lists.lua +++ b/spec/outputs/unicode/lists.lua | |||
| @@ -229,31 +229,36 @@ _u53d8_u91cfx = { | |||
| 229 | 6, | 229 | 6, |
| 230 | 7 | 230 | 7 |
| 231 | } | 231 | } |
| 232 | local _max_0 = -5 | 232 | local _max_0 = #_u53d8_u91cfx + -5 + 1 |
| 233 | for _index_0 = 2, _max_0 < 0 and #_u53d8_u91cfx + _max_0 + 1 or _max_0, 2 do | 233 | for _index_0 = 2, _max_0, 2 do |
| 234 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 234 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 235 | _u6253_u5370(_u53d8_u91cfy) | 235 | _u6253_u5370(_u53d8_u91cfy) |
| 236 | end | 236 | end |
| 237 | local _max_1 = 3 | 237 | for _index_0 = 1, 3 do |
| 238 | for _index_0 = 1, _max_1 < 0 and #_u53d8_u91cfx + _max_1 + 1 or _max_1 do | ||
| 239 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 238 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 240 | _u6253_u5370(_u53d8_u91cfy) | 239 | _u6253_u5370(_u53d8_u91cfy) |
| 241 | end | 240 | end |
| 242 | for _index_0 = 2, #_u53d8_u91cfx do | 241 | local _max_1 = #_u53d8_u91cfx |
| 242 | for _index_0 = 2, _max_1 do | ||
| 243 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 243 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 244 | _u6253_u5370(_u53d8_u91cfy) | 244 | _u6253_u5370(_u53d8_u91cfy) |
| 245 | end | 245 | end |
| 246 | for _index_0 = 1, #_u53d8_u91cfx, 2 do | 246 | local _max_2 = #_u53d8_u91cfx |
| 247 | for _index_0 = 1, _max_2, 2 do | ||
| 247 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 248 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 248 | _u6253_u5370(_u53d8_u91cfy) | 249 | _u6253_u5370(_u53d8_u91cfy) |
| 249 | end | 250 | end |
| 250 | for _index_0 = 2, #_u53d8_u91cfx, 2 do | 251 | local _max_3 = #_u53d8_u91cfx |
| 252 | for _index_0 = 2, _max_3, 2 do | ||
| 251 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 253 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 252 | _u6253_u5370(_u53d8_u91cfy) | 254 | _u6253_u5370(_u53d8_u91cfy) |
| 253 | end | 255 | end |
| 254 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 1, 5, 2 | 256 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 1, 5, 2 |
| 255 | local _max_2 = _u53d8_u91cfb | 257 | local _min_0 = _u53d8_u91cfa |
| 256 | for _index_0 = _u53d8_u91cfa, _max_2 < 0 and #_u53d8_u91cfx + _max_2 + 1 or _max_2, _u53d8_u91cfc do | 258 | local _max_4 = _u53d8_u91cfb |
| 259 | _min_0 = _min_0 < 0 and #_u53d8_u91cfx + _min_0 + 1 or _min_0 | ||
| 260 | _max_4 = _max_4 < 0 and #_u53d8_u91cfx + _max_4 + 1 or _max_4 | ||
| 261 | for _index_0 = _min_0, _max_4, _u53d8_u91cfc do | ||
| 257 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | 262 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] |
| 258 | _u6253_u5370(_u53d8_u91cfy) | 263 | _u6253_u5370(_u53d8_u91cfy) |
| 259 | end | 264 | end |
