diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-05-13 10:38:31 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-05-13 10:38:31 +0800 |
| commit | 4d61a00ebc5b956da72525de0e180de28a1e8ac6 (patch) | |
| tree | 02c6967a1966078563f5fcfdca8cdcc1b58e9864 /spec/inputs | |
| parent | 4c9209b131936ad97c73a7c0e71042fe24369a8e (diff) | |
| download | yuescript-4d61a00ebc5b956da72525de0e180de28a1e8ac6.tar.gz yuescript-4d61a00ebc5b956da72525de0e180de28a1e8ac6.tar.bz2 yuescript-4d61a00ebc5b956da72525de0e180de28a1e8ac6.zip | |
fix issue #52, add until statement.
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/loops.yue | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/inputs/loops.yue b/spec/inputs/loops.yue index 5708809..3191000 100644 --- a/spec/inputs/loops.yue +++ b/spec/inputs/loops.yue | |||
| @@ -109,6 +109,22 @@ repeat | |||
| 109 | print a | 109 | print a |
| 110 | until a == 10 | 110 | until a == 10 |
| 111 | 111 | ||
| 112 | a = 3 | ||
| 113 | until a == 0 | ||
| 114 | a -= 1 | ||
| 115 | done = false | ||
| 116 | until done do done = true | ||
| 117 | repeat | ||
| 118 | print "hello" | ||
| 119 | until true | ||
| 120 | until done | ||
| 121 | x = 10 | ||
| 122 | repeat | ||
| 123 | x -= 1 | ||
| 124 | until x == 0 | ||
| 125 | until cond | ||
| 126 | print "okay" | ||
| 127 | |||
| 112 | for x=1,10 | 128 | for x=1,10 |
| 113 | continue if x > 3 and x < 7 | 129 | continue if x > 3 and x < 7 |
| 114 | print x | 130 | print x |
