From a91135ce512f907ed085d9aac147d8fcad356406 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 26 May 2025 11:07:38 +0800 Subject: Added assignment expression for switch syntax. --- spec/inputs/unicode/destructure.yue | 2 +- spec/inputs/unicode/macro_export.yue | 4 ++-- spec/inputs/unicode/with.yue | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'spec/inputs/unicode') diff --git a/spec/inputs/unicode/destructure.yue b/spec/inputs/unicode/destructure.yue index 3c3a369..a5ffd5d 100644 --- a/spec/inputs/unicode/destructure.yue +++ b/spec/inputs/unicode/destructure.yue @@ -84,7 +84,7 @@ do -- do - with {元素a,元素b} = 东西 + with {元素a,元素b} := 东西 打印 元素a, 元素b diff --git a/spec/inputs/unicode/macro_export.yue b/spec/inputs/unicode/macro_export.yue index 3c9a942..56571cd 100644 --- a/spec/inputs/unicode/macro_export.yue +++ b/spec/inputs/unicode/macro_export.yue @@ -37,8 +37,8 @@ export macro 复制 = (源, 目标, ...)-> " do local _源_, _目标_ - with _目标_ = #{目标} - with _源_ = #{源} + with _目标_ := #{目标} + with _源_ := #{源} #{table.concat for 字段 in *{...} do " _目标_.#{字段} = _源_.#{字段} "}" diff --git a/spec/inputs/unicode/with.yue b/spec/inputs/unicode/with.yue index ecbfdab..3c15add 100644 --- a/spec/inputs/unicode/with.yue +++ b/spec/inputs/unicode/with.yue @@ -45,19 +45,19 @@ do with 变量a 打印 .世界 - 模块 = with _模块 = {} + 模块 = with _模块 := {} .事物 = "你好" - with 变量a, 变量b = 东西, 布 + with 变量a, 变量b := 东西, 布 打印 .世界 - 变量x = with 变量a, 变量b = 1, 2 + 变量x = with 变量a, 变量b := 1, 2 打印 变量a + 变量b - 打印 with 变量a, 变量b = 1, 2 + 打印 with 变量a, 变量b := 1, 2 打印 变量a + 变量b - p = with 你好!.字段x, 世界!.字段y = 1, 2 + p = with 你好!.字段x, 世界!.字段y := 1, 2 打印 变量a + 变量b -- @@ -68,16 +68,16 @@ do 变量x\大写! do - with 变量k = "乔" + with 变量k := "乔" 打印 \大写! do - with 变量a,变量b,变量c = "", "", "" + with 变量a,变量b,变量c := "", "", "" 打印 \大写! do 变量a = "床铺" - with 变量a,变量b,变量c = "", "", "" + with 变量a,变量b,变量c := "", "", "" 打印 \大写! do @@ -85,7 +85,7 @@ do 打印 \大写! do - with 变量k.变量j = "乔" + with 变量k.变量j := "乔" 打印 \大写! do @@ -96,7 +96,7 @@ do do with 变量a - with .b = 2 + with .b := 2 打印 .c do @@ -131,12 +131,12 @@ do do global 掩码 - with? 掩码 = 实心矩形 宽: w, 高: h, 颜色: 0x66000000 + with? 掩码 := 实心矩形 宽: w, 高: h, 颜色: 0x66000000 .触摸启用 = true .吞噬触摸 = true do - with? 掩码 = 实心矩形 宽: w, 高: h, 颜色: 0x66000000 + with? 掩码 := 实心矩形 宽: w, 高: h, 颜色: 0x66000000 .触摸启用 = true .吞噬触摸 = true -- cgit v1.2.3-55-g6feb