aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/in_expression.yue
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/in_expression.yue')
-rw-r--r--spec/inputs/in_expression.yue25
1 files changed, 6 insertions, 19 deletions
diff --git a/spec/inputs/in_expression.yue b/spec/inputs/in_expression.yue
index 6e923e1..6faff4e 100644
--- a/spec/inputs/in_expression.yue
+++ b/spec/inputs/in_expression.yue
@@ -1,28 +1,13 @@
1-a^2 in {1, 2, 3} |> f 1-a^2 in {1, 2, 3} |> f
2 2-a^2 in [1, 2, 3] |> f
3a, b = x(...) not in [1, 3], 2
4
5d = (tb.x.y ...) not in [1, 3]
6 3
7has = "foo" in { "bar", "foo" } 4has = "foo" in { "bar", "foo" }
8 5
9if a in {1} and b in {2, 3, 4} or c in [1, 10] 6if a in {1} and b in {2, 3, 4}
10 print a, b, c 7 print a, b, c
11 8
12switch val 9if a in [1,] and b in [2, 3, 4]
13 when 1, 2, 3 10 print a, b, c
14 print "1, 2, 3"
15
16 when not in (0, 100]
17 print "not (0 < val <= 100)"
18
19 when in [200, 300)
20 print "200 <= val < 300)"
21
22 when not in {333, 444, 555}
23 print "not 333, 444 or 555"
24
25do return y not in (a, b)
26 11
27do 12do
28 exist = item in list 13 exist = item in list
@@ -36,9 +21,11 @@ do
36do 21do
37 item = get! 22 item = get!
38 list = {1, 2, 3} 23 list = {1, 2, 3}
24 list = [1, 2, 3]
39 not_exist = item not in list 25 not_exist = item not in list
40 check item in list 26 check item in list
41 check item in {1, 2, 3} 27 check item in {1, 2, 3}
28 check item in [1, 2, 3]
42 check item(...) in {[1]: 1, [2]: 2, [3]: 3} 29 check item(...) in {[1]: 1, [2]: 2, [3]: 3}
43 30
44do 31do