From 1fa4049fc55986af8615ea836a60ac8cae255ad6 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sun, 12 Jun 2022 00:16:35 +0800 Subject: fix issue #105. --- spec/inputs/with.yue | 14 ++++++++++++++ spec/outputs/with.lua | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'spec') diff --git a/spec/inputs/with.yue b/spec/inputs/with.yue index fe140ac..6f3e3ba 100644 --- a/spec/inputs/with.yue +++ b/spec/inputs/with.yue @@ -122,6 +122,20 @@ do .if "yes" y = .end.of.function +do + with tb + [1] = [2]?\func! + ["%a-b-c%"] = 123 + [ [[x y z]]] = [var] + print [ [3]] + with [4] + [1] = 1 + [] = "abc" + [] = + type: "hello" + * name: "xyz" + value: 998 + do global mask with? mask = SolidRect width: w, height: h, color: 0x66000000 diff --git a/spec/outputs/with.lua b/spec/outputs/with.lua index f172b01..9dcaca3 100644 --- a/spec/outputs/with.lua +++ b/spec/outputs/with.lua @@ -163,6 +163,32 @@ do local y = _with_0["end"].of["function"] end end +do + do + local _with_0 = tb + do + local _obj_0 = _with_0[2] + if _obj_0 ~= nil then + _with_0[1] = _obj_0:func() + end + end + _with_0["%a-b-c%"] = 123 + _with_0[ [[x y z]]] = _with_0[var] + print(_with_0[_with_0[3]]) + do + local _with_1 = _with_0[4] + _with_1[1] = 1 + end + _with_0[#_with_0 + 1] = "abc" + _with_0[#_with_0 + 1] = { + type = "hello", + { + name = "xyz", + value = 998 + } + } + end +end do do local _with_0 = SolidRect({ -- cgit v1.2.3-55-g6feb