aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-01-29 10:29:19 +0800
committerLi Jin <dragon-fly@qq.com>2023-01-29 10:29:19 +0800
commite10b1b163a9a173f32b956bf1fb9be00194352b5 (patch)
tree4692fe729bbb588c0565ce78426c932e8b360f22 /spec/inputs
parent32f2a579ec15e6204e44d67ab2b8b4a1796e9a84 (diff)
downloadyuescript-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.yue6
-rw-r--r--spec/inputs/return.yue2
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
75i = 0 75i = 0
76x = while i < 10 76x = 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
81x = for thing in *3 82x = for thing in *3
82 y = "hello" 83 y = "hello"
84 break
83 85
84x = for x=1,2 86x = 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
8do 8do
9 return x for x in *things 9 for x in *things do return x
10 10
11do 11do
12 return [x for x in *things] 12 return [x for x in *things]