Skip to content

Commit 0ccf440

Browse files
committed
Cleaned up and fixed more comment reserving codes.
1 parent c2a34e3 commit 0ccf440

21 files changed

+330
-123
lines changed

spec/inputs/switch.yue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,18 @@ do
289289

290290
handlePath ["admin", "logs", "view"]
291291

292+
do
293+
_check_cond_expr = (iftyp, n, args) ->
294+
sw = { ct: iftyp, op: op }
295+
why = switch sw
296+
-- woo
297+
when ct: 'if', op: '=='
298+
'never'
299+
when ct: 'if', op: '!='
300+
'always'
301+
when ct: 'unless', op: '=='
302+
'always'
303+
when ct: 'unless', op: '!='
304+
'never'
305+
292306
nil

spec/inputs/whitespace.yue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,52 @@ do
198198
-- two
199199
b: -> -- 2
200200

201+
do
202+
tb = {
203+
204+
-- hello
205+
print 123
206+
-- abc
207+
208+
209+
210+
211+
212+
213+
214+
abc: 1
215+
216+
217+
-- xyz
218+
c: ""
219+
220+
221+
z: 998
222+
223+
<close>: ->
224+
225+
-- hello
226+
<eq>: ->
227+
--[[OK]] --[[OK]]--good
228+
<call>: ->
229+
}
230+
231+
class CY
232+
-- init xa
233+
xa = 1
234+
-- init xb
235+
local xb = 2
236+
237+
-- new
238+
new: => print xa, xb, xc, xd
239+
240+
241+
-- init xc
242+
const xc = 3
243+
244+
-- wait
245+
246+
-- init xd
247+
close xd = <close>: =>
201248

202249
nil

spec/outputs/codes_from_doc_de.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ end), 0, function(a, b)
28202820
return a + b
28212821
end))
28222822
local apple = setmetatable({
2823-
size = 15,
2823+
size = 15
28242824
}, {
28252825
__index = {
28262826
color = 0x00ffff
@@ -2898,7 +2898,7 @@ end), 0, function(a, b)
28982898
return a + b
28992899
end))
29002900
local apple = setmetatable({
2901-
size = 15,
2901+
size = 15
29022902
}, {
29032903
__index = {
29042904
color = 0x00ffff

spec/outputs/codes_from_doc_en.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ end), 0, function(a, b)
28202820
return a + b
28212821
end))
28222822
local apple = setmetatable({
2823-
size = 15,
2823+
size = 15
28242824
}, {
28252825
__index = {
28262826
color = 0x00ffff
@@ -2898,7 +2898,7 @@ end), 0, function(a, b)
28982898
return a + b
28992899
end))
29002900
local apple = setmetatable({
2901-
size = 15,
2901+
size = 15
29022902
}, {
29032903
__index = {
29042904
color = 0x00ffff

spec/outputs/codes_from_doc_id-id.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ end), 0, function(a, b)
28202820
return a + b
28212821
end))
28222822
local apple = setmetatable({
2823-
size = 15,
2823+
size = 15
28242824
}, {
28252825
__index = {
28262826
color = 0x00ffff
@@ -2898,7 +2898,7 @@ end), 0, function(a, b)
28982898
return a + b
28992899
end))
29002900
local apple = setmetatable({
2901-
size = 15,
2901+
size = 15
29022902
}, {
29032903
__index = {
29042904
color = 0x00ffff

spec/outputs/codes_from_doc_pt-br.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ end), 0, function(a, b)
28202820
return a + b
28212821
end))
28222822
local apple = setmetatable({
2823-
size = 15,
2823+
size = 15
28242824
}, {
28252825
__index = {
28262826
color = 0x00ffff
@@ -2898,7 +2898,7 @@ end), 0, function(a, b)
28982898
return a + b
28992899
end))
29002900
local apple = setmetatable({
2901-
size = 15,
2901+
size = 15
29022902
}, {
29032903
__index = {
29042904
color = 0x00ffff

spec/outputs/codes_from_doc_zh.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ end), 0, function(a, b)
28202820
return a + b
28212821
end))
28222822
local apple = setmetatable({
2823-
size = 15,
2823+
size = 15
28242824
}, {
28252825
__index = {
28262826
color = 0x00ffff
@@ -2898,7 +2898,7 @@ end), 0, function(a, b)
28982898
return a + b
28992899
end))
29002900
local apple = setmetatable({
2901-
size = 15,
2901+
size = 15
29022902
}, {
29032903
__index = {
29042904
color = 0x00ffff

spec/outputs/macro.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,28 +301,28 @@ end):Destroy()
301301
end
302302
print((setmetatable({
303303
'abc',
304-
a = 123,
304+
a = 123
305305
}, {
306306
__call = function(self)
307307
return 998
308308
end
309309
}))[1], (setmetatable({
310310
'abc',
311-
a = 123,
311+
a = 123
312312
}, {
313313
__call = function(self)
314314
return 998
315315
end
316316
})).a, (setmetatable({
317317
'abc',
318-
a = 123,
318+
a = 123
319319
}, {
320320
__call = function(self)
321321
return 998
322322
end
323323
}))(), setmetatable({
324324
'abc',
325-
a = 123,
325+
a = 123
326326
}, {
327327
__call = function(self)
328328
return 998

spec/outputs/metatable.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
local a = setmetatable({
2-
close = true,
2+
close = true
33
}, {
44
__close = function(self)
55
return print("out of scope")

spec/outputs/switch.lua

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,4 +777,48 @@ do
777777
"view"
778778
})
779779
end
780+
do
781+
local _check_cond_expr
782+
_check_cond_expr = function(iftyp, n, args)
783+
local sw = {
784+
ct = iftyp,
785+
op = op
786+
}
787+
local why
788+
local _type_0 = type(sw)
789+
local _tab_0 = "table" == _type_0 or "userdata" == _type_0
790+
local _match_0 = false
791+
if _tab_0 then
792+
if 'if' == sw.ct and '==' == sw.op then
793+
_match_0 = true
794+
why = 'never'
795+
end
796+
end
797+
if not _match_0 then
798+
local _match_1 = false
799+
if _tab_0 then
800+
if 'if' == sw.ct and '!=' == sw.op then
801+
_match_1 = true
802+
why = 'always'
803+
end
804+
end
805+
if not _match_1 then
806+
local _match_2 = false
807+
if _tab_0 then
808+
if 'unless' == sw.ct and '==' == sw.op then
809+
_match_2 = true
810+
why = 'always'
811+
end
812+
end
813+
if not _match_2 then
814+
if _tab_0 then
815+
if 'unless' == sw.ct and '!=' == sw.op then
816+
why = 'never'
817+
end
818+
end
819+
end
820+
end
821+
end
822+
end
823+
end
780824
return nil

0 commit comments

Comments
 (0)