diff options
author | Li Jin <dragon-fly@qq.com> | 2023-01-29 10:29:19 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-01-29 10:29:19 +0800 |
commit | e10b1b163a9a173f32b956bf1fb9be00194352b5 (patch) | |
tree | 4692fe729bbb588c0565ce78426c932e8b360f22 /spec/inputs | |
parent | 32f2a579ec15e6204e44d67ab2b8b4a1796e9a84 (diff) | |
download | yuescript-e10b1b163a9a173f32b956bf1fb9be00194352b5.tar.gz yuescript-e10b1b163a9a173f32b956bf1fb9be00194352b5.tar.bz2 yuescript-e10b1b163a9a173f32b956bf1fb9be00194352b5.zip |
fix cases from issue #120.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/loops.yue | 6 | ||||
-rw-r--r-- | spec/inputs/return.yue | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/spec/inputs/loops.yue b/spec/inputs/loops.yue index d997c65..51eb10b 100644 --- a/spec/inputs/loops.yue +++ b/spec/inputs/loops.yue | |||
@@ -75,15 +75,17 @@ while also do | |||
75 | i = 0 | 75 | i = 0 |
76 | x = while i < 10 | 76 | x = while i < 10 |
77 | i += 1 | 77 | i += 1 |
78 | i | ||
78 | 79 | ||
79 | -- values that can'e be coerced | 80 | -- values that can't be coerced |
80 | 81 | ||
81 | x = for thing in *3 | 82 | x = for thing in *3 |
82 | y = "hello" | 83 | y = "hello" |
84 | break | ||
83 | 85 | ||
84 | x = for x=1,2 | 86 | x = for x=1,2 |
85 | y = "hello" | 87 | y = "hello" |
86 | 88 | y | |
87 | 89 | ||
88 | -- continue | 90 | -- continue |
89 | 91 | ||
diff --git a/spec/inputs/return.yue b/spec/inputs/return.yue index 96fa0cd..fda8d62 100644 --- a/spec/inputs/return.yue +++ b/spec/inputs/return.yue | |||
@@ -6,7 +6,7 @@ _ = -> [x for x in *things] | |||
6 | 6 | ||
7 | -- doesn't make sense on purpose | 7 | -- doesn't make sense on purpose |
8 | do | 8 | do |
9 | return x for x in *things | 9 | for x in *things do return x |
10 | 10 | ||
11 | do | 11 | do |
12 | return [x for x in *things] | 12 | return [x for x in *things] |