aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/with.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-11 16:58:21 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-11 16:58:21 +0800
commit663a8c622db13b3a9dad962071ff6f3cfb482de3 (patch)
treebafb5d2bc4a62cf2fa5be6a1a6bb21b0160d1c29 /spec/outputs/with.lua
parentf85c61c5ff06c43d74ccf3233f56c6e5dc576319 (diff)
downloadyuescript-663a8c622db13b3a9dad962071ff6f3cfb482de3.tar.gz
yuescript-663a8c622db13b3a9dad962071ff6f3cfb482de3.tar.bz2
yuescript-663a8c622db13b3a9dad962071ff6f3cfb482de3.zip
Supported multiple break values. Simplified some generated codes.
Diffstat (limited to 'spec/outputs/with.lua')
-rw-r--r--spec/outputs/with.lua50
1 files changed, 19 insertions, 31 deletions
diff --git a/spec/outputs/with.lua b/spec/outputs/with.lua
index 3cd8aab..ce0e495 100644
--- a/spec/outputs/with.lua
+++ b/spec/outputs/with.lua
@@ -191,62 +191,52 @@ do
191 f((function() 191 f((function()
192 local _with_0 = item 192 local _with_0 = item
193 local _val_0 193 local _val_0
194 do 194 repeat
195 local _accum_0 195 if _with_0.id > 0 then
196 repeat 196 _val_0 = _with_0.content
197 if _with_0.id > 0 then 197 break
198 _accum_0 = _with_0.content 198 end
199 break 199 until true
200 end
201 until true
202 _val_0 = _accum_0
203 end
204 return _val_0 200 return _val_0
205 end)()) 201 end)())
206 local a 202 local a
207 do 203 do
208 local _with_0 = tb 204 local _with_0 = tb
209 do 205 repeat
210 local _accum_0 206 if _with_0.v then
211 repeat 207 a = _with_0.a
212 if _with_0.v then 208 break
213 _accum_0 = _with_0.a 209 end
214 break 210 until true
215 end
216 until true
217 a = _accum_0
218 end
219 end 211 end
220 local _accum_0 212 local _val_0
221 while true do 213 while true do
222 local _with_0 = tb 214 local _with_0 = tb
223 local _accum_1 215 local _accum_0 = { }
224 repeat 216 repeat
225 if _with_0 ~= nil then 217 if _with_0 ~= nil then
226 _accum_1 = 1 218 _val_0 = 1
227 break 219 break
228 end 220 end
229 until true 221 until true
230 _accum_0 = _accum_1 222 _val_0 = _accum_0
231 break 223 break
232 end 224 end
233 a = _accum_0 225 a = _val_0
234end 226end
235do 227do
236 local a 228 local a
237 local _accum_0
238 for i = 1, 100 do 229 for i = 1, 100 do
239 local x = tb[i] 230 local x = tb[i]
240 if x ~= nil then 231 if x ~= nil then
241 local _des_0 = 1 232 local _des_0 = 1
242 if _des_0 then 233 if _des_0 then
243 x.id = _des_0 234 x.id = _des_0
244 _accum_0 = x 235 a = x
245 break 236 break
246 end 237 end
247 end 238 end
248 end 239 end
249 a = _accum_0
250end 240end
251do 241do
252 local tb = { 242 local tb = {
@@ -254,11 +244,9 @@ do
254 y = 2 244 y = 2
255 } 245 }
256 local a 246 local a
257 local _accum_0
258 repeat 247 repeat
259 _accum_0 = tb.x + tb.y 248 a = tb.x + tb.y
260 break 249 break
261 until true 250 until true
262 a = _accum_0
263end 251end
264return nil 252return nil