diff options
author | Li Jin <dragon-fly@qq.com> | 2025-05-27 11:26:15 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-05-27 11:26:15 +0800 |
commit | 87267ca9e93606b70bdc0397349b176b8d142514 (patch) | |
tree | 1d24aded412cc9543cbe4c282401129f9fb3229a /spec/outputs | |
parent | a9d28cb615d2bdc09d2482d5262951f2afc8d6e1 (diff) | |
download | yuescript-main.tar.gz yuescript-main.tar.bz2 yuescript-main.zip |
Diffstat (limited to '')
-rw-r--r-- | spec/outputs/5.1/loops.lua | 28 | ||||
-rw-r--r-- | spec/outputs/loops.lua | 28 | ||||
-rw-r--r-- | spec/outputs/with.lua | 13 |
3 files changed, 62 insertions, 7 deletions
diff --git a/spec/outputs/5.1/loops.lua b/spec/outputs/5.1/loops.lua index bc720f6..e4f2871 100644 --- a/spec/outputs/5.1/loops.lua +++ b/spec/outputs/5.1/loops.lua | |||
@@ -587,3 +587,31 @@ do | |||
587 | end | 587 | end |
588 | list = _accum_0 | 588 | list = _accum_0 |
589 | end | 589 | end |
590 | do | ||
591 | repeat | ||
592 | print(1) | ||
593 | until true | ||
594 | do | ||
595 | local _accum_0 | ||
596 | repeat | ||
597 | a = func() | ||
598 | _accum_0 = a.x | ||
599 | break | ||
600 | until a.v | ||
601 | x = _accum_0 | ||
602 | end | ||
603 | local items | ||
604 | local _accum_0 = { } | ||
605 | local _len_0 = 1 | ||
606 | repeat | ||
607 | local item = getItem() | ||
608 | if not item then | ||
609 | break | ||
610 | end | ||
611 | if item.value > 0 then | ||
612 | _accum_0[_len_0] = item | ||
613 | _len_0 = _len_0 + 1 | ||
614 | end | ||
615 | until false | ||
616 | items = _accum_0 | ||
617 | end | ||
diff --git a/spec/outputs/loops.lua b/spec/outputs/loops.lua index 9a47579..6ab4bbb 100644 --- a/spec/outputs/loops.lua +++ b/spec/outputs/loops.lua | |||
@@ -468,3 +468,31 @@ do | |||
468 | end | 468 | end |
469 | list = _accum_0 | 469 | list = _accum_0 |
470 | end | 470 | end |
471 | do | ||
472 | repeat | ||
473 | print(1) | ||
474 | until true | ||
475 | do | ||
476 | local _accum_0 | ||
477 | repeat | ||
478 | a = func() | ||
479 | _accum_0 = a.x | ||
480 | break | ||
481 | until a.v | ||
482 | x = _accum_0 | ||
483 | end | ||
484 | local items | ||
485 | local _accum_0 = { } | ||
486 | local _len_0 = 1 | ||
487 | repeat | ||
488 | local item = getItem() | ||
489 | if not item then | ||
490 | break | ||
491 | end | ||
492 | if item.value > 0 then | ||
493 | _accum_0[_len_0] = item | ||
494 | _len_0 = _len_0 + 1 | ||
495 | end | ||
496 | until false | ||
497 | items = _accum_0 | ||
498 | end | ||
diff --git a/spec/outputs/with.lua b/spec/outputs/with.lua index 338d51f..530915e 100644 --- a/spec/outputs/with.lua +++ b/spec/outputs/with.lua | |||
@@ -192,12 +192,12 @@ do | |||
192 | local _with_0 = item | 192 | local _with_0 = item |
193 | do | 193 | do |
194 | local _accum_0 | 194 | local _accum_0 |
195 | while true do | 195 | repeat |
196 | if _with_0.id > 0 then | 196 | if _with_0.id > 0 then |
197 | _accum_0 = _with_0.content | 197 | _accum_0 = _with_0.content |
198 | break | 198 | break |
199 | end | 199 | end |
200 | end | 200 | until true |
201 | _with_0 = _accum_0 | 201 | _with_0 = _accum_0 |
202 | end | 202 | end |
203 | return _with_0 | 203 | return _with_0 |
@@ -207,12 +207,12 @@ do | |||
207 | local _with_0 = tb | 207 | local _with_0 = tb |
208 | do | 208 | do |
209 | local _accum_0 | 209 | local _accum_0 |
210 | while true do | 210 | repeat |
211 | if _with_0.v then | 211 | if _with_0.v then |
212 | _accum_0 = _with_0.a | 212 | _accum_0 = _with_0.a |
213 | break | 213 | break |
214 | end | 214 | end |
215 | end | 215 | until true |
216 | _with_0 = _accum_0 | 216 | _with_0 = _accum_0 |
217 | end | 217 | end |
218 | a = _with_0 | 218 | a = _with_0 |
@@ -221,13 +221,12 @@ do | |||
221 | while true do | 221 | while true do |
222 | local _with_0 = tb | 222 | local _with_0 = tb |
223 | local _accum_1 | 223 | local _accum_1 |
224 | while true do | 224 | repeat |
225 | if _with_0 ~= nil then | 225 | if _with_0 ~= nil then |
226 | _accum_1 = 1 | 226 | _accum_1 = 1 |
227 | break | 227 | break |
228 | end | 228 | end |
229 | break | 229 | until true |
230 | end | ||
231 | _with_0 = _accum_1 | 230 | _with_0 = _accum_1 |
232 | _accum_0 = _with_0 | 231 | _accum_0 = _with_0 |
233 | break | 232 | break |