diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-06-12 00:16:35 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-06-12 00:16:35 +0800 |
| commit | 1fa4049fc55986af8615ea836a60ac8cae255ad6 (patch) | |
| tree | ba2e35613b32ca3bd46f6d6ff932de2a457328ea /spec | |
| parent | 4350d4b094c2c7202b7ad79d15187c1402bd13eb (diff) | |
| download | yuescript-1fa4049fc55986af8615ea836a60ac8cae255ad6.tar.gz yuescript-1fa4049fc55986af8615ea836a60ac8cae255ad6.tar.bz2 yuescript-1fa4049fc55986af8615ea836a60ac8cae255ad6.zip | |
fix issue #105.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/inputs/with.yue | 14 | ||||
| -rw-r--r-- | spec/outputs/with.lua | 26 |
2 files changed, 40 insertions, 0 deletions
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 | |||
| @@ -123,6 +123,20 @@ do | |||
| 123 | y = .end.of.function | 123 | y = .end.of.function |
| 124 | 124 | ||
| 125 | do | 125 | do |
| 126 | with tb | ||
| 127 | [1] = [2]?\func! | ||
| 128 | ["%a-b-c%"] = 123 | ||
| 129 | [ [[x y z]]] = [var] | ||
| 130 | print [ [3]] | ||
| 131 | with [4] | ||
| 132 | [1] = 1 | ||
| 133 | [] = "abc" | ||
| 134 | [] = | ||
| 135 | type: "hello" | ||
| 136 | * name: "xyz" | ||
| 137 | value: 998 | ||
| 138 | |||
| 139 | do | ||
| 126 | global mask | 140 | global mask |
| 127 | with? mask = SolidRect width: w, height: h, color: 0x66000000 | 141 | with? mask = SolidRect width: w, height: h, color: 0x66000000 |
| 128 | .touchEnabled = true | 142 | .touchEnabled = true |
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 | |||
| @@ -165,6 +165,32 @@ do | |||
| 165 | end | 165 | end |
| 166 | do | 166 | do |
| 167 | do | 167 | do |
| 168 | local _with_0 = tb | ||
| 169 | do | ||
| 170 | local _obj_0 = _with_0[2] | ||
| 171 | if _obj_0 ~= nil then | ||
| 172 | _with_0[1] = _obj_0:func() | ||
| 173 | end | ||
| 174 | end | ||
| 175 | _with_0["%a-b-c%"] = 123 | ||
| 176 | _with_0[ [[x y z]]] = _with_0[var] | ||
| 177 | print(_with_0[_with_0[3]]) | ||
| 178 | do | ||
| 179 | local _with_1 = _with_0[4] | ||
| 180 | _with_1[1] = 1 | ||
| 181 | end | ||
| 182 | _with_0[#_with_0 + 1] = "abc" | ||
| 183 | _with_0[#_with_0 + 1] = { | ||
| 184 | type = "hello", | ||
| 185 | { | ||
| 186 | name = "xyz", | ||
| 187 | value = 998 | ||
| 188 | } | ||
| 189 | } | ||
| 190 | end | ||
| 191 | end | ||
| 192 | do | ||
| 193 | do | ||
| 168 | local _with_0 = SolidRect({ | 194 | local _with_0 = SolidRect({ |
| 169 | width = w, | 195 | width = w, |
| 170 | height = h, | 196 | height = h, |
