diff options
author | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-10-19 00:35:11 +0800 |
commit | 1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 (patch) | |
tree | 8bd3fbeb396fd2fce6e5b34c3ee10f4923feca72 /spec/outputs/5.1/loops.lua | |
parent | 05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff) | |
download | yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2 yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip |
Fixed issue #174.
Diffstat (limited to 'spec/outputs/5.1/loops.lua')
-rw-r--r-- | spec/outputs/5.1/loops.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/outputs/5.1/loops.lua b/spec/outputs/5.1/loops.lua index cc019e0..57b19be 100644 --- a/spec/outputs/5.1/loops.lua +++ b/spec/outputs/5.1/loops.lua | |||
@@ -440,3 +440,52 @@ do | |||
440 | end | 440 | end |
441 | end | 441 | end |
442 | end | 442 | end |
443 | do | ||
444 | repeat | ||
445 | local _cond_0 = false | ||
446 | local _continue_0 = false | ||
447 | repeat | ||
448 | local byte = stream:read_one() | ||
449 | if byte then | ||
450 | if byte == 0 then | ||
451 | _cond_0 = false | ||
452 | _continue_0 = true | ||
453 | break | ||
454 | end | ||
455 | print(byte) | ||
456 | else | ||
457 | break | ||
458 | end | ||
459 | _cond_0 = false | ||
460 | _continue_0 = true | ||
461 | until true | ||
462 | if not _continue_0 then | ||
463 | break | ||
464 | end | ||
465 | until _cond_0 | ||
466 | end | ||
467 | do | ||
468 | local func | ||
469 | repeat | ||
470 | local success, result = xpcall(function() | ||
471 | return func(1, 2, 3) | ||
472 | end, function(err) | ||
473 | return print(err) | ||
474 | end) | ||
475 | if success then | ||
476 | print(result) | ||
477 | else | ||
478 | break | ||
479 | end | ||
480 | until false | ||
481 | end | ||
482 | do | ||
483 | repeat | ||
484 | x = func('a', b) | ||
485 | if not x then | ||
486 | print("false expected") | ||
487 | else | ||
488 | break | ||
489 | end | ||
490 | until false | ||
491 | end | ||