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/nil_coalescing.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/nil_coalescing.yue')
-rw-r--r-- | spec/inputs/unicode/nil_coalescing.yue | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/inputs/unicode/nil_coalescing.yue b/spec/inputs/unicode/nil_coalescing.yue new file mode 100644 index 0000000..104142e --- /dev/null +++ b/spec/inputs/unicode/nil_coalescing.yue | |||
@@ -0,0 +1,48 @@ | |||
1 | do | ||
2 | 变量a = 变量b ?? 变量c | ||
3 | |||
4 | do | ||
5 | :字段a = 变量b ?? 变量c | ||
6 | |||
7 | do | ||
8 | 变量a = 函数! | ||
9 | 变量a ??= false | ||
10 | |||
11 | do | ||
12 | 变量a ??= 函数! | ||
13 | |||
14 | do | ||
15 | local 变量a, 变量b, 变量c, 变量d, 变量e | ||
16 | 变量a = 变量b ?? 变量c ?? 变量d ?? 变量e | ||
17 | |||
18 | do | ||
19 | 变量a = 变量b ?? 变量c ?? 变量d ?? 变量e | ||
20 | |||
21 | do | ||
22 | 函数 变量x ?? "你好" | ||
23 | |||
24 | do | ||
25 | with 函数A! ?? 函数B! | ||
26 | 打印 .字段 | ||
27 | |||
28 | do | ||
29 | 变量a = 1 + 2 + 变量b ?? 变量c + 3 + 4 | ||
30 | |||
31 | do | ||
32 | 变量a = 1 + 2 + (变量b ?? 变量c) + 3 + 4 | ||
33 | |||
34 | do | ||
35 | :字段a, :字段b = 函数! | ||
36 | 变量a or= 1 | ||
37 | 变量b ??= 变量c ?? 2 | ||
38 | |||
39 | do | ||
40 | 变量a = 1 ?? 2 ?? 3 | ||
41 | |||
42 | do | ||
43 | 变量a.字段.字段 ??= 1 | ||
44 | 变量a = 变量b.字段 ?? 变量c.字段 ?? 变量d.字段 | ||
45 | 变量a.字段 ??= 1 | ||
46 | |||
47 | nil | ||
48 | |||