aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-06-07 09:42:50 +0800
committerLi Jin <dragon-fly@qq.com>2023-06-07 09:42:50 +0800
commit2a3e50752ade96c3b5d6b1103937bef0f6b31157 (patch)
treef7ae2654ac96009a9e5dbe9667e480cc920a2868 /spec/outputs
parent738154d37dd4ec20b09acd0f9f81601d0dc069ba (diff)
downloadyuescript-2a3e50752ade96c3b5d6b1103937bef0f6b31157.tar.gz
yuescript-2a3e50752ade96c3b5d6b1103937bef0f6b31157.tar.bz2
yuescript-2a3e50752ade96c3b5d6b1103937bef0f6b31157.zip
add new syntax of in-expression.
Diffstat (limited to 'spec/outputs')
-rw-r--r--spec/outputs/in_expression.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/outputs/in_expression.lua b/spec/outputs/in_expression.lua
new file mode 100644
index 0000000..061431f
--- /dev/null
+++ b/spec/outputs/in_expression.lua
@@ -0,0 +1,36 @@
1f((function()
2 local _val_0 = -a ^ 2
3 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
4end)())
5local a, b = (function(...)
6 local _val_0 = x(...)
7 return not (1 <= _val_0 and _val_0 <= 3)
8end)(...), 2
9local d
10do
11 local _val_0 = (tb.x.y(...))
12 d = not (1 <= _val_0 and _val_0 <= 3)
13end
14if (1 == a) and (2 == b or 3 == b or 4 == b) or (function()
15 local _val_0 = c
16 return 1 <= _val_0 and _val_0 <= 10
17end)() then
18 print(a, b, c)
19end
20do
21 local _exp_0 = val
22 if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 then
23 print("1, 2, 3")
24 elseif not (0 < _exp_0 and _exp_0 <= 100) then
25 print("not (0 < val <= 100)")
26 elseif (200 <= _exp_0 and _exp_0 < 300) then
27 print("200 <= val < 300)")
28 elseif not (333 == _exp_0 or 444 == _exp_0 or 555 == _exp_0) then
29 print("not 333, 444 or 555")
30 end
31end
32do
33 local _val_0 = y
34 return not (a < _val_0 and _val_0 < b)
35end
36return nil