diff options
author | Li Jin <dragon-fly@qq.com> | 2025-01-31 23:17:45 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-01-31 23:19:02 +0800 |
commit | d1878f2b8eb1644205c5e0b641fd092e8b222766 (patch) | |
tree | 17f1108e35d845364f928e8f9c2178c7d2d0d902 /spec/outputs/unicode | |
parent | 8124020b3827a8f86970ef8f1efb164e5e110755 (diff) | |
download | yuescript-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/unicode')
-rw-r--r-- | spec/outputs/unicode/ambiguous.lua | 4 | ||||
-rw-r--r-- | spec/outputs/unicode/macro.lua | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/spec/outputs/unicode/ambiguous.lua b/spec/outputs/unicode/ambiguous.lua index ac90016..704b311 100644 --- a/spec/outputs/unicode/ambiguous.lua +++ b/spec/outputs/unicode/ambiguous.lua | |||
@@ -39,9 +39,11 @@ end | |||
39 | do | 39 | do |
40 | _u6253_u5370() | 40 | _u6253_u5370() |
41 | _u5f02_u6b65_u51fd_u6570(function() | 41 | _u5f02_u6b65_u51fd_u6570(function() |
42 | _u6253_u5370(); | 42 | _u6253_u5370() |
43 | do | ||
43 | --[[a comment to insert]] | 44 | --[[a comment to insert]] |
44 | (haha)() | 45 | (haha)() |
46 | end | ||
45 | return nil | 47 | return nil |
46 | end) | 48 | end) |
47 | end | 49 | end |
diff --git a/spec/outputs/unicode/macro.lua b/spec/outputs/unicode/macro.lua index 069f429..e2195e4 100644 --- a/spec/outputs/unicode/macro.lua +++ b/spec/outputs/unicode/macro.lua | |||
@@ -179,13 +179,17 @@ do | |||
179 | _u6253_u5370(_u53d8_u91cfa) | 179 | _u6253_u5370(_u53d8_u91cfa) |
180 | end | 180 | end |
181 | local _u53d8_u91cfx = 0 | 181 | local _u53d8_u91cfx = 0 |
182 | do | ||
182 | local function f(a) | 183 | local function f(a) |
183 | return a + 1 | 184 | return a + 1 |
184 | end | 185 | end |
185 | x = x + f(3) | 186 | x = x + f(3) |
187 | end | ||
188 | do | ||
186 | function tb:func() | 189 | function tb:func() |
187 | print(123) | 190 | print(123) |
188 | end | 191 | end |
192 | end | ||
189 | _u6253_u5370(_u53d8_u91cfx) | 193 | _u6253_u5370(_u53d8_u91cfx) |
190 | local sel | 194 | local sel |
191 | sel = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) | 195 | sel = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) |
@@ -195,6 +199,7 @@ sel = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) | |||
195 | return _u53c2_u6570c | 199 | return _u53c2_u6570c |
196 | end | 200 | end |
197 | end | 201 | end |
202 | do | ||
198 | local function sel(a, b, c) | 203 | local function sel(a, b, c) |
199 | if a then | 204 | if a then |
200 | return b | 205 | return b |
@@ -202,10 +207,15 @@ local function sel(a, b, c) | |||
202 | return c | 207 | return c |
203 | end | 208 | end |
204 | end | 209 | end |
210 | end | ||
211 | do | ||
205 | local function dummy() | 212 | local function dummy() |
206 | 213 | ||
207 | end | 214 | end |
215 | end | ||
216 | do | ||
208 | -- 这有个注释 | 217 | -- 这有个注释 |
218 | end | ||
209 | local _ = require('下划线') | 219 | local _ = require('下划线') |
210 | local _call_0 = (_({ | 220 | local _call_0 = (_({ |
211 | 1, | 221 | 1, |
@@ -275,11 +285,13 @@ do | |||
275 | _6["摧毁"](_6) | 285 | _6["摧毁"](_6) |
276 | end | 286 | end |
277 | end | 287 | end |
288 | do | ||
278 | local _call_0 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] | 289 | local _call_0 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] |
279 | _call_0["父节点"](_call_0):_u540e_u4ee3():_u9009_u62e9_u542f_u7528():_u9009_u62e9_u53ef_u89c1():_u6807_u7b7e_u7b49_u4e8e("fx"):_u5176_u4e2d(function(x) | 290 | _call_0["父节点"](_call_0):_u540e_u4ee3():_u9009_u62e9_u542f_u7528():_u9009_u62e9_u53ef_u89c1():_u6807_u7b7e_u7b49_u4e8e("fx"):_u5176_u4e2d(function(x) |
280 | local _call_0 = x["名称"] | 291 | local _call_0 = x["名称"] |
281 | return _call_0["结尾为"](_call_0, "(克隆)") | 292 | return _call_0["结尾为"](_call_0, "(克隆)") |
282 | end):_u6467_u6bc1() | 293 | end):_u6467_u6bc1() |
294 | end | ||
283 | _u6253_u5370((setmetatable({ | 295 | _u6253_u5370((setmetatable({ |
284 | 'abc', | 296 | 'abc', |
285 | ["字段a"] = 123, | 297 | ["字段a"] = 123, |
@@ -311,7 +323,9 @@ _u6253_u5370((setmetatable({ | |||
311 | })) | 323 | })) |
312 | _u6253_u5370("当前代码行数: " .. tostring(268)) | 324 | _u6253_u5370("当前代码行数: " .. tostring(268)) |
313 | do | 325 | do |
326 | do | ||
314 | -- 待实现 | 327 | -- 待实现 |
328 | end | ||
315 | end | 329 | end |
316 | do | 330 | do |
317 | _u6253_u5370(1) | 331 | _u6253_u5370(1) |