From dce38caac22a024026d19f556aefe0669f97403c Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 29 Jun 2023 14:23:44 +0800 Subject: fix assignment to in-expression with discrete values issue from #140 --- spec/inputs/in_expression.yue | 2 ++ spec/outputs/in_expression.lua | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'spec') 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 d = (tb.x.y ...) not in [1, 3] +has = "foo" in { "bar", "foo" } + if a in {1} and b in {2, 3, 4} or c in [1, 10] print a, b, c 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 local _val_0 = (tb.x.y(...)) d = not (1 <= _val_0 and _val_0 <= 3) end +local has +do + local _val_0 = "foo" + has = "bar" == _val_0 or "foo" == _val_0 +end if (1 == a) and (2 == b or 3 == b or 4 == b) or (function() local _val_0 = c return 1 <= _val_0 and _val_0 <= 10 -- cgit v1.2.3-55-g6feb