diff options
Diffstat (limited to 'spec/outputs')
-rw-r--r-- | spec/outputs/assign.lua | 25 | ||||
-rw-r--r-- | spec/outputs/codes_from_doc.lua | 18 | ||||
-rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 18 | ||||
-rw-r--r-- | spec/outputs/macro.lua | 24 | ||||
-rw-r--r-- | spec/outputs/plus.lua | 3 | ||||
-rw-r--r-- | spec/outputs/unicode/macro.lua | 6 | ||||
-rw-r--r-- | spec/outputs/unicode/plus.lua | 3 |
7 files changed, 49 insertions, 48 deletions
diff --git a/spec/outputs/assign.lua b/spec/outputs/assign.lua index 162a563..f889865 100644 --- a/spec/outputs/assign.lua +++ b/spec/outputs/assign.lua | |||
@@ -181,5 +181,30 @@ return _(function() | |||
181 | local b = val | 181 | local b = val |
182 | local c = val | 182 | local c = val |
183 | end | 183 | end |
184 | do | ||
185 | local a = a .. "abc" | ||
186 | a = a // 2 | ||
187 | a = a or def | ||
188 | a = a and false | ||
189 | a = a >> 10 | ||
190 | a = a << 10 | ||
191 | local _obj_0 = a.b | ||
192 | if _obj_0.c == nil then | ||
193 | _obj_0.c = 123 | ||
194 | end | ||
195 | local _obj_1 = a.b | ||
196 | _obj_1.c = _obj_1.c + 1 | ||
197 | local _obj_2 = a.b | ||
198 | _obj_2.c = _obj_2.c - 2 | ||
199 | local _obj_3 = a.b | ||
200 | _obj_3.c = _obj_3.c * 3 | ||
201 | local _obj_4 = a.b | ||
202 | _obj_4.c = _obj_4.c / 4 | ||
203 | local _obj_5 = a.b | ||
204 | _obj_5.c = _obj_5.c % 5 | ||
205 | a = a & 6 | ||
206 | a = a | 7 | ||
207 | a = a ^ 8 | ||
208 | end | ||
184 | return nil | 209 | return nil |
185 | end) | 210 | end) |
diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua index 74db469..a37b459 100644 --- a/spec/outputs/codes_from_doc.lua +++ b/spec/outputs/codes_from_doc.lua | |||
@@ -467,8 +467,7 @@ local x = f() | |||
467 | local y = x | 467 | local y = x |
468 | local z = x | 468 | local z = x |
469 | do | 469 | do |
470 | local a | 470 | local a = 1 |
471 | a = 1 | ||
472 | local x, y, z | 471 | local x, y, z |
473 | print("forward declare all variables as locals") | 472 | print("forward declare all variables as locals") |
474 | x = function() | 473 | x = function() |
@@ -478,8 +477,7 @@ do | |||
478 | instance = Item:new() | 477 | instance = Item:new() |
479 | end | 478 | end |
480 | do | 479 | do |
481 | local X | 480 | local X = 1 |
482 | X = 1 | ||
483 | local B | 481 | local B |
484 | print("only forward declare upper case variables") | 482 | print("only forward declare upper case variables") |
485 | local a = 1 | 483 | local a = 1 |
@@ -499,8 +497,7 @@ do | |||
499 | print("only declare upper case variables as globals") | 497 | print("only declare upper case variables as globals") |
500 | local a = 1 | 498 | local a = 1 |
501 | local B = 2 | 499 | local B = 2 |
502 | local Temp | 500 | local Temp = "a local value" |
503 | Temp = "a local value" | ||
504 | end | 501 | end |
505 | local thing = { | 502 | local thing = { |
506 | 1, | 503 | 1, |
@@ -2478,8 +2475,7 @@ local x = f() | |||
2478 | local y = x | 2475 | local y = x |
2479 | local z = x | 2476 | local z = x |
2480 | do | 2477 | do |
2481 | local a | 2478 | local a = 1 |
2482 | a = 1 | ||
2483 | local x, y, z | 2479 | local x, y, z |
2484 | print("forward declare all variables as locals") | 2480 | print("forward declare all variables as locals") |
2485 | x = function() | 2481 | x = function() |
@@ -2489,8 +2485,7 @@ do | |||
2489 | instance = Item:new() | 2485 | instance = Item:new() |
2490 | end | 2486 | end |
2491 | do | 2487 | do |
2492 | local X | 2488 | local X = 1 |
2493 | X = 1 | ||
2494 | local B | 2489 | local B |
2495 | print("only forward declare upper case variables") | 2490 | print("only forward declare upper case variables") |
2496 | local a = 1 | 2491 | local a = 1 |
@@ -2510,8 +2505,7 @@ do | |||
2510 | print("only declare upper case variables as globals") | 2505 | print("only declare upper case variables as globals") |
2511 | local a = 1 | 2506 | local a = 1 |
2512 | local B = 2 | 2507 | local B = 2 |
2513 | local Temp | 2508 | local Temp = "a local value" |
2514 | Temp = "a local value" | ||
2515 | end | 2509 | end |
2516 | local thing = { | 2510 | local thing = { |
2517 | 1, | 2511 | 1, |
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index 1a10555..a23044d 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua | |||
@@ -467,8 +467,7 @@ local x = f() | |||
467 | local y = x | 467 | local y = x |
468 | local z = x | 468 | local z = x |
469 | do | 469 | do |
470 | local a | 470 | local a = 1 |
471 | a = 1 | ||
472 | local x, y, z | 471 | local x, y, z |
473 | print("预先声明后续所有变量为局部变量") | 472 | print("预先声明后续所有变量为局部变量") |
474 | x = function() | 473 | x = function() |
@@ -478,8 +477,7 @@ do | |||
478 | instance = Item:new() | 477 | instance = Item:new() |
479 | end | 478 | end |
480 | do | 479 | do |
481 | local X | 480 | local X = 1 |
482 | X = 1 | ||
483 | local B | 481 | local B |
484 | print("只预先声明后续大写的变量为局部变量") | 482 | print("只预先声明后续大写的变量为局部变量") |
485 | local a = 1 | 483 | local a = 1 |
@@ -499,8 +497,7 @@ do | |||
499 | print("只预先声明大写的变量为全局变量") | 497 | print("只预先声明大写的变量为全局变量") |
500 | local a = 1 | 498 | local a = 1 |
501 | local B = 2 | 499 | local B = 2 |
502 | local Temp | 500 | local Temp = "一个局部值" |
503 | Temp = "一个局部值" | ||
504 | end | 501 | end |
505 | local thing = { | 502 | local thing = { |
506 | 1, | 503 | 1, |
@@ -2472,8 +2469,7 @@ local x = f() | |||
2472 | local y = x | 2469 | local y = x |
2473 | local z = x | 2470 | local z = x |
2474 | do | 2471 | do |
2475 | local a | 2472 | local a = 1 |
2476 | a = 1 | ||
2477 | local x, y, z | 2473 | local x, y, z |
2478 | print("预先声明后续所有变量为局部变量") | 2474 | print("预先声明后续所有变量为局部变量") |
2479 | x = function() | 2475 | x = function() |
@@ -2483,8 +2479,7 @@ do | |||
2483 | instance = Item:new() | 2479 | instance = Item:new() |
2484 | end | 2480 | end |
2485 | do | 2481 | do |
2486 | local X | 2482 | local X = 1 |
2487 | X = 1 | ||
2488 | local B | 2483 | local B |
2489 | print("只预先声明后续大写的变量为局部变量") | 2484 | print("只预先声明后续大写的变量为局部变量") |
2490 | local a = 1 | 2485 | local a = 1 |
@@ -2504,8 +2499,7 @@ do | |||
2504 | print("只预先声明大写的变量为全局变量") | 2499 | print("只预先声明大写的变量为全局变量") |
2505 | local a = 1 | 2500 | local a = 1 |
2506 | local B = 2 | 2501 | local B = 2 |
2507 | local Temp | 2502 | local Temp = "一个局部值" |
2508 | Temp = "一个局部值" | ||
2509 | end | 2503 | end |
2510 | local thing = { | 2504 | local thing = { |
2511 | 1, | 2505 | 1, |
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua index aa74ed9..4d31574 100644 --- a/spec/outputs/macro.lua +++ b/spec/outputs/macro.lua | |||
@@ -191,13 +191,11 @@ end | |||
191 | do | 191 | do |
192 | local a = 8 | 192 | local a = 8 |
193 | a = (function() | 193 | a = (function() |
194 | local a | 194 | local a = 1 |
195 | a = 1 | ||
196 | return a + 1 | 195 | return a + 1 |
197 | end)() | 196 | end)() |
198 | a = a + (function() | 197 | a = a + (function() |
199 | local a | 198 | local a = 1 |
200 | a = 1 | ||
201 | return a + 1 | 199 | return a + 1 |
202 | end)() | 200 | end)() |
203 | print(a) | 201 | print(a) |
@@ -274,18 +272,12 @@ local result = ((((((origin.transform.root.gameObject:Parents()):Descendants()): | |||
274 | end)):Destroy() | 272 | end)):Destroy() |
275 | do | 273 | do |
276 | do | 274 | do |
277 | local _1 | 275 | local _1 = origin.transform.root.gameObject:Parents() |
278 | _1 = origin.transform.root.gameObject:Parents() | 276 | local _2 = _1:Descendants() |
279 | local _2 | 277 | local _3 = _2:SelectEnable() |
280 | _2 = _1:Descendants() | 278 | local _4 = _3:SelectVisible() |
281 | local _3 | 279 | local _5 = _4:TagEqual("fx") |
282 | _3 = _2:SelectEnable() | 280 | local _6 = _5:Where(function(x) |
283 | local _4 | ||
284 | _4 = _3:SelectVisible() | ||
285 | local _5 | ||
286 | _5 = _4:TagEqual("fx") | ||
287 | local _6 | ||
288 | _6 = _5:Where(function(x) | ||
289 | return x.name:EndsWith("(Clone)") | 281 | return x.name:EndsWith("(Clone)") |
290 | end) | 282 | end) |
291 | _6:Destroy() | 283 | _6:Destroy() |
diff --git a/spec/outputs/plus.lua b/spec/outputs/plus.lua index bd89bfe..dda0660 100644 --- a/spec/outputs/plus.lua +++ b/spec/outputs/plus.lua | |||
@@ -65,7 +65,6 @@ backpack = { | |||
65 | local start = { | 65 | local start = { |
66 | something = "cold" | 66 | something = "cold" |
67 | } | 67 | } |
68 | local bathe | 68 | local bathe = { |
69 | bathe = { | ||
70 | on = "fire" | 69 | on = "fire" |
71 | } | 70 | } |
diff --git a/spec/outputs/unicode/macro.lua b/spec/outputs/unicode/macro.lua index e2195e4..099080f 100644 --- a/spec/outputs/unicode/macro.lua +++ b/spec/outputs/unicode/macro.lua | |||
@@ -167,13 +167,11 @@ end | |||
167 | do | 167 | do |
168 | local _u53d8_u91cfa = 8 | 168 | local _u53d8_u91cfa = 8 |
169 | _u53d8_u91cfa = (function() | 169 | _u53d8_u91cfa = (function() |
170 | local _u53d8_u91cfa | 170 | local _u53d8_u91cfa = 1 |
171 | _u53d8_u91cfa = 1 | ||
172 | return _u53d8_u91cfa + 1 | 171 | return _u53d8_u91cfa + 1 |
173 | end)() | 172 | end)() |
174 | _u53d8_u91cfa = _u53d8_u91cfa + (function() | 173 | _u53d8_u91cfa = _u53d8_u91cfa + (function() |
175 | local _u53d8_u91cfa | 174 | local _u53d8_u91cfa = 1 |
176 | _u53d8_u91cfa = 1 | ||
177 | return _u53d8_u91cfa + 1 | 175 | return _u53d8_u91cfa + 1 |
178 | end)() | 176 | end)() |
179 | _u6253_u5370(_u53d8_u91cfa) | 177 | _u6253_u5370(_u53d8_u91cfa) |
diff --git a/spec/outputs/unicode/plus.lua b/spec/outputs/unicode/plus.lua index 75e4aac..adce62e 100644 --- a/spec/outputs/unicode/plus.lua +++ b/spec/outputs/unicode/plus.lua | |||
@@ -67,7 +67,6 @@ _u80cc_u5305 = { | |||
67 | local _u5f00_u59cb = { | 67 | local _u5f00_u59cb = { |
68 | ["东西"] = "冷" | 68 | ["东西"] = "冷" |
69 | } | 69 | } |
70 | local _u6d17_u6fa1 | 70 | local _u6d17_u6fa1 = { |
71 | _u6d17_u6fa1 = { | ||
72 | ["在"] = "火" | 71 | ["在"] = "火" |
73 | } | 72 | } |