aboutsummaryrefslogtreecommitdiff
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.lua34
1 files changed, 32 insertions, 2 deletions
diff --git a/spec/outputs/codes_from_doc.lua b/spec/outputs/codes_from_doc.lua
index 3b0724a..b8985e7 100644
--- a/spec/outputs/codes_from_doc.lua
+++ b/spec/outputs/codes_from_doc.lua
@@ -107,7 +107,7 @@ if cond then
107end 107end
108end 108end
109print("yuescript") 109print("yuescript")
110print(3) 110print(2)
111print("Valid enum type:", "Static") 111print("Valid enum type:", "Static")
112do 112do
113 print(123, "hello") 113 print(123, "hello")
@@ -992,6 +992,36 @@ local arg1 = {
992 a = 0 992 a = 0
993} 993}
994f2(arg1, arg2) 994f2(arg1, arg2)
995local findFirstEven
996findFirstEven = function(list)
997 for _index_0 = 1, #list do
998 local item = list[_index_0]
999 if type(item) == "table" then
1000 for _index_1 = 1, #item do
1001 local sub = item[_index_1]
1002 if sub % 2 == 0 then
1003 return sub
1004 end
1005 end
1006 end
1007 end
1008 return nil
1009end
1010local findFirstEven
1011findFirstEven = function(list)
1012 for _index_0 = 1, #list do
1013 local item = list[_index_0]
1014 if type(item) == "table" then
1015 for _index_1 = 1, #item do
1016 local sub = item[_index_1]
1017 if sub % 2 == 0 then
1018 return sub
1019 end
1020 end
1021 end
1022 end
1023 return nil
1024end
995local f 1025local f
996f = function(...) 1026f = function(...)
997 local t = { 1027 local t = {
@@ -2637,7 +2667,7 @@ if cond then
2637end 2667end
2638end 2668end
2639print("yuescript") 2669print("yuescript")
2640print(3) 2670print(2)
2641print("Valid enum type:", "Static") 2671print("Valid enum type:", "Static")
2642do 2672do
2643 print(123, "hello") 2673 print(123, "hello")