From ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 1 Apr 2022 17:47:27 +0800 Subject: fix some ambiguous syntax caused by arg table block. --- spec/inputs/ambiguous.yue | 30 ++++++++++++++++++++++++++++++ spec/inputs/syntax.yue | 9 +++++---- 2 files changed, 35 insertions(+), 4 deletions(-) (limited to 'spec/inputs') 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 global * $v! +do + f + :v + + tb = while f + :v + + repeat + print v + until f + :v + + with f + :v = tb + .x = 1 + + x = if f + :v + + x = switch f + :v + when f + :v + + nums = for num = 1, len + :num + + objects = for item in *items + name: item + nil 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 z = x andb --- undelimited tables +while 10 > something( + something: "world" + ) + print "yeah" -while 10 > something - something: "world" - print "yeah" +-- undelimited tables x = okay: sure -- cgit v1.2.3-55-g6feb