diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-15 05:49:13 +0000 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-15 07:36:30 +0000 |
| commit | cf5b1b4a68d762e6e33cac8367611ecea15fa942 (patch) | |
| tree | 25de1a4113d26882c0135e38b7ff166efbc39969 /spec/outputs | |
| parent | ecd8f3bfd07e91d04e0a2d72f4a50f9cc6c75433 (diff) | |
| download | yuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.tar.gz yuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.tar.bz2 yuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.zip | |
- Added goto.md documentation files in all languages (en, de, zh, pt-br, id-id)
- Updated conditionals.md to include goto statement references
- Updated VitePress config to include new goto documentation pages
- Updated makefile for goto documentation compilation
- Added test outputs for goto examples in all languages
- Updated yue.cpp core implementation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'spec/outputs')
| -rw-r--r-- | spec/outputs/codes_from_doc_de.lua | 118 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_en.lua | 118 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_id-id.lua | 118 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_pt-br.lua | 118 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 118 |
5 files changed, 590 insertions, 0 deletions
diff --git a/spec/outputs/codes_from_doc_de.lua b/spec/outputs/codes_from_doc_de.lua index 4c9ba1d..385dbae 100644 --- a/spec/outputs/codes_from_doc_de.lua +++ b/spec/outputs/codes_from_doc_de.lua | |||
| @@ -2966,6 +2966,65 @@ if (function() | |||
| 2966 | end)() then | 2966 | end)() then |
| 2967 | print("Prüfen, ob `a` in einer Liste ist") | 2967 | print("Prüfen, ob `a` in einer Liste ist") |
| 2968 | end | 2968 | end |
| 2969 | local has | ||
| 2970 | do | ||
| 2971 | local _val_0 = "foo" | ||
| 2972 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 2973 | end | ||
| 2974 | if (function() | ||
| 2975 | local _val_0 = a | ||
| 2976 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 2977 | end)() then | ||
| 2978 | print("a ist in der Tabelle") | ||
| 2979 | end | ||
| 2980 | local not_exist | ||
| 2981 | do | ||
| 2982 | local _check_0 = list | ||
| 2983 | local _val_0 = item | ||
| 2984 | local _find_0 = false | ||
| 2985 | for _index_0 = 1, #_check_0 do | ||
| 2986 | local _item_0 = _check_0[_index_0] | ||
| 2987 | if _item_0 == _val_0 then | ||
| 2988 | _find_0 = true | ||
| 2989 | break | ||
| 2990 | end | ||
| 2991 | end | ||
| 2992 | not_exist = not _find_0 | ||
| 2993 | end | ||
| 2994 | local check | ||
| 2995 | check = function() | ||
| 2996 | local _check_0 = table | ||
| 2997 | local _val_0 = value | ||
| 2998 | for _index_0 = 1, #_check_0 do | ||
| 2999 | if _check_0[_index_0] == _val_0 then | ||
| 3000 | return false | ||
| 3001 | end | ||
| 3002 | end | ||
| 3003 | return true | ||
| 3004 | end | ||
| 3005 | local c | ||
| 3006 | do | ||
| 3007 | local _val_0 = a | ||
| 3008 | c = 1 == _val_0 | ||
| 3009 | end | ||
| 3010 | do | ||
| 3011 | local _val_0 = a | ||
| 3012 | c = 1 == _val_0 | ||
| 3013 | end | ||
| 3014 | local _with_0 = tb | ||
| 3015 | do | ||
| 3016 | local _check_0 = _with_0[1] | ||
| 3017 | local _val_0 = a | ||
| 3018 | local _find_0 = false | ||
| 3019 | for _index_0 = 1, #_check_0 do | ||
| 3020 | local _item_0 = _check_0[_index_0] | ||
| 3021 | if _item_0 == _val_0 then | ||
| 3022 | _find_0 = true | ||
| 3023 | break | ||
| 3024 | end | ||
| 3025 | end | ||
| 3026 | c = _find_0 | ||
| 3027 | end | ||
| 2969 | local have_coins = false | 3028 | local have_coins = false |
| 2970 | if have_coins then | 3029 | if have_coins then |
| 2971 | print("Münzen erhalten") | 3030 | print("Münzen erhalten") |
| @@ -3022,6 +3081,65 @@ if (function() | |||
| 3022 | end)() then | 3081 | end)() then |
| 3023 | print("Prüfen, ob `a` in einer Liste ist") | 3082 | print("Prüfen, ob `a` in einer Liste ist") |
| 3024 | end | 3083 | end |
| 3084 | local has | ||
| 3085 | do | ||
| 3086 | local _val_0 = "foo" | ||
| 3087 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 3088 | end | ||
| 3089 | if (function() | ||
| 3090 | local _val_0 = a | ||
| 3091 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 3092 | end)() then | ||
| 3093 | print("a ist in der Tabelle") | ||
| 3094 | end | ||
| 3095 | local not_exist | ||
| 3096 | do | ||
| 3097 | local _check_0 = list | ||
| 3098 | local _val_0 = item | ||
| 3099 | local _find_0 = false | ||
| 3100 | for _index_0 = 1, #_check_0 do | ||
| 3101 | local _item_0 = _check_0[_index_0] | ||
| 3102 | if _item_0 == _val_0 then | ||
| 3103 | _find_0 = true | ||
| 3104 | break | ||
| 3105 | end | ||
| 3106 | end | ||
| 3107 | not_exist = not _find_0 | ||
| 3108 | end | ||
| 3109 | local check | ||
| 3110 | check = function() | ||
| 3111 | local _check_0 = table | ||
| 3112 | local _val_0 = value | ||
| 3113 | for _index_0 = 1, #_check_0 do | ||
| 3114 | if _check_0[_index_0] == _val_0 then | ||
| 3115 | return false | ||
| 3116 | end | ||
| 3117 | end | ||
| 3118 | return true | ||
| 3119 | end | ||
| 3120 | local c | ||
| 3121 | do | ||
| 3122 | local _val_0 = a | ||
| 3123 | c = 1 == _val_0 | ||
| 3124 | end | ||
| 3125 | do | ||
| 3126 | local _val_0 = a | ||
| 3127 | c = 1 == _val_0 | ||
| 3128 | end | ||
| 3129 | local _with_0 = tb | ||
| 3130 | do | ||
| 3131 | local _check_0 = _with_0[1] | ||
| 3132 | local _val_0 = a | ||
| 3133 | local _find_0 = false | ||
| 3134 | for _index_0 = 1, #_check_0 do | ||
| 3135 | local _item_0 = _check_0[_index_0] | ||
| 3136 | if _item_0 == _val_0 then | ||
| 3137 | _find_0 = true | ||
| 3138 | break | ||
| 3139 | end | ||
| 3140 | end | ||
| 3141 | c = _find_0 | ||
| 3142 | end | ||
| 3025 | for i = 10, 20 do | 3143 | for i = 10, 20 do |
| 3026 | print(i) | 3144 | print(i) |
| 3027 | end | 3145 | end |
diff --git a/spec/outputs/codes_from_doc_en.lua b/spec/outputs/codes_from_doc_en.lua index 6d822e1..2d9c8cf 100644 --- a/spec/outputs/codes_from_doc_en.lua +++ b/spec/outputs/codes_from_doc_en.lua | |||
| @@ -2966,6 +2966,65 @@ if (function() | |||
| 2966 | end)() then | 2966 | end)() then |
| 2967 | print("checking if `a` is in a list") | 2967 | print("checking if `a` is in a list") |
| 2968 | end | 2968 | end |
| 2969 | local has | ||
| 2970 | do | ||
| 2971 | local _val_0 = "foo" | ||
| 2972 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 2973 | end | ||
| 2974 | if (function() | ||
| 2975 | local _val_0 = a | ||
| 2976 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 2977 | end)() then | ||
| 2978 | print("a is in the table") | ||
| 2979 | end | ||
| 2980 | local not_exist | ||
| 2981 | do | ||
| 2982 | local _check_0 = list | ||
| 2983 | local _val_0 = item | ||
| 2984 | local _find_0 = false | ||
| 2985 | for _index_0 = 1, #_check_0 do | ||
| 2986 | local _item_0 = _check_0[_index_0] | ||
| 2987 | if _item_0 == _val_0 then | ||
| 2988 | _find_0 = true | ||
| 2989 | break | ||
| 2990 | end | ||
| 2991 | end | ||
| 2992 | not_exist = not _find_0 | ||
| 2993 | end | ||
| 2994 | local check | ||
| 2995 | check = function() | ||
| 2996 | local _check_0 = table | ||
| 2997 | local _val_0 = value | ||
| 2998 | for _index_0 = 1, #_check_0 do | ||
| 2999 | if _check_0[_index_0] == _val_0 then | ||
| 3000 | return false | ||
| 3001 | end | ||
| 3002 | end | ||
| 3003 | return true | ||
| 3004 | end | ||
| 3005 | local c | ||
| 3006 | do | ||
| 3007 | local _val_0 = a | ||
| 3008 | c = 1 == _val_0 | ||
| 3009 | end | ||
| 3010 | do | ||
| 3011 | local _val_0 = a | ||
| 3012 | c = 1 == _val_0 | ||
| 3013 | end | ||
| 3014 | local _with_0 = tb | ||
| 3015 | do | ||
| 3016 | local _check_0 = _with_0[1] | ||
| 3017 | local _val_0 = a | ||
| 3018 | local _find_0 = false | ||
| 3019 | for _index_0 = 1, #_check_0 do | ||
| 3020 | local _item_0 = _check_0[_index_0] | ||
| 3021 | if _item_0 == _val_0 then | ||
| 3022 | _find_0 = true | ||
| 3023 | break | ||
| 3024 | end | ||
| 3025 | end | ||
| 3026 | c = _find_0 | ||
| 3027 | end | ||
| 2969 | local have_coins = false | 3028 | local have_coins = false |
| 2970 | if have_coins then | 3029 | if have_coins then |
| 2971 | print("Got coins") | 3030 | print("Got coins") |
| @@ -3022,6 +3081,65 @@ if (function() | |||
| 3022 | end)() then | 3081 | end)() then |
| 3023 | print("checking if `a` is in a list") | 3082 | print("checking if `a` is in a list") |
| 3024 | end | 3083 | end |
| 3084 | local has | ||
| 3085 | do | ||
| 3086 | local _val_0 = "foo" | ||
| 3087 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 3088 | end | ||
| 3089 | if (function() | ||
| 3090 | local _val_0 = a | ||
| 3091 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 3092 | end)() then | ||
| 3093 | print("a is in the table") | ||
| 3094 | end | ||
| 3095 | local not_exist | ||
| 3096 | do | ||
| 3097 | local _check_0 = list | ||
| 3098 | local _val_0 = item | ||
| 3099 | local _find_0 = false | ||
| 3100 | for _index_0 = 1, #_check_0 do | ||
| 3101 | local _item_0 = _check_0[_index_0] | ||
| 3102 | if _item_0 == _val_0 then | ||
| 3103 | _find_0 = true | ||
| 3104 | break | ||
| 3105 | end | ||
| 3106 | end | ||
| 3107 | not_exist = not _find_0 | ||
| 3108 | end | ||
| 3109 | local check | ||
| 3110 | check = function() | ||
| 3111 | local _check_0 = table | ||
| 3112 | local _val_0 = value | ||
| 3113 | for _index_0 = 1, #_check_0 do | ||
| 3114 | if _check_0[_index_0] == _val_0 then | ||
| 3115 | return false | ||
| 3116 | end | ||
| 3117 | end | ||
| 3118 | return true | ||
| 3119 | end | ||
| 3120 | local c | ||
| 3121 | do | ||
| 3122 | local _val_0 = a | ||
| 3123 | c = 1 == _val_0 | ||
| 3124 | end | ||
| 3125 | do | ||
| 3126 | local _val_0 = a | ||
| 3127 | c = 1 == _val_0 | ||
| 3128 | end | ||
| 3129 | local _with_0 = tb | ||
| 3130 | do | ||
| 3131 | local _check_0 = _with_0[1] | ||
| 3132 | local _val_0 = a | ||
| 3133 | local _find_0 = false | ||
| 3134 | for _index_0 = 1, #_check_0 do | ||
| 3135 | local _item_0 = _check_0[_index_0] | ||
| 3136 | if _item_0 == _val_0 then | ||
| 3137 | _find_0 = true | ||
| 3138 | break | ||
| 3139 | end | ||
| 3140 | end | ||
| 3141 | c = _find_0 | ||
| 3142 | end | ||
| 3025 | for i = 10, 20 do | 3143 | for i = 10, 20 do |
| 3026 | print(i) | 3144 | print(i) |
| 3027 | end | 3145 | end |
diff --git a/spec/outputs/codes_from_doc_id-id.lua b/spec/outputs/codes_from_doc_id-id.lua index 4026240..7af01b7 100644 --- a/spec/outputs/codes_from_doc_id-id.lua +++ b/spec/outputs/codes_from_doc_id-id.lua | |||
| @@ -2966,6 +2966,65 @@ if (function() | |||
| 2966 | end)() then | 2966 | end)() then |
| 2967 | print("memeriksa apakah `a` ada di dalam daftar") | 2967 | print("memeriksa apakah `a` ada di dalam daftar") |
| 2968 | end | 2968 | end |
| 2969 | local has | ||
| 2970 | do | ||
| 2971 | local _val_0 = "foo" | ||
| 2972 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 2973 | end | ||
| 2974 | if (function() | ||
| 2975 | local _val_0 = a | ||
| 2976 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 2977 | end)() then | ||
| 2978 | print("a ada di dalam tabel") | ||
| 2979 | end | ||
| 2980 | local not_exist | ||
| 2981 | do | ||
| 2982 | local _check_0 = list | ||
| 2983 | local _val_0 = item | ||
| 2984 | local _find_0 = false | ||
| 2985 | for _index_0 = 1, #_check_0 do | ||
| 2986 | local _item_0 = _check_0[_index_0] | ||
| 2987 | if _item_0 == _val_0 then | ||
| 2988 | _find_0 = true | ||
| 2989 | break | ||
| 2990 | end | ||
| 2991 | end | ||
| 2992 | not_exist = not _find_0 | ||
| 2993 | end | ||
| 2994 | local check | ||
| 2995 | check = function() | ||
| 2996 | local _check_0 = table | ||
| 2997 | local _val_0 = value | ||
| 2998 | for _index_0 = 1, #_check_0 do | ||
| 2999 | if _check_0[_index_0] == _val_0 then | ||
| 3000 | return false | ||
| 3001 | end | ||
| 3002 | end | ||
| 3003 | return true | ||
| 3004 | end | ||
| 3005 | local c | ||
| 3006 | do | ||
| 3007 | local _val_0 = a | ||
| 3008 | c = 1 == _val_0 | ||
| 3009 | end | ||
| 3010 | do | ||
| 3011 | local _val_0 = a | ||
| 3012 | c = 1 == _val_0 | ||
| 3013 | end | ||
| 3014 | local _with_0 = tb | ||
| 3015 | do | ||
| 3016 | local _check_0 = _with_0[1] | ||
| 3017 | local _val_0 = a | ||
| 3018 | local _find_0 = false | ||
| 3019 | for _index_0 = 1, #_check_0 do | ||
| 3020 | local _item_0 = _check_0[_index_0] | ||
| 3021 | if _item_0 == _val_0 then | ||
| 3022 | _find_0 = true | ||
| 3023 | break | ||
| 3024 | end | ||
| 3025 | end | ||
| 3026 | c = _find_0 | ||
| 3027 | end | ||
| 2969 | local have_coins = false | 3028 | local have_coins = false |
| 2970 | if have_coins then | 3029 | if have_coins then |
| 2971 | print("Dapat koin") | 3030 | print("Dapat koin") |
| @@ -3022,6 +3081,65 @@ if (function() | |||
| 3022 | end)() then | 3081 | end)() then |
| 3023 | print("memeriksa apakah `a` ada di dalam daftar") | 3082 | print("memeriksa apakah `a` ada di dalam daftar") |
| 3024 | end | 3083 | end |
| 3084 | local has | ||
| 3085 | do | ||
| 3086 | local _val_0 = "foo" | ||
| 3087 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 3088 | end | ||
| 3089 | if (function() | ||
| 3090 | local _val_0 = a | ||
| 3091 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 3092 | end)() then | ||
| 3093 | print("a ada di dalam tabel") | ||
| 3094 | end | ||
| 3095 | local not_exist | ||
| 3096 | do | ||
| 3097 | local _check_0 = list | ||
| 3098 | local _val_0 = item | ||
| 3099 | local _find_0 = false | ||
| 3100 | for _index_0 = 1, #_check_0 do | ||
| 3101 | local _item_0 = _check_0[_index_0] | ||
| 3102 | if _item_0 == _val_0 then | ||
| 3103 | _find_0 = true | ||
| 3104 | break | ||
| 3105 | end | ||
| 3106 | end | ||
| 3107 | not_exist = not _find_0 | ||
| 3108 | end | ||
| 3109 | local check | ||
| 3110 | check = function() | ||
| 3111 | local _check_0 = table | ||
| 3112 | local _val_0 = value | ||
| 3113 | for _index_0 = 1, #_check_0 do | ||
| 3114 | if _check_0[_index_0] == _val_0 then | ||
| 3115 | return false | ||
| 3116 | end | ||
| 3117 | end | ||
| 3118 | return true | ||
| 3119 | end | ||
| 3120 | local c | ||
| 3121 | do | ||
| 3122 | local _val_0 = a | ||
| 3123 | c = 1 == _val_0 | ||
| 3124 | end | ||
| 3125 | do | ||
| 3126 | local _val_0 = a | ||
| 3127 | c = 1 == _val_0 | ||
| 3128 | end | ||
| 3129 | local _with_0 = tb | ||
| 3130 | do | ||
| 3131 | local _check_0 = _with_0[1] | ||
| 3132 | local _val_0 = a | ||
| 3133 | local _find_0 = false | ||
| 3134 | for _index_0 = 1, #_check_0 do | ||
| 3135 | local _item_0 = _check_0[_index_0] | ||
| 3136 | if _item_0 == _val_0 then | ||
| 3137 | _find_0 = true | ||
| 3138 | break | ||
| 3139 | end | ||
| 3140 | end | ||
| 3141 | c = _find_0 | ||
| 3142 | end | ||
| 3025 | for i = 10, 20 do | 3143 | for i = 10, 20 do |
| 3026 | print(i) | 3144 | print(i) |
| 3027 | end | 3145 | end |
diff --git a/spec/outputs/codes_from_doc_pt-br.lua b/spec/outputs/codes_from_doc_pt-br.lua index 0d0c76f..dfe0108 100644 --- a/spec/outputs/codes_from_doc_pt-br.lua +++ b/spec/outputs/codes_from_doc_pt-br.lua | |||
| @@ -2966,6 +2966,65 @@ if (function() | |||
| 2966 | end)() then | 2966 | end)() then |
| 2967 | print("verificando se `a` está na lista") | 2967 | print("verificando se `a` está na lista") |
| 2968 | end | 2968 | end |
| 2969 | local has | ||
| 2970 | do | ||
| 2971 | local _val_0 = "foo" | ||
| 2972 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 2973 | end | ||
| 2974 | if (function() | ||
| 2975 | local _val_0 = a | ||
| 2976 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 2977 | end)() then | ||
| 2978 | print("a está na tabela") | ||
| 2979 | end | ||
| 2980 | local not_exist | ||
| 2981 | do | ||
| 2982 | local _check_0 = list | ||
| 2983 | local _val_0 = item | ||
| 2984 | local _find_0 = false | ||
| 2985 | for _index_0 = 1, #_check_0 do | ||
| 2986 | local _item_0 = _check_0[_index_0] | ||
| 2987 | if _item_0 == _val_0 then | ||
| 2988 | _find_0 = true | ||
| 2989 | break | ||
| 2990 | end | ||
| 2991 | end | ||
| 2992 | not_exist = not _find_0 | ||
| 2993 | end | ||
| 2994 | local check | ||
| 2995 | check = function() | ||
| 2996 | local _check_0 = table | ||
| 2997 | local _val_0 = value | ||
| 2998 | for _index_0 = 1, #_check_0 do | ||
| 2999 | if _check_0[_index_0] == _val_0 then | ||
| 3000 | return false | ||
| 3001 | end | ||
| 3002 | end | ||
| 3003 | return true | ||
| 3004 | end | ||
| 3005 | local c | ||
| 3006 | do | ||
| 3007 | local _val_0 = a | ||
| 3008 | c = 1 == _val_0 | ||
| 3009 | end | ||
| 3010 | do | ||
| 3011 | local _val_0 = a | ||
| 3012 | c = 1 == _val_0 | ||
| 3013 | end | ||
| 3014 | local _with_0 = tb | ||
| 3015 | do | ||
| 3016 | local _check_0 = _with_0[1] | ||
| 3017 | local _val_0 = a | ||
| 3018 | local _find_0 = false | ||
| 3019 | for _index_0 = 1, #_check_0 do | ||
| 3020 | local _item_0 = _check_0[_index_0] | ||
| 3021 | if _item_0 == _val_0 then | ||
| 3022 | _find_0 = true | ||
| 3023 | break | ||
| 3024 | end | ||
| 3025 | end | ||
| 3026 | c = _find_0 | ||
| 3027 | end | ||
| 2969 | local have_coins = false | 3028 | local have_coins = false |
| 2970 | if have_coins then | 3029 | if have_coins then |
| 2971 | print("Tem moedas") | 3030 | print("Tem moedas") |
| @@ -3022,6 +3081,65 @@ if (function() | |||
| 3022 | end)() then | 3081 | end)() then |
| 3023 | print("verificando se `a` está na lista") | 3082 | print("verificando se `a` está na lista") |
| 3024 | end | 3083 | end |
| 3084 | local has | ||
| 3085 | do | ||
| 3086 | local _val_0 = "foo" | ||
| 3087 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 3088 | end | ||
| 3089 | if (function() | ||
| 3090 | local _val_0 = a | ||
| 3091 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 3092 | end)() then | ||
| 3093 | print("a está na tabela") | ||
| 3094 | end | ||
| 3095 | local not_exist | ||
| 3096 | do | ||
| 3097 | local _check_0 = list | ||
| 3098 | local _val_0 = item | ||
| 3099 | local _find_0 = false | ||
| 3100 | for _index_0 = 1, #_check_0 do | ||
| 3101 | local _item_0 = _check_0[_index_0] | ||
| 3102 | if _item_0 == _val_0 then | ||
| 3103 | _find_0 = true | ||
| 3104 | break | ||
| 3105 | end | ||
| 3106 | end | ||
| 3107 | not_exist = not _find_0 | ||
| 3108 | end | ||
| 3109 | local check | ||
| 3110 | check = function() | ||
| 3111 | local _check_0 = table | ||
| 3112 | local _val_0 = value | ||
| 3113 | for _index_0 = 1, #_check_0 do | ||
| 3114 | if _check_0[_index_0] == _val_0 then | ||
| 3115 | return false | ||
| 3116 | end | ||
| 3117 | end | ||
| 3118 | return true | ||
| 3119 | end | ||
| 3120 | local c | ||
| 3121 | do | ||
| 3122 | local _val_0 = a | ||
| 3123 | c = 1 == _val_0 | ||
| 3124 | end | ||
| 3125 | do | ||
| 3126 | local _val_0 = a | ||
| 3127 | c = 1 == _val_0 | ||
| 3128 | end | ||
| 3129 | local _with_0 = tb | ||
| 3130 | do | ||
| 3131 | local _check_0 = _with_0[1] | ||
| 3132 | local _val_0 = a | ||
| 3133 | local _find_0 = false | ||
| 3134 | for _index_0 = 1, #_check_0 do | ||
| 3135 | local _item_0 = _check_0[_index_0] | ||
| 3136 | if _item_0 == _val_0 then | ||
| 3137 | _find_0 = true | ||
| 3138 | break | ||
| 3139 | end | ||
| 3140 | end | ||
| 3141 | c = _find_0 | ||
| 3142 | end | ||
| 3025 | for i = 10, 20 do | 3143 | for i = 10, 20 do |
| 3026 | print(i) | 3144 | print(i) |
| 3027 | end | 3145 | end |
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index c847841..6db4a43 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua | |||
| @@ -2966,6 +2966,65 @@ if (function() | |||
| 2966 | end)() then | 2966 | end)() then |
| 2967 | print("检查`a`是否在列表中") | 2967 | print("检查`a`是否在列表中") |
| 2968 | end | 2968 | end |
| 2969 | local has | ||
| 2970 | do | ||
| 2971 | local _val_0 = "foo" | ||
| 2972 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 2973 | end | ||
| 2974 | if (function() | ||
| 2975 | local _val_0 = a | ||
| 2976 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 2977 | end)() then | ||
| 2978 | print("a 在表中") | ||
| 2979 | end | ||
| 2980 | local not_exist | ||
| 2981 | do | ||
| 2982 | local _check_0 = list | ||
| 2983 | local _val_0 = item | ||
| 2984 | local _find_0 = false | ||
| 2985 | for _index_0 = 1, #_check_0 do | ||
| 2986 | local _item_0 = _check_0[_index_0] | ||
| 2987 | if _item_0 == _val_0 then | ||
| 2988 | _find_0 = true | ||
| 2989 | break | ||
| 2990 | end | ||
| 2991 | end | ||
| 2992 | not_exist = not _find_0 | ||
| 2993 | end | ||
| 2994 | local check | ||
| 2995 | check = function() | ||
| 2996 | local _check_0 = table | ||
| 2997 | local _val_0 = value | ||
| 2998 | for _index_0 = 1, #_check_0 do | ||
| 2999 | if _check_0[_index_0] == _val_0 then | ||
| 3000 | return false | ||
| 3001 | end | ||
| 3002 | end | ||
| 3003 | return true | ||
| 3004 | end | ||
| 3005 | local c | ||
| 3006 | do | ||
| 3007 | local _val_0 = a | ||
| 3008 | c = 1 == _val_0 | ||
| 3009 | end | ||
| 3010 | do | ||
| 3011 | local _val_0 = a | ||
| 3012 | c = 1 == _val_0 | ||
| 3013 | end | ||
| 3014 | local _with_0 = tb | ||
| 3015 | do | ||
| 3016 | local _check_0 = _with_0[1] | ||
| 3017 | local _val_0 = a | ||
| 3018 | local _find_0 = false | ||
| 3019 | for _index_0 = 1, #_check_0 do | ||
| 3020 | local _item_0 = _check_0[_index_0] | ||
| 3021 | if _item_0 == _val_0 then | ||
| 3022 | _find_0 = true | ||
| 3023 | break | ||
| 3024 | end | ||
| 3025 | end | ||
| 3026 | c = _find_0 | ||
| 3027 | end | ||
| 2969 | local have_coins = false | 3028 | local have_coins = false |
| 2970 | if have_coins then | 3029 | if have_coins then |
| 2971 | print("有硬币") | 3030 | print("有硬币") |
| @@ -3022,6 +3081,65 @@ if (function() | |||
| 3022 | end)() then | 3081 | end)() then |
| 3023 | print("检查`a`是否在列表中") | 3082 | print("检查`a`是否在列表中") |
| 3024 | end | 3083 | end |
| 3084 | local has | ||
| 3085 | do | ||
| 3086 | local _val_0 = "foo" | ||
| 3087 | has = "bar" == _val_0 or "foo" == _val_0 | ||
| 3088 | end | ||
| 3089 | if (function() | ||
| 3090 | local _val_0 = a | ||
| 3091 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 3092 | end)() then | ||
| 3093 | print("a 在表中") | ||
| 3094 | end | ||
| 3095 | local not_exist | ||
| 3096 | do | ||
| 3097 | local _check_0 = list | ||
| 3098 | local _val_0 = item | ||
| 3099 | local _find_0 = false | ||
| 3100 | for _index_0 = 1, #_check_0 do | ||
| 3101 | local _item_0 = _check_0[_index_0] | ||
| 3102 | if _item_0 == _val_0 then | ||
| 3103 | _find_0 = true | ||
| 3104 | break | ||
| 3105 | end | ||
| 3106 | end | ||
| 3107 | not_exist = not _find_0 | ||
| 3108 | end | ||
| 3109 | local check | ||
| 3110 | check = function() | ||
| 3111 | local _check_0 = table | ||
| 3112 | local _val_0 = value | ||
| 3113 | for _index_0 = 1, #_check_0 do | ||
| 3114 | if _check_0[_index_0] == _val_0 then | ||
| 3115 | return false | ||
| 3116 | end | ||
| 3117 | end | ||
| 3118 | return true | ||
| 3119 | end | ||
| 3120 | local c | ||
| 3121 | do | ||
| 3122 | local _val_0 = a | ||
| 3123 | c = 1 == _val_0 | ||
| 3124 | end | ||
| 3125 | do | ||
| 3126 | local _val_0 = a | ||
| 3127 | c = 1 == _val_0 | ||
| 3128 | end | ||
| 3129 | local _with_0 = tb | ||
| 3130 | do | ||
| 3131 | local _check_0 = _with_0[1] | ||
| 3132 | local _val_0 = a | ||
| 3133 | local _find_0 = false | ||
| 3134 | for _index_0 = 1, #_check_0 do | ||
| 3135 | local _item_0 = _check_0[_index_0] | ||
| 3136 | if _item_0 == _val_0 then | ||
| 3137 | _find_0 = true | ||
| 3138 | break | ||
| 3139 | end | ||
| 3140 | end | ||
| 3141 | c = _find_0 | ||
| 3142 | end | ||
| 3025 | for i = 10, 20 do | 3143 | for i = 10, 20 do |
| 3026 | print(i) | 3144 | print(i) |
| 3027 | end | 3145 | end |
