aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc_zh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/outputs/codes_from_doc_zh.lua')
-rw-r--r--spec/outputs/codes_from_doc_zh.lua34
1 files changed, 32 insertions, 2 deletions
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua
index 89335c9..2aa354e 100644
--- a/spec/outputs/codes_from_doc_zh.lua
+++ b/spec/outputs/codes_from_doc_zh.lua
@@ -107,7 +107,7 @@ if cond then
107end 107end
108end 108end
109print("yuescript") 109print("yuescript")
110print(3) 110print(2)
111print("有效的枚举类型:", "Static") 111print("有效的枚举类型:", "Static")
112do 112do
113 print(123, "hello") 113 print(123, "hello")
@@ -986,6 +986,36 @@ local arg1 = {
986 a = 0 986 a = 0
987} 987}
988f2(arg1, arg2) 988f2(arg1, arg2)
989local findFirstEven
990findFirstEven = function(list)
991 for _index_0 = 1, #list do
992 local item = list[_index_0]
993 if type(item) == "table" then
994 for _index_1 = 1, #item do
995 local sub = item[_index_1]
996 if sub % 2 == 0 then
997 return sub
998 end
999 end
1000 end
1001 end
1002 return nil
1003end
1004local findFirstEven
1005findFirstEven = function(list)
1006 for _index_0 = 1, #list do
1007 local item = list[_index_0]
1008 if type(item) == "table" then
1009 for _index_1 = 1, #item do
1010 local sub = item[_index_1]
1011 if sub % 2 == 0 then
1012 return sub
1013 end
1014 end
1015 end
1016 end
1017 return nil
1018end
989local f 1019local f
990f = function(...) 1020f = function(...)
991 local t = { 1021 local t = {
@@ -2631,7 +2661,7 @@ if cond then
2631end 2661end
2632end 2662end
2633print("yuescript") 2663print("yuescript")
2634print(3) 2664print(2)
2635print("有效的枚举类型:", "Static") 2665print("有效的枚举类型:", "Static")
2636do 2666do
2637 print(123, "hello") 2667 print(123, "hello")