diff options
author | Li Jin <dragon-fly@qq.com> | 2022-02-14 11:20:10 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-02-14 11:20:10 +0800 |
commit | 2c2cad4b4d3680bb30474b38ebed0f938e82636e (patch) | |
tree | 3d8cb1dc8e9ea0c156d766056b9535813358148b /spec/inputs/nil_coalescing.yue | |
parent | ac6c7c9998a77d5f93bf97e31568e65e6dd9585e (diff) | |
download | yuescript-2c2cad4b4d3680bb30474b38ebed0f938e82636e.tar.gz yuescript-2c2cad4b4d3680bb30474b38ebed0f938e82636e.tar.bz2 yuescript-2c2cad4b4d3680bb30474b38ebed0f938e82636e.zip |
fix typo.
Diffstat (limited to 'spec/inputs/nil_coalescing.yue')
-rw-r--r-- | spec/inputs/nil_coalescing.yue | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/inputs/nil_coalescing.yue b/spec/inputs/nil_coalescing.yue new file mode 100644 index 0000000..76915c7 --- /dev/null +++ b/spec/inputs/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 = func! | ||
9 | a ??= false | ||
10 | |||
11 | do | ||
12 | a ??= func! | ||
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 | func x ?? "hello" | ||
23 | |||
24 | do | ||
25 | with funcA! ?? funcB! | ||
26 | print .field | ||
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 = func! | ||
36 | a or= 1 | ||
37 | b ??= c ?? 2 | ||
38 | |||
39 | do | ||
40 | a = 1 ?? 2 ?? 3 | ||
41 | |||
42 | do | ||
43 | a.b.c ??= 1 | ||
44 | a = b.x ?? c.x ?? d.x | ||
45 | a.c ??= 1 | ||
46 | |||
47 | nil | ||
48 | |||