aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/unicode/ambiguous.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/ambiguous.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/ambiguous.yue')
-rw-r--r--spec/inputs/unicode/ambiguous.yue82
1 files changed, 82 insertions, 0 deletions
diff --git a/spec/inputs/unicode/ambiguous.yue b/spec/inputs/unicode/ambiguous.yue
new file mode 100644
index 0000000..9f42223
--- /dev/null
+++ b/spec/inputs/unicode/ambiguous.yue
@@ -0,0 +1,82 @@
1import 绑定 from 抓取
2(绑定 声明) 颜色: "Red"
3
4变量a = 'b'
5变量c = 变量d
6(变量a 变量b) 变量c 变量d
7import 变量c from 变量d
8(变量a 变量b) 变量c 变量d
9(变量c 变量d) 变量a 变量b
10变量a, 变量b = 变量c, 变量d
11(变量d 变量a) 变量c
12
13macro 宏 = (函数, 参数)-> "(#{函数}) #{参数}"
14for 计数 = 1, 10
15 变量a = ->
16 $宏 打印, 1
17 变量a = 变量f
18 $宏 打印, 2
19 if 条件
20 $宏 打印, 3
21 ::跳转位置::
22 (打印) 4
23 goto 跳转位置
24 (打印) 5
25
26macro 🌛 = (代码)-> {
27 code: 代码
28 type: "lua"
29}
30
31do
32 打印()
33 1 |> b变量 |> (a变量)
34 打印()
35 <- (fn)
36
37do
38 打印()
39 () <- 异步函数()
40 打印()
41 $🌛[==[
42 --[[a comment to insert]]
43 (haha)()
44 ]==]
45 nil
46
47macro 宏v = -> '打印 123'
48do
49 global *
50 $宏v!
51
52do
53 函数f
54 :v变量
55
56 数组 = while 条件f
57 :v变量
58
59 repeat
60 打印 变量v
61 until 条件f
62 :变量v
63
64 with 条件f
65 :变量v = 数组
66 .字段x = 1
67
68 变量x = if 条件f
69 :字段v
70
71 变量x = switch 条件f
72 :字段v
73 when 条件f
74 :字段v
75
76 数字数组 = for 数字 = 1, 长度
77 :数字
78
79 对象数组 = for 物件 in *物件数组
80 名称: 物件
81
82nil