diff options
author | Li Jin <dragon-fly@qq.com> | 2023-05-17 09:19:20 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-05-17 09:19:20 +0800 |
commit | 78d5e6f44c06ac24aee667b5f9a9e642dcc6208d (patch) | |
tree | 78913f601c44a1d85e275a30e4a1272fee00c4cb /spec/inputs | |
parent | a8c4737494818e6591cac2191bf3a49cbe990173 (diff) | |
download | yuescript-78d5e6f44c06ac24aee667b5f9a9e642dcc6208d.tar.gz yuescript-78d5e6f44c06ac24aee667b5f9a9e642dcc6208d.tar.bz2 yuescript-78d5e6f44c06ac24aee667b5f9a9e642dcc6208d.zip |
fix issue #133.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/export.yue | 6 | ||||
-rw-r--r-- | spec/inputs/syntax.yue | 2 | ||||
-rw-r--r-- | spec/inputs/try-catch.yue | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/spec/inputs/export.yue b/spec/inputs/export.yue index 15ffbcb..66e6736 100644 --- a/spec/inputs/export.yue +++ b/spec/inputs/export.yue | |||
@@ -29,7 +29,7 @@ export cbVal = do | |||
29 | (x)<- f | 29 | (x)<- f |
30 | return x h | 30 | return x h |
31 | 31 | ||
32 | export y = -> | 32 | export yy = -> |
33 | h = 100 | 33 | h = 100 |
34 | k = 100 | 34 | k = 100 |
35 | 35 | ||
@@ -84,3 +84,7 @@ export v2 = 2 | |||
84 | export v3 = class v4 | 84 | export v3 = class v4 |
85 | v5 = 5 | 85 | v5 = 5 |
86 | 86 | ||
87 | export.<"abc"> = 1 | ||
88 | export.<name> = "export" | ||
89 | export.<call> = => {} | ||
90 | export["a-b-c-x"] = 123 | ||
diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index 4f693d4..d60a145 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue | |||
@@ -214,7 +214,7 @@ tb[] = 2 | |||
214 | tb[] = 3 | 214 | tb[] = 3 |
215 | 215 | ||
216 | x = 0 | 216 | x = 0 |
217 | _ = (if ntype(v) == "fndef" then x += 1) for v in *values | 217 | _ = (if ntype(v) == "fndef" then x + 1) for v in *values |
218 | 218 | ||
219 | 219 | ||
220 | hello = | 220 | hello = |
diff --git a/spec/inputs/try-catch.yue b/spec/inputs/try-catch.yue index 7287c33..e38cbef 100644 --- a/spec/inputs/try-catch.yue +++ b/spec/inputs/try-catch.yue | |||
@@ -23,6 +23,7 @@ try tb.func | |||
23 | try tb.func! | 23 | try tb.func! |
24 | try tb.func() | 24 | try tb.func() |
25 | try (tb.func!) | 25 | try (tb.func!) |
26 | try (tb\func(1, 2, 3)) | ||
26 | 27 | ||
27 | try tb.func 1 | 28 | try tb.func 1 |
28 | try tb.func(1) | 29 | try tb.func(1) |
@@ -32,7 +33,7 @@ catch err | |||
32 | print err) | 33 | print err) |
33 | print "OK" | 34 | print "OK" |
34 | 35 | ||
35 | if try func 1 | 36 | if try (func 1) |
36 | catch err | 37 | catch err |
37 | print err | 38 | print err |
38 | print "OK" | 39 | print "OK" |