aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/unicode/existential.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
committerLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
commite61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch)
tree6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/inputs/unicode/existential.yue
parent289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff)
downloadyuescript-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/existential.yue')
-rw-r--r--spec/inputs/unicode/existential.yue58
1 files changed, 58 insertions, 0 deletions
diff --git a/spec/inputs/unicode/existential.yue b/spec/inputs/unicode/existential.yue
new file mode 100644
index 0000000..0e35a39
--- /dev/null
+++ b/spec/inputs/unicode/existential.yue
@@ -0,0 +1,58 @@
1
2函数1?!
3
4函数2? "参数0",123
5
6变量x = 表?.值
7
8打印 对象abc?["你好 世界"]?.字段xyz
9
10if 打印 and 变量x?
11 打印 变量x
12
13@?\函数 998
14
15with 对象abc?!\函数?!
16 if \函数p? "abc"
17 return 123
18
19if {:x字段} = 对象a?.如果?\然后?(123)? @?\方法 998
20 打印 x字段
21
22结果 = 对象b.方法\执行!\当?("没问题")\如果("默认",998)\函数?
23打印 结果
24
25自我为中心 = true if 思想? and not 世界?
26
27速度 = 0
28速度 or= 15
29
30脚印 = 野人 or "熊"
31
32专业 = '计算机科学'
33
34unless 专业?
35 选修课程 '葡萄酒入门'
36
37if 窗体?
38 环境 = '浏览器(有可能)'
39
40邮编 = 抽奖.中奖者?!.地址?.邮政编码
41
42长度 = utf8?.长度 or 字符串?.长度 or (对象) -> #对象
43
44变量a = 表1?\结束? 123 + 表2?\然后 456
45
46变量b = 表1?\结束? or 表2?\然后
47
48with? io.open "测试.txt", "w"
49 \write "你好"
50 \close!
51
52表?.<call>? 123
53
54with? 表.<>?.<index>
55 .字段a = 1
56
57nil
58