From 09fc831f540ce3966aeff679164f37e7d40457c9 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 11 Feb 2022 10:37:35 +0800 Subject: add Lua table appending idiom: tb #= 123 --- spec/inputs/syntax.yue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'spec/inputs') diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index cb947e1..67d3a27 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue @@ -184,10 +184,21 @@ a["hello#{tostring ff}"] += 10 a[four].x += 10 a.b += 1 -a.b[1].c[2+3] += 1 +a.b[1].c[2 + 3] += 1 with tb .a.c += 1 +tb #= 10 +a.b.c #= 1 +x #= if v + 1 +else + 2 +with tb + .b.c #= with vec + .x = 1 + .y = 2 + x = 0 _ = (if ntype(v) == "fndef" then x += 1) for v in *values -- cgit v1.2.3-55-g6feb