diff options
author | Li Jin <dragon-fly@qq.com> | 2023-10-22 00:55:02 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-10-22 00:55:02 +0800 |
commit | 652a8839f885b73fff57942a9db8b26e9cb5233b (patch) | |
tree | 0b24bb5610823a831ec0addbba37cb6200203b27 /spec/inputs/unicode | |
parent | f61a4a1d9a1b979b8a0c2e8a9c194a284f42220f (diff) | |
download | yuescript-652a8839f885b73fff57942a9db8b26e9cb5233b.tar.gz yuescript-652a8839f885b73fff57942a9db8b26e9cb5233b.tar.bz2 yuescript-652a8839f885b73fff57942a9db8b26e9cb5233b.zip |
fixing issues from #152.
Diffstat (limited to 'spec/inputs/unicode')
-rw-r--r-- | spec/inputs/unicode/cond.yue | 11 | ||||
-rw-r--r-- | spec/inputs/unicode/in_expression.yue | 21 |
2 files changed, 12 insertions, 20 deletions
diff --git a/spec/inputs/unicode/cond.yue b/spec/inputs/unicode/cond.yue index 362408c..fca6d60 100644 --- a/spec/inputs/unicode/cond.yue +++ b/spec/inputs/unicode/cond.yue | |||
@@ -226,6 +226,17 @@ do | |||
226 | else | 226 | else |
227 | 2 | 227 | 2 |
228 | 228 | ||
229 | do | ||
230 | 链式比较 = 1 < 2 <= 2 < 3 == 3 > 2 >= 1 == 1 < 3 != 5 | ||
231 | |||
232 | 值 = (输入)-> | ||
233 | 打印 输入 | ||
234 | 输入 | ||
235 | |||
236 | 求值 = 值(1) < 值(2) <= 值(3) | ||
237 | |||
238 | 求值 = 值(1) > 值(2) <= 值(3) | ||
239 | |||
229 | nil | 240 | nil |
230 | 241 | ||
231 | 242 | ||
diff --git a/spec/inputs/unicode/in_expression.yue b/spec/inputs/unicode/in_expression.yue index efaca47..e068cbf 100644 --- a/spec/inputs/unicode/in_expression.yue +++ b/spec/inputs/unicode/in_expression.yue | |||
@@ -1,29 +1,10 @@ | |||
1 | -变量a^2 in {1, 2, 3} |> 函数 | 1 | -变量a^2 in {1, 2, 3} |> 函数 |
2 | 2 | ||
3 | 变量a, 变量b = 函数x(...) not in [1, 3], 2 | ||
4 | |||
5 | 变量d = (对象.字段x.字段y ...) not in [1, 3] | ||
6 | |||
7 | 在的 = "东" in { "东", "西" } | 3 | 在的 = "东" in { "东", "西" } |
8 | 4 | ||
9 | if 变量a in {1} and 变量b in {2, 3, 4} or 变量c in [1, 10] | 5 | if 变量a in {1} and 变量b in {2, 3, 4} |
10 | 打印 变量a, 变量b, 变量c | 6 | 打印 变量a, 变量b, 变量c |
11 | 7 | ||
12 | switch 值 | ||
13 | when 1, 2, 3 | ||
14 | 打印 "1, 2, 3" | ||
15 | |||
16 | when not in (0, 100] | ||
17 | 打印 "非 (0 < 值 <= 100)" | ||
18 | |||
19 | when in [200, 300) | ||
20 | 打印 "200 <= 值 < 300)" | ||
21 | |||
22 | when not in {333, 444, 555} | ||
23 | 打印 "非 333, 444 或 555" | ||
24 | |||
25 | do return 变量y not in (开始, 结束) | ||
26 | |||
27 | do | 8 | do |
28 | 存在 = 元素 in 表 | 9 | 存在 = 元素 in 表 |
29 | 检查 元素 in 表 | 10 | 检查 元素 in 表 |