File tree Expand file tree Collapse file tree 12 files changed +123
-82
lines changed Expand file tree Collapse file tree 12 files changed +123
-82
lines changed Original file line number Diff line number Diff line change 1
1
MIT License
2
2
3
- Copyright (c) 2017-2025 Li Jin
3
+ Copyright (c) 2017-2025 Li Jin <dragon-fly@qq.com>
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 109
109
val = 123
110
110
a = b = c = val
111
111
112
+ do
113
+ -- update
114
+ a ..= "abc"
115
+ a //= 2
116
+ a or= def
117
+ a and= false
118
+ a >>= 10
119
+ a <<= 10
120
+ a.b.c ??= 123
121
+ a.b.c += 1
122
+ a.b.c -= 2
123
+ a.b.c *= 3
124
+ a.b.c /= 4
125
+ a.b.c %= 5
126
+ a &= 6
127
+ a |= 7
128
+ a ^= 8
129
+
112
130
nil
Original file line number Diff line number Diff line change @@ -181,5 +181,30 @@ return _(function()
181
181
local b = val
182
182
local c = val
183
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
209
return nil
185
210
end )
Original file line number Diff line number Diff line change @@ -467,8 +467,7 @@ local x = f()
467
467
local y = x
468
468
local z = x
469
469
do
470
- local a
471
- a = 1
470
+ local a = 1
472
471
local x , y , z
473
472
print (" forward declare all variables as locals" )
474
473
x = function ()
478
477
instance = Item :new ()
479
478
end
480
479
do
481
- local X
482
- X = 1
480
+ local X = 1
483
481
local B
484
482
print (" only forward declare upper case variables" )
485
483
local a = 1
499
497
print (" only declare upper case variables as globals" )
500
498
local a = 1
501
499
local B = 2
502
- local Temp
503
- Temp = " a local value"
500
+ local Temp = " a local value"
504
501
end
505
502
local thing = {
506
503
1 ,
@@ -2478,8 +2475,7 @@ local x = f()
2478
2475
local y = x
2479
2476
local z = x
2480
2477
do
2481
- local a
2482
- a = 1
2478
+ local a = 1
2483
2479
local x , y , z
2484
2480
print (" forward declare all variables as locals" )
2485
2481
x = function ()
2489
2485
instance = Item :new ()
2490
2486
end
2491
2487
do
2492
- local X
2493
- X = 1
2488
+ local X = 1
2494
2489
local B
2495
2490
print (" only forward declare upper case variables" )
2496
2491
local a = 1
2510
2505
print (" only declare upper case variables as globals" )
2511
2506
local a = 1
2512
2507
local B = 2
2513
- local Temp
2514
- Temp = " a local value"
2508
+ local Temp = " a local value"
2515
2509
end
2516
2510
local thing = {
2517
2511
1 ,
Original file line number Diff line number Diff line change @@ -467,8 +467,7 @@ local x = f()
467
467
local y = x
468
468
local z = x
469
469
do
470
- local a
471
- a = 1
470
+ local a = 1
472
471
local x , y , z
473
472
print (" 预先声明后续所有变量为局部变量" )
474
473
x = function ()
478
477
instance = Item :new ()
479
478
end
480
479
do
481
- local X
482
- X = 1
480
+ local X = 1
483
481
local B
484
482
print (" 只预先声明后续大写的变量为局部变量" )
485
483
local a = 1
499
497
print (" 只预先声明大写的变量为全局变量" )
500
498
local a = 1
501
499
local B = 2
502
- local Temp
503
- Temp = " 一个局部值"
500
+ local Temp = " 一个局部值"
504
501
end
505
502
local thing = {
506
503
1 ,
@@ -2472,8 +2469,7 @@ local x = f()
2472
2469
local y = x
2473
2470
local z = x
2474
2471
do
2475
- local a
2476
- a = 1
2472
+ local a = 1
2477
2473
local x , y , z
2478
2474
print (" 预先声明后续所有变量为局部变量" )
2479
2475
x = function ()
2483
2479
instance = Item :new ()
2484
2480
end
2485
2481
do
2486
- local X
2487
- X = 1
2482
+ local X = 1
2488
2483
local B
2489
2484
print (" 只预先声明后续大写的变量为局部变量" )
2490
2485
local a = 1
2504
2499
print (" 只预先声明大写的变量为全局变量" )
2505
2500
local a = 1
2506
2501
local B = 2
2507
- local Temp
2508
- Temp = " 一个局部值"
2502
+ local Temp = " 一个局部值"
2509
2503
end
2510
2504
local thing = {
2511
2505
1 ,
Original file line number Diff line number Diff line change @@ -191,13 +191,11 @@ end
191
191
do
192
192
local a = 8
193
193
a = (function ()
194
- local a
195
- a = 1
194
+ local a = 1
196
195
return a + 1
197
196
end )()
198
197
a = a + (function ()
199
- local a
200
- a = 1
198
+ local a = 1
201
199
return a + 1
202
200
end )()
203
201
print (a )
@@ -274,18 +272,12 @@ local result = ((((((origin.transform.root.gameObject:Parents()):Descendants()):
274
272
end )):Destroy ()
275
273
do
276
274
do
277
- local _1
278
- _1 = origin .transform .root .gameObject :Parents ()
279
- local _2
280
- _2 = _1 :Descendants ()
281
- local _3
282
- _3 = _2 :SelectEnable ()
283
- local _4
284
- _4 = _3 :SelectVisible ()
285
- local _5
286
- _5 = _4 :TagEqual (" fx" )
287
- local _6
288
- _6 = _5 :Where (function (x )
275
+ local _1 = origin .transform .root .gameObject :Parents ()
276
+ local _2 = _1 :Descendants ()
277
+ local _3 = _2 :SelectEnable ()
278
+ local _4 = _3 :SelectVisible ()
279
+ local _5 = _4 :TagEqual (" fx" )
280
+ local _6 = _5 :Where (function (x )
289
281
return x .name :EndsWith (" (Clone)" )
290
282
end )
291
283
_6 :Destroy ()
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ backpack = {
65
65
local start = {
66
66
something = " cold"
67
67
}
68
- local bathe
69
- bathe = {
68
+ local bathe = {
70
69
on = " fire"
71
70
}
Original file line number Diff line number Diff line change @@ -167,13 +167,11 @@ end
167
167
do
168
168
local _u53d8_u91cfa = 8
169
169
_u53d8_u91cfa = (function ()
170
- local _u53d8_u91cfa
171
- _u53d8_u91cfa = 1
170
+ local _u53d8_u91cfa = 1
172
171
return _u53d8_u91cfa + 1
173
172
end )()
174
173
_u53d8_u91cfa = _u53d8_u91cfa + (function ()
175
- local _u53d8_u91cfa
176
- _u53d8_u91cfa = 1
174
+ local _u53d8_u91cfa = 1
177
175
return _u53d8_u91cfa + 1
178
176
end )()
179
177
_u6253_u5370 (_u53d8_u91cfa )
Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ _u80cc_u5305 = {
67
67
local _u5f00_u59cb = {
68
68
[" 东西" ] = " 冷"
69
69
}
70
- local _u6d17_u6fa1
71
- _u6d17_u6fa1 = {
70
+ local _u6d17_u6fa1 = {
72
71
[" 在" ] = " 火"
73
72
}
You can’t perform that action at this time.
0 commit comments