aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-04-01 17:47:27 +0800
committerLi Jin <dragon-fly@qq.com>2022-04-01 17:47:27 +0800
commitca1ed557769352c0ac0ca7804dd25e18c1fdf2e1 (patch)
treebf86d3990b90054f8d82aaf87cb9efae444a08ce /spec/inputs
parent7be6c300256bfe411942a7ccc66f6bc3afa7390d (diff)
downloadyuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.tar.gz
yuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.tar.bz2
yuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.zip
fix some ambiguous syntax caused by arg table block.
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/ambiguous.yue30
-rw-r--r--spec/inputs/syntax.yue9
2 files changed, 35 insertions, 4 deletions
diff --git a/spec/inputs/ambiguous.yue b/spec/inputs/ambiguous.yue
index 0e09979..3ae0bfc 100644
--- a/spec/inputs/ambiguous.yue
+++ b/spec/inputs/ambiguous.yue
@@ -28,4 +28,34 @@ do
28 global * 28 global *
29 $v! 29 $v!
30 30
31do
32 f
33 :v
34
35 tb = while f
36 :v
37
38 repeat
39 print v
40 until f
41 :v
42
43 with f
44 :v = tb
45 .x = 1
46
47 x = if f
48 :v
49
50 x = switch f
51 :v
52 when f
53 :v
54
55 nums = for num = 1, len
56 :num
57
58 objects = for item in *items
59 name: item
60
31nil 61nil
diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue
index e7f0a8d..84c6578 100644
--- a/spec/inputs/syntax.yue
+++ b/spec/inputs/syntax.yue
@@ -267,11 +267,12 @@ z = x and b
267z = x andb 267z = x andb
268 268
269 269
270-- undelimited tables 270while 10 > something(
271 something: "world"
272 )
273 print "yeah"
271 274
272while 10 > something 275-- undelimited tables
273 something: "world"
274 print "yeah"
275 276
276x = 277x =
277 okay: sure 278 okay: sure