diff options
Diffstat (limited to 'spec/outputs/codes_from_doc_zh.lua')
| -rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 34 |
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 | |||
| 107 | end | 107 | end |
| 108 | end | 108 | end |
| 109 | print("yuescript") | 109 | print("yuescript") |
| 110 | print(3) | 110 | print(2) |
| 111 | print("有效的枚举类型:", "Static") | 111 | print("有效的枚举类型:", "Static") |
| 112 | do | 112 | do |
| 113 | print(123, "hello") | 113 | print(123, "hello") |
| @@ -986,6 +986,36 @@ local arg1 = { | |||
| 986 | a = 0 | 986 | a = 0 |
| 987 | } | 987 | } |
| 988 | f2(arg1, arg2) | 988 | f2(arg1, arg2) |
| 989 | local findFirstEven | ||
| 990 | findFirstEven = 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 | ||
| 1003 | end | ||
| 1004 | local findFirstEven | ||
| 1005 | findFirstEven = 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 | ||
| 1018 | end | ||
| 989 | local f | 1019 | local f |
| 990 | f = function(...) | 1020 | f = function(...) |
| 991 | local t = { | 1021 | local t = { |
| @@ -2631,7 +2661,7 @@ if cond then | |||
| 2631 | end | 2661 | end |
| 2632 | end | 2662 | end |
| 2633 | print("yuescript") | 2663 | print("yuescript") |
| 2634 | print(3) | 2664 | print(2) |
| 2635 | print("有效的枚举类型:", "Static") | 2665 | print("有效的枚举类型:", "Static") |
| 2636 | do | 2666 | do |
| 2637 | print(123, "hello") | 2667 | print(123, "hello") |
