From 2a3e50752ade96c3b5d6b1103937bef0f6b31157 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 7 Jun 2023 09:42:50 +0800 Subject: add new syntax of in-expression. --- spec/inputs/in_expression.yue | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 spec/inputs/in_expression.yue (limited to 'spec/inputs') 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 @@ +-a^2 in {1, 2, 3} |> f + +a, b = x(...) not in [1, 3], 2 + +d = (tb.x.y ...) not in [1, 3] + +if a in {1} and b in {2, 3, 4} or c in [1, 10] + print a, b, c + +switch val + when 1, 2, 3 + print "1, 2, 3" + + when not in (0, 100] + print "not (0 < val <= 100)" + + when in [200, 300) + print "200 <= val < 300)" + + when not in {333, 444, 555} + print "not 333, 444 or 555" + +do return y not in (a, b) + +nil + -- cgit v1.2.3-55-g6feb