aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-06-29 14:23:44 +0800
committerLi Jin <dragon-fly@qq.com>2023-06-29 14:24:40 +0800
commitdce38caac22a024026d19f556aefe0669f97403c (patch)
tree8b90a10585139dec76b596d714e213fc9393603b /spec
parent3edfe65c36d716ca0d1a4d15e78c84c94cb144d0 (diff)
downloadyuescript-0.17.3.tar.gz
yuescript-0.17.3.tar.bz2
yuescript-0.17.3.zip
fix assignment to in-expression with discrete values issue from #140v0.17.3
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/in_expression.yue2
-rw-r--r--spec/outputs/in_expression.lua5
2 files changed, 7 insertions, 0 deletions
diff --git a/spec/inputs/in_expression.yue b/spec/inputs/in_expression.yue
index 2756fe8..dacf820 100644
--- a/spec/inputs/in_expression.yue
+++ b/spec/inputs/in_expression.yue
@@ -4,6 +4,8 @@ a, b = x(...) not in [1, 3], 2
4 4
5d = (tb.x.y ...) not in [1, 3] 5d = (tb.x.y ...) not in [1, 3]
6 6
7has = "foo" in { "bar", "foo" }
8
7if a in {1} and b in {2, 3, 4} or c in [1, 10] 9if a in {1} and b in {2, 3, 4} or c in [1, 10]
8 print a, b, c 10 print a, b, c
9 11
diff --git a/spec/outputs/in_expression.lua b/spec/outputs/in_expression.lua
index 061431f..8b37a72 100644
--- a/spec/outputs/in_expression.lua
+++ b/spec/outputs/in_expression.lua
@@ -11,6 +11,11 @@ do
11 local _val_0 = (tb.x.y(...)) 11 local _val_0 = (tb.x.y(...))
12 d = not (1 <= _val_0 and _val_0 <= 3) 12 d = not (1 <= _val_0 and _val_0 <= 3)
13end 13end
14local has
15do
16 local _val_0 = "foo"
17 has = "bar" == _val_0 or "foo" == _val_0
18end
14if (1 == a) and (2 == b or 3 == b or 4 == b) or (function() 19if (1 == a) and (2 == b or 3 == b or 4 == b) or (function()
15 local _val_0 = c 20 local _val_0 = c
16 return 1 <= _val_0 and _val_0 <= 10 21 return 1 <= _val_0 and _val_0 <= 10