aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/unicode/cond.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/cond.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/cond.yue')
-rw-r--r--spec/inputs/unicode/cond.yue232
1 files changed, 232 insertions, 0 deletions
diff --git a/spec/inputs/unicode/cond.yue b/spec/inputs/unicode/cond.yue
new file mode 100644
index 0000000..362408c
--- /dev/null
+++ b/spec/inputs/unicode/cond.yue
@@ -0,0 +1,232 @@
1
2你很酷 = false
3
4_无效变量 = if 酷
5 if 你很酷
6
7 else if 吃东西
8
9 else
10 _无效变量 = 二
11
12else
13
14
15_无效变量 = if 酷 then 否
16_无效变量 = if 酷 then 否 else 是
17
18if 酷 then 喔 酷 else
19 没那么 酷
20
21if 在工作
22 _无效变量 = if 酷 then if 酷 then 好吧 else 什么 else 呐
23
24
25if ✌️ then 无 日 elseif 酷 我 then 好吧 呀 else u型 路
26if ✌️ then 无 父 else if 酷 你 then 好吧 吧 else p型 路
27
28
29if (->)() then 随便 怎样
30
31if nil then 翻转 我 else
32 这个 是, 弧度
33
34
35if 东西 不错 then 没 法 elseif 好的 确定
36 什么 这里
37
38
39if 很多东西 then 没 机会
40elseif 好吧
41 现在 怎么办
42
43
44if 很多东西
45 是 伙计
46elseif 好的 人 then 嗨 好呀 else 嗯 确定
47
48if 我们 走吧
49 打印 "打招呼"
50elseif "只有我们"
51 打印 "威尔史密斯" else 显示 5555555
52
53--
54
55if 某东西 = 10
56 打印 某东西
57else
58 打印 "其它"
59
60你好 = if 某东西 = 10
61 打印 某东西
62else
63 打印 "其它"
64
65
66你好 = 5 + if 某东西 = 10
67 打印 某东西
68
69---
70
71z变量 = false
72
73_无效变量 = if false
74
75elseif 条件x = true
76
77elseif 条件z = true
78
79else
80
81
82
83输出 = if false
84
85elseif 条件x = true
86
87elseif 条件z = true
88
89else
90
91
92变量 = ->
93 if 某东西 = true
94 1
95 elseif 另一个 = false
96 2
97
98---
99
100unless true
101 打印 "酷!"
102
103unless true and false
104 打印 "酷!"
105
106unless false then 打印 "酷!"
107unless false then 打印 "酷!" else 打印 "no way!"
108
109unless nil
110 打印 "hello"
111else
112 打印 "world"
113
114--
115
116x = unless true
117 打印 "酷!"
118
119x = unless true and false
120 打印 "酷!"
121
122y = unless false then 打印 "酷!"
123y = unless false then 打印 "酷!" else 打印 "没门!"
124
125z = unless nil
126 打印 "你好"
127else
128 打印 "世界"
129
130打印 unless true
131 打印 "酷!"
132
133打印 unless true and false
134 打印 "酷!"
135
136打印 unless false then 打印 "酷!"
137打印 unless false then 打印 "酷!" else 打印 "没门!"
138
139打印 unless nil
140 打印 "你好"
141else
142 打印 "世界"
143
144--
145
146打印 "你好" unless 值
147
148变量dddd = {1,2,3} unless 值
149
150
151--
152
153do
154 j变量 = 100
155 unless j变量 = 嗨!
156 错误 "不是 j变量!"
157
158----------------
159
160变量a = 12
161变量a,变量c,变量b = "酷", nil, nil if 某东西
162
163
164
165---
166
167变量j = if 1
168 if 2
169 3
170else 6
171
172
173变量m = if 1
174
175
176
177 if 2
178
179
180 3
181
182
183else 6
184
185do
186 函数a
187 :字段b
188 return if 函数a
189 :字段b
190 else if 函数c
191 字段d: 变量e
192 else
193 字段f: 123
194
195do
196 函数c
197 字段d: 变量e
198 if 条件a
199 :字段b = 变量tb
200 elseif 条件c
201 字段d: 变量e = 变量tb
202
203if :派 = 数学库
204 打印 派
205
206do
207 local 数学库
208 if :派 = 数学库
209 打印 派
210
211do
212 if _模块 = {}
213 :东西 = _模块
214 :a功能, :b功能 = _模块
215
216do
217 global _模块
218 if _模块 = {}
219 :东西 = _模块
220 :a功能, :b功能 = _模块
221
222do
223 变量v = if 1 and do
224 0 ~= 1
225 1
226 else
227 2
228
229nil
230
231
232