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/loops.lua | |
| parent | a9d28cb615d2bdc09d2482d5262951f2afc8d6e1 (diff) | |
| download | yuescript-87267ca9e93606b70bdc0397349b176b8d142514.tar.gz yuescript-87267ca9e93606b70bdc0397349b176b8d142514.tar.bz2 yuescript-87267ca9e93606b70bdc0397349b176b8d142514.zip | |
Updated `repeat` syntax functions.
Diffstat (limited to 'spec/outputs/loops.lua')
| -rw-r--r-- | spec/outputs/loops.lua | 28 |
1 files changed, 28 insertions, 0 deletions
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 | ||
