aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/return.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
committerLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
commit7066392d1c974065181d95d93274136dcd625d43 (patch)
treecf51eafc2c52cbc12246a306bca172d799193d30 /spec/inputs/return.yue
parent90cd12ad9ef465f3e435e1bd034dcfbe4e19d016 (diff)
downloadyuescript-7066392d1c974065181d95d93274136dcd625d43.tar.gz
yuescript-7066392d1c974065181d95d93274136dcd625d43.tar.bz2
yuescript-7066392d1c974065181d95d93274136dcd625d43.zip
stop reusing variables, rename project.
Diffstat (limited to 'spec/inputs/return.yue')
-rw-r--r--spec/inputs/return.yue55
1 files changed, 55 insertions, 0 deletions
diff --git a/spec/inputs/return.yue b/spec/inputs/return.yue
new file mode 100644
index 0000000..f170ffd
--- /dev/null
+++ b/spec/inputs/return.yue
@@ -0,0 +1,55 @@
1-- testing `return` propagation
2
3_ = -> _ = x for x in *things
4_ = -> [x for x in *things]
5
6
7-- doesn't make sense on purpose
8do
9 return x for x in *things
10
11do
12 return [x for x in *things]
13
14do
15 return {x,y for x,y in *things}
16
17_ = ->
18 if a
19 if a
20 a
21 else
22 b
23 elseif b
24 if a
25 a
26 else
27 b
28 else
29 if a
30 a
31 else
32 b
33
34
35do
36 return if a
37 if a
38 a
39 else
40 b
41 elseif b
42 if a
43 a
44 else
45 b
46 else
47 if a
48 a
49 else
50 b
51
52_ = -> a\b
53do a\b
54
55