summaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/outputs/codes_from_doc.lua')
-rw-r--r--spec/outputs/codes_from_doc.lua90
1 files changed, 90 insertions, 0 deletions
diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua
index b7d1236..055e79b 100644
--- a/spec/outputs/codes_from_doc.lua
+++ b/spec/outputs/codes_from_doc.lua
@@ -923,6 +923,36 @@ if func(1, 2, 3, "hello", "world") then
923 print("hello") 923 print("hello")
924 print("I am inside if") 924 print("I am inside if")
925end 925end
926local f1
927f1 = 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)
931end
932f1({
933 a = 1,
934 b = "2",
935 c = { }
936})
937local f2
938f2 = 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)
951end
952local arg1 = {
953 a = 0
954}
955f2(arg1, arg2)
926f(function() 956f(function()
927 return print("hello") 957 return print("hello")
928end) 958end)
@@ -3332,6 +3362,66 @@ if func(1, 2, 3, "hello", "world") then
3332 print("hello") 3362 print("hello")
3333 print("I am inside if") 3363 print("I am inside if")
3334end 3364end
3365local f1
3366f1 = 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)
3370end
3371f1({
3372 a = 1,
3373 b = "2",
3374 c = { }
3375})
3376local f2
3377f2 = 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
3389end
3390print(a1, b, c)
3391local arg1 = {
3392 a = 0
3393}
3394f2(arg1, arg2)
3395local findFirstEven
3396findFirstEven = 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
3409end
3410local findFirstEven
3411findFirstEven = 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
3424end
3335f(function() 3425f(function()
3336 return print("hello") 3426 return print("hello")
3337end) 3427end)