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/inputs | |
parent | 05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff) | |
download | yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2 yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip |
Fixed issue #174.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/loops.yue | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/inputs/loops.yue b/spec/inputs/loops.yue index 5cadbf0..c5b28b3 100644 --- a/spec/inputs/loops.yue +++ b/spec/inputs/loops.yue | |||
@@ -196,3 +196,20 @@ do | |||
196 | print i | 196 | print i |
197 | continue | 197 | continue |
198 | print "abc" | 198 | print "abc" |
199 | |||
200 | do | ||
201 | while byte := stream::read_one! | ||
202 | -- do something with the byte | ||
203 | continue if byte == 0 | ||
204 | print byte | ||
205 | |||
206 | do | ||
207 | local func | ||
208 | while success, result := try func 1, 2, 3 | ||
209 | catch err | ||
210 | print err | ||
211 | print result | ||
212 | |||
213 | do | ||
214 | until x := func 'a', b do | ||
215 | print "false expected" | ||