From 652a8839f885b73fff57942a9db8b26e9cb5233b Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sun, 22 Oct 2023 00:55:02 +0800 Subject: fixing issues from #152. --- spec/inputs/unicode/cond.yue | 11 +++++++++++ spec/inputs/unicode/in_expression.yue | 21 +-------------------- 2 files changed, 12 insertions(+), 20 deletions(-) (limited to 'spec/inputs/unicode') 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 else 2 +do + 链式比较 = 1 < 2 <= 2 < 3 == 3 > 2 >= 1 == 1 < 3 != 5 + + 值 = (输入)-> + 打印 输入 + 输入 + + 求值 = 值(1) < 值(2) <= 值(3) + + 求值 = 值(1) > 值(2) <= 值(3) + nil 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 @@ -变量a^2 in {1, 2, 3} |> 函数 -变量a, 变量b = 函数x(...) not in [1, 3], 2 - -变量d = (对象.字段x.字段y ...) not in [1, 3] - 在的 = "东" in { "东", "西" } -if 变量a in {1} and 变量b in {2, 3, 4} or 变量c in [1, 10] +if 变量a in {1} and 变量b in {2, 3, 4} 打印 变量a, 变量b, 变量c -switch 值 - when 1, 2, 3 - 打印 "1, 2, 3" - - when not in (0, 100] - 打印 "非 (0 < 值 <= 100)" - - when in [200, 300) - 打印 "200 <= 值 < 300)" - - when not in {333, 444, 555} - 打印 "非 333, 444 或 555" - -do return 变量y not in (开始, 结束) - do 存在 = 元素 in 表 检查 元素 in 表 -- cgit v1.2.3-55-g6feb