Skip to content

Commit f7269a6

Browse files
committed
Fixed build.
1 parent 5b3dba9 commit f7269a6

File tree

2 files changed

+180
-0
lines changed

2 files changed

+180
-0
lines changed

spec/outputs/codes_from_doc.lua

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,36 @@ if func(1, 2, 3, "hello", "world") then
923923
print("hello")
924924
print("I am inside if")
925925
end
926+
local f1
927+
f1 = function(_arg_0)
928+
local a, b, c
929+
a, b, c = _arg_0.a, _arg_0.b, _arg_0.c
930+
return print(a, b, c)
931+
end
932+
f1({
933+
a = 1,
934+
b = "2",
935+
c = { }
936+
})
937+
local f2
938+
f2 = function(_arg_0, c)
939+
local a1, b
940+
a1, b = _arg_0.a, _arg_0.b
941+
if a1 == nil then
942+
a1 = 123
943+
end
944+
if b == nil then
945+
b = 'abc'
946+
end
947+
if c == nil then
948+
c = { }
949+
end
950+
return print(a1, b, c)
951+
end
952+
local arg1 = {
953+
a = 0
954+
}
955+
f2(arg1, arg2)
926956
f(function()
927957
return print("hello")
928958
end)
@@ -3332,6 +3362,66 @@ if func(1, 2, 3, "hello", "world") then
33323362
print("hello")
33333363
print("I am inside if")
33343364
end
3365+
local f1
3366+
f1 = function(_arg_0)
3367+
local a, b, c
3368+
a, b, c = _arg_0.a, _arg_0.b, _arg_0.c
3369+
return print(a, b, c)
3370+
end
3371+
f1({
3372+
a = 1,
3373+
b = "2",
3374+
c = { }
3375+
})
3376+
local f2
3377+
f2 = function(_arg_0, c)
3378+
local a1, b
3379+
a1, b = _arg_0.a, _arg_0.b
3380+
if a1 == nil then
3381+
a1 = 123
3382+
end
3383+
if b == nil then
3384+
b = 'abc'
3385+
end
3386+
if c == nil then
3387+
c = { }
3388+
end
3389+
end
3390+
print(a1, b, c)
3391+
local arg1 = {
3392+
a = 0
3393+
}
3394+
f2(arg1, arg2)
3395+
local findFirstEven
3396+
findFirstEven = function(list)
3397+
for _index_0 = 1, #list do
3398+
local item = list[_index_0]
3399+
if type(item) == "table" then
3400+
for _index_1 = 1, #item do
3401+
local sub = item[_index_1]
3402+
if sub % 2 == 0 then
3403+
return sub
3404+
end
3405+
end
3406+
end
3407+
end
3408+
return nil
3409+
end
3410+
local findFirstEven
3411+
findFirstEven = function(list)
3412+
for _index_0 = 1, #list do
3413+
local item = list[_index_0]
3414+
if type(item) == "table" then
3415+
for _index_1 = 1, #item do
3416+
local sub = item[_index_1]
3417+
if sub % 2 == 0 then
3418+
return sub
3419+
end
3420+
end
3421+
end
3422+
end
3423+
return nil
3424+
end
33353425
f(function()
33363426
return print("hello")
33373427
end)

spec/outputs/codes_from_doc_zh.lua

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,36 @@ if func(1, 2, 3, "你好", "世界") then
917917
print("hello")
918918
print("我在if内部")
919919
end
920+
local f1
921+
f1 = function(_arg_0)
922+
local a, b, c
923+
a, b, c = _arg_0.a, _arg_0.b, _arg_0.c
924+
return print(a, b, c)
925+
end
926+
f1({
927+
a = 1,
928+
b = "2",
929+
c = { }
930+
})
931+
local f2
932+
f2 = function(_arg_0, c)
933+
local a1, b
934+
a1, b = _arg_0.a, _arg_0.b
935+
if a1 == nil then
936+
a1 = 123
937+
end
938+
if b == nil then
939+
b = 'abc'
940+
end
941+
if c == nil then
942+
c = { }
943+
end
944+
return print(a1, b, c)
945+
end
946+
local arg1 = {
947+
a = 0
948+
}
949+
f2(arg1, arg2)
920950
f(function()
921951
return print("hello")
922952
end)
@@ -3320,6 +3350,66 @@ if func(1, 2, 3, "你好", "世界") then
33203350
print("你好")
33213351
print("我在if内部")
33223352
end
3353+
local f1
3354+
f1 = function(_arg_0)
3355+
local a, b, c
3356+
a, b, c = _arg_0.a, _arg_0.b, _arg_0.c
3357+
return print(a, b, c)
3358+
end
3359+
f1({
3360+
a = 1,
3361+
b = "2",
3362+
c = { }
3363+
})
3364+
local f2
3365+
f2 = function(_arg_0, c)
3366+
local a1, b
3367+
a1, b = _arg_0.a, _arg_0.b
3368+
if a1 == nil then
3369+
a1 = 123
3370+
end
3371+
if b == nil then
3372+
b = 'abc'
3373+
end
3374+
if c == nil then
3375+
c = { }
3376+
end
3377+
return print(a1, b, c)
3378+
end
3379+
local arg1 = {
3380+
a = 0
3381+
}
3382+
f2(arg1, arg2)
3383+
local findFirstEven
3384+
findFirstEven = function(list)
3385+
for _index_0 = 1, #list do
3386+
local item = list[_index_0]
3387+
if type(item) == "table" then
3388+
for _index_1 = 1, #item do
3389+
local sub = item[_index_1]
3390+
if sub % 2 == 0 then
3391+
return sub
3392+
end
3393+
end
3394+
end
3395+
end
3396+
return nil
3397+
end
3398+
local findFirstEven
3399+
findFirstEven = function(list)
3400+
for _index_0 = 1, #list do
3401+
local item = list[_index_0]
3402+
if type(item) == "table" then
3403+
for _index_1 = 1, #item do
3404+
local sub = item[_index_1]
3405+
if sub % 2 == 0 then
3406+
return sub
3407+
end
3408+
end
3409+
end
3410+
end
3411+
return nil
3412+
end
33233413
f(function()
33243414
return print("hello")
33253415
end)

0 commit comments

Comments
 (0)