aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/macro.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2025-01-31 23:17:45 +0800
committerLi Jin <dragon-fly@qq.com>2025-01-31 23:19:02 +0800
commitd1878f2b8eb1644205c5e0b641fd092e8b222766 (patch)
tree17f1108e35d845364f928e8f9c2178c7d2d0d902 /spec/outputs/macro.lua
parent8124020b3827a8f86970ef8f1efb164e5e110755 (diff)
downloadyuescript-0.27.0.tar.gz
yuescript-0.27.0.tar.bz2
yuescript-0.27.0.zip
Aligned Lua inserter macro behavior with common Yue macro.v0.27.0
Diffstat (limited to 'spec/outputs/macro.lua')
-rw-r--r--spec/outputs/macro.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua
index 7163077..aa74ed9 100644
--- a/spec/outputs/macro.lua
+++ b/spec/outputs/macro.lua
@@ -5,7 +5,9 @@ do
5 end 5 end
6 print(456) 6 print(456)
7 do 7 do
8 do
8-- TODO: "todo in a do block" 9-- TODO: "todo in a do block"
10 end
9 end 11 end
10end 12end
11do 13do
@@ -201,13 +203,17 @@ do
201 print(a) 203 print(a)
202end 204end
203local x = 0 205local x = 0
206do
204local function f(a) 207local function f(a)
205 return a + 1 208 return a + 1
206end 209end
207x = x + f(3) 210x = x + f(3)
211end
212do
208function tb:func() 213function tb:func()
209 print(123) 214 print(123)
210end 215end
216end
211print(x) 217print(x)
212local sel 218local sel
213sel = function(a, b, c) 219sel = function(a, b, c)
@@ -217,6 +223,7 @@ sel = function(a, b, c)
217 return c 223 return c
218 end 224 end
219end 225end
226do
220local function sel(a, b, c) 227local function sel(a, b, c)
221 if a then 228 if a then
222 return b 229 return b
@@ -224,10 +231,15 @@ local function sel(a, b, c)
224 return c 231 return c
225 end 232 end
226end 233end
234end
235do
227local function dummy() 236local function dummy()
228 237
229end 238end
239end
240do
230-- a comment here 241-- a comment here
242end
231local _ = require('underscore') 243local _ = require('underscore')
232local a = ((((_({ 244local a = ((((_({
233 1, 245 1,
@@ -279,9 +291,11 @@ do
279 _6:Destroy() 291 _6:Destroy()
280 end 292 end
281end 293end
294do
282origin.transform.root.gameObject:Parents():Descendants():SelectEnable():SelectVisible():TagEqual("fx"):Where(function(x) 295origin.transform.root.gameObject:Parents():Descendants():SelectEnable():SelectVisible():TagEqual("fx"):Where(function(x)
283 return x.name:EndsWith("(Clone)") 296 return x.name:EndsWith("(Clone)")
284end):Destroy() 297end):Destroy()
298end
285print((setmetatable({ 299print((setmetatable({
286 'abc', 300 'abc',
287 a = 123, 301 a = 123,
@@ -313,7 +327,9 @@ print((setmetatable({
313})) 327}))
314print("current line: " .. tostring(323)) 328print("current line: " .. tostring(323))
315do 329do
330 do
316-- TODO 331-- TODO
332 end
317end 333end
318do 334do
319 print(1) 335 print(1)
@@ -336,7 +352,9 @@ do
336 end 352 end
337 local f1 353 local f1
338 f1 = function() 354 f1 = function()
355 do
339tb:func(123) 356tb:func(123)
357 end
340 return 358 return
341 end 359 end
342end 360end