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/operators.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/operators.yue')
-rw-r--r-- | spec/inputs/unicode/operators.yue | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/spec/inputs/unicode/operators.yue b/spec/inputs/unicode/operators.yue new file mode 100644 index 0000000..2f1184a --- /dev/null +++ b/spec/inputs/unicode/operators.yue | |||
@@ -0,0 +1,70 @@ | |||
1 | |||
2 | -- binary ops | ||
3 | 数字x = 1 + 3 | ||
4 | |||
5 | 数字y = 1 + | ||
6 | 3 | ||
7 | |||
8 | 数字z = 1 + | ||
9 | 3 + | ||
10 | 4 | ||
11 | |||
12 | -- | ||
13 | |||
14 | 数字k = 变量b and 变量c and | ||
15 | 变量g | ||
16 | |||
17 | 变量h = 东西 and | ||
18 | -> | ||
19 | 打印 "你好 世界" | ||
20 | |||
21 | -- TODO: should fail, indent still set to previous line so it thinks body is | ||
22 | -- indented | ||
23 | 变量i = 东西 or | ||
24 | -> | ||
25 | 打印 "你好 世界" | ||
26 | |||
27 | 变量p = 东西 and | ||
28 | -> | ||
29 | 打印 "你好 世界" | ||
30 | |||
31 | 变量s = 东西 or | ||
32 | -> and 234 | ||
33 | |||
34 | -- | ||
35 | 变量u = { | ||
36 | 颜色: 1 and 2 and | ||
37 | 3 | ||
38 | 4 | ||
39 | 4 | ||
40 | } | ||
41 | |||
42 | 变量v = { | ||
43 | 颜色: 1 and | ||
44 | -> | ||
45 | "yeah" | ||
46 | "great" | ||
47 | 好的: 3 ^ | ||
48 | 2 | ||
49 | } | ||
50 | |||
51 | -- parens | ||
52 | |||
53 | 变量nno = ( | ||
54 | 是的 + 2 ) | ||
55 | |||
56 | 变量nn = ( | ||
57 | 是的 + 2 | ||
58 | ) | ||
59 | |||
60 | 变量n = 你好( | ||
61 | 变量b | ||
62 | ) -> | ||
63 | |||
64 | 你好 变量a, | ||
65 | ( | ||
66 | 是的 + | ||
67 | 2 | ||
68 | ) - | ||
69 | 好的 | ||
70 | |||