diff options
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/in_expression.yue | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/inputs/in_expression.yue b/spec/inputs/in_expression.yue new file mode 100644 index 0000000..2756fe8 --- /dev/null +++ b/spec/inputs/in_expression.yue | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | -a^2 in {1, 2, 3} |> f | ||
| 2 | |||
| 3 | a, b = x(...) not in [1, 3], 2 | ||
| 4 | |||
| 5 | d = (tb.x.y ...) not in [1, 3] | ||
| 6 | |||
| 7 | if a in {1} and b in {2, 3, 4} or c in [1, 10] | ||
| 8 | print a, b, c | ||
| 9 | |||
| 10 | switch val | ||
| 11 | when 1, 2, 3 | ||
| 12 | print "1, 2, 3" | ||
| 13 | |||
| 14 | when not in (0, 100] | ||
| 15 | print "not (0 < val <= 100)" | ||
| 16 | |||
| 17 | when in [200, 300) | ||
| 18 | print "200 <= val < 300)" | ||
| 19 | |||
| 20 | when not in {333, 444, 555} | ||
| 21 | print "not 333, 444 or 555" | ||
| 22 | |||
| 23 | do return y not in (a, b) | ||
| 24 | |||
| 25 | nil | ||
| 26 | |||
