summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2025-08-29 10:55:21 +0800
committerLi Jin <dragon-fly@qq.com>2025-08-29 10:55:21 +0800
commitf7269a635e31e075c45ec9d10e4c1df5cf9f8a33 (patch)
tree990bc1034b26126a480e4723f52d4a08d389427a
parent5b3dba9c9c62562ce8982113b2fc96a775e73354 (diff)
downloadyuescript-0.29.4.tar.gz
yuescript-0.29.4.tar.bz2
yuescript-0.29.4.zip
Fixed build.v0.29.4
-rw-r--r--spec/outputs/codes_from_doc.lua90
-rw-r--r--spec/outputs/codes_from_doc_zh.lua90
2 files changed, 180 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)
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua
index b54d6d7..de76829 100644
--- a/spec/outputs/codes_from_doc_zh.lua
+++ b/spec/outputs/codes_from_doc_zh.lua
@@ -917,6 +917,36 @@ if func(1, 2, 3, "你好", "世界") then
917 print("hello") 917 print("hello")
918 print("我在if内部") 918 print("我在if内部")
919end 919end
920local f1
921f1 = 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)
925end
926f1({
927 a = 1,
928 b = "2",
929 c = { }
930})
931local f2
932f2 = 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)
945end
946local arg1 = {
947 a = 0
948}
949f2(arg1, arg2)
920f(function() 950f(function()
921 return print("hello") 951 return print("hello")
922end) 952end)
@@ -3320,6 +3350,66 @@ if func(1, 2, 3, "你好", "世界") then
3320 print("你好") 3350 print("你好")
3321 print("我在if内部") 3351 print("我在if内部")
3322end 3352end
3353local f1
3354f1 = 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)
3358end
3359f1({
3360 a = 1,
3361 b = "2",
3362 c = { }
3363})
3364local f2
3365f2 = 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)
3378end
3379local arg1 = {
3380 a = 0
3381}
3382f2(arg1, arg2)
3383local findFirstEven
3384findFirstEven = 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
3397end
3398local findFirstEven
3399findFirstEven = 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
3412end
3323f(function() 3413f(function()
3324 return print("hello") 3414 return print("hello")
3325end) 3415end)