diff options
author | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
commit | e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch) | |
tree | 6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/inputs/unicode/attrib.yue | |
parent | 289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff) | |
download | yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2 yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip |
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/inputs/unicode/attrib.yue')
-rw-r--r-- | spec/inputs/unicode/attrib.yue | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/inputs/unicode/attrib.yue b/spec/inputs/unicode/attrib.yue new file mode 100644 index 0000000..def1d2a --- /dev/null +++ b/spec/inputs/unicode/attrib.yue | |||
@@ -0,0 +1,53 @@ | |||
1 | const 常量a, 常量b, 常量c, 常量d = 1, 2, 3, 4 | ||
2 | |||
3 | do | ||
4 | close 关闭变量a, 关闭变量b = setmetatable {},__close:=> 打印 "已关闭" | ||
5 | const 变量c, 常量d = 123, 'abc' | ||
6 | |||
7 | close 常量a, 常量b | ||
8 | const 常量c, 常量d | ||
9 | |||
10 | do | ||
11 | const 常量a, {元素b, 元素c}, {元素d} = 函数!, 函数1! | ||
12 | |||
13 | do | ||
14 | const 常量a, {元素b, 元素c}, {元素d} = 函数! | ||
15 | |||
16 | do | ||
17 | close 关闭变量v = if 标记为真 | ||
18 | 函数调用! | ||
19 | else | ||
20 | <close>: => | ||
21 | |||
22 | close 关闭变量f = with io.open "文件.txt" | ||
23 | \write "你好" | ||
24 | |||
25 | do | ||
26 | const 常量a = 1 if true | ||
27 | close 关闭变量b = (if 条件x then 1) unless false | ||
28 | const 常量c = (switch 条件x | ||
29 | when "abc" then 998) if true | ||
30 | close 关闭变量d = | ||
31 | :数值 if 条件a ?? 条件b | ||
32 | |||
33 | do | ||
34 | close _无效变量 = with io.open "文件.txt" | ||
35 | \write "你好" | ||
36 | |||
37 | close _无效变量 = <close>: -> 打印 "第二" | ||
38 | |||
39 | close _无效变量 = <close>: -> 打印 "第一" | ||
40 | |||
41 | _延迟对象数组 = <close>: => | ||
42 | @[#@]! | ||
43 | @[#@] = nil | ||
44 | |||
45 | 延迟 = (项目)-> | ||
46 | _延迟对象数组[] = 项目 | ||
47 | _延迟对象数组 | ||
48 | |||
49 | do | ||
50 | close _无效变量 = 延迟 -> 打印 3 | ||
51 | close _无效变量 = 延迟 -> 打印 2 | ||
52 | close _无效变量 = 延迟 -> 打印 1 | ||
53 | |||