aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-15 05:49:13 +0000
committerLi Jin <dragon-fly@qq.com>2026-02-15 07:36:30 +0000
commitcf5b1b4a68d762e6e33cac8367611ecea15fa942 (patch)
tree25de1a4113d26882c0135e38b7ff166efbc39969 /spec
parentecd8f3bfd07e91d04e0a2d72f4a50f9cc6c75433 (diff)
downloadyuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.tar.gz
yuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.tar.bz2
yuescript-cf5b1b4a68d762e6e33cac8367611ecea15fa942.zip
Add goto statement documentation and testsHEADmain
- 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')
-rw-r--r--spec/outputs/codes_from_doc_de.lua118
-rw-r--r--spec/outputs/codes_from_doc_en.lua118
-rw-r--r--spec/outputs/codes_from_doc_id-id.lua118
-rw-r--r--spec/outputs/codes_from_doc_pt-br.lua118
-rw-r--r--spec/outputs/codes_from_doc_zh.lua118
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()
2966end)() then 2966end)() then
2967 print("Prüfen, ob `a` in einer Liste ist") 2967 print("Prüfen, ob `a` in einer Liste ist")
2968end 2968end
2969local has
2970do
2971 local _val_0 = "foo"
2972 has = "bar" == _val_0 or "foo" == _val_0
2973end
2974if (function()
2975 local _val_0 = a
2976 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
2977end)() then
2978 print("a ist in der Tabelle")
2979end
2980local not_exist
2981do
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
2993end
2994local check
2995check = 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
3004end
3005local c
3006do
3007 local _val_0 = a
3008 c = 1 == _val_0
3009end
3010do
3011 local _val_0 = a
3012 c = 1 == _val_0
3013end
3014local _with_0 = tb
3015do
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
3027end
2969local have_coins = false 3028local have_coins = false
2970if have_coins then 3029if have_coins then
2971 print("Münzen erhalten") 3030 print("Münzen erhalten")
@@ -3022,6 +3081,65 @@ if (function()
3022end)() then 3081end)() then
3023 print("Prüfen, ob `a` in einer Liste ist") 3082 print("Prüfen, ob `a` in einer Liste ist")
3024end 3083end
3084local has
3085do
3086 local _val_0 = "foo"
3087 has = "bar" == _val_0 or "foo" == _val_0
3088end
3089if (function()
3090 local _val_0 = a
3091 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
3092end)() then
3093 print("a ist in der Tabelle")
3094end
3095local not_exist
3096do
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
3108end
3109local check
3110check = 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
3119end
3120local c
3121do
3122 local _val_0 = a
3123 c = 1 == _val_0
3124end
3125do
3126 local _val_0 = a
3127 c = 1 == _val_0
3128end
3129local _with_0 = tb
3130do
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
3142end
3025for i = 10, 20 do 3143for i = 10, 20 do
3026 print(i) 3144 print(i)
3027end 3145end
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()
2966end)() then 2966end)() then
2967 print("checking if `a` is in a list") 2967 print("checking if `a` is in a list")
2968end 2968end
2969local has
2970do
2971 local _val_0 = "foo"
2972 has = "bar" == _val_0 or "foo" == _val_0
2973end
2974if (function()
2975 local _val_0 = a
2976 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
2977end)() then
2978 print("a is in the table")
2979end
2980local not_exist
2981do
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
2993end
2994local check
2995check = 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
3004end
3005local c
3006do
3007 local _val_0 = a
3008 c = 1 == _val_0
3009end
3010do
3011 local _val_0 = a
3012 c = 1 == _val_0
3013end
3014local _with_0 = tb
3015do
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
3027end
2969local have_coins = false 3028local have_coins = false
2970if have_coins then 3029if have_coins then
2971 print("Got coins") 3030 print("Got coins")
@@ -3022,6 +3081,65 @@ if (function()
3022end)() then 3081end)() then
3023 print("checking if `a` is in a list") 3082 print("checking if `a` is in a list")
3024end 3083end
3084local has
3085do
3086 local _val_0 = "foo"
3087 has = "bar" == _val_0 or "foo" == _val_0
3088end
3089if (function()
3090 local _val_0 = a
3091 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
3092end)() then
3093 print("a is in the table")
3094end
3095local not_exist
3096do
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
3108end
3109local check
3110check = 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
3119end
3120local c
3121do
3122 local _val_0 = a
3123 c = 1 == _val_0
3124end
3125do
3126 local _val_0 = a
3127 c = 1 == _val_0
3128end
3129local _with_0 = tb
3130do
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
3142end
3025for i = 10, 20 do 3143for i = 10, 20 do
3026 print(i) 3144 print(i)
3027end 3145end
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()
2966end)() then 2966end)() then
2967 print("memeriksa apakah `a` ada di dalam daftar") 2967 print("memeriksa apakah `a` ada di dalam daftar")
2968end 2968end
2969local has
2970do
2971 local _val_0 = "foo"
2972 has = "bar" == _val_0 or "foo" == _val_0
2973end
2974if (function()
2975 local _val_0 = a
2976 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
2977end)() then
2978 print("a ada di dalam tabel")
2979end
2980local not_exist
2981do
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
2993end
2994local check
2995check = 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
3004end
3005local c
3006do
3007 local _val_0 = a
3008 c = 1 == _val_0
3009end
3010do
3011 local _val_0 = a
3012 c = 1 == _val_0
3013end
3014local _with_0 = tb
3015do
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
3027end
2969local have_coins = false 3028local have_coins = false
2970if have_coins then 3029if have_coins then
2971 print("Dapat koin") 3030 print("Dapat koin")
@@ -3022,6 +3081,65 @@ if (function()
3022end)() then 3081end)() then
3023 print("memeriksa apakah `a` ada di dalam daftar") 3082 print("memeriksa apakah `a` ada di dalam daftar")
3024end 3083end
3084local has
3085do
3086 local _val_0 = "foo"
3087 has = "bar" == _val_0 or "foo" == _val_0
3088end
3089if (function()
3090 local _val_0 = a
3091 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
3092end)() then
3093 print("a ada di dalam tabel")
3094end
3095local not_exist
3096do
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
3108end
3109local check
3110check = 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
3119end
3120local c
3121do
3122 local _val_0 = a
3123 c = 1 == _val_0
3124end
3125do
3126 local _val_0 = a
3127 c = 1 == _val_0
3128end
3129local _with_0 = tb
3130do
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
3142end
3025for i = 10, 20 do 3143for i = 10, 20 do
3026 print(i) 3144 print(i)
3027end 3145end
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()
2966end)() then 2966end)() then
2967 print("verificando se `a` está na lista") 2967 print("verificando se `a` está na lista")
2968end 2968end
2969local has
2970do
2971 local _val_0 = "foo"
2972 has = "bar" == _val_0 or "foo" == _val_0
2973end
2974if (function()
2975 local _val_0 = a
2976 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
2977end)() then
2978 print("a está na tabela")
2979end
2980local not_exist
2981do
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
2993end
2994local check
2995check = 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
3004end
3005local c
3006do
3007 local _val_0 = a
3008 c = 1 == _val_0
3009end
3010do
3011 local _val_0 = a
3012 c = 1 == _val_0
3013end
3014local _with_0 = tb
3015do
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
3027end
2969local have_coins = false 3028local have_coins = false
2970if have_coins then 3029if have_coins then
2971 print("Tem moedas") 3030 print("Tem moedas")
@@ -3022,6 +3081,65 @@ if (function()
3022end)() then 3081end)() then
3023 print("verificando se `a` está na lista") 3082 print("verificando se `a` está na lista")
3024end 3083end
3084local has
3085do
3086 local _val_0 = "foo"
3087 has = "bar" == _val_0 or "foo" == _val_0
3088end
3089if (function()
3090 local _val_0 = a
3091 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
3092end)() then
3093 print("a está na tabela")
3094end
3095local not_exist
3096do
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
3108end
3109local check
3110check = 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
3119end
3120local c
3121do
3122 local _val_0 = a
3123 c = 1 == _val_0
3124end
3125do
3126 local _val_0 = a
3127 c = 1 == _val_0
3128end
3129local _with_0 = tb
3130do
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
3142end
3025for i = 10, 20 do 3143for i = 10, 20 do
3026 print(i) 3144 print(i)
3027end 3145end
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()
2966end)() then 2966end)() then
2967 print("检查`a`是否在列表中") 2967 print("检查`a`是否在列表中")
2968end 2968end
2969local has
2970do
2971 local _val_0 = "foo"
2972 has = "bar" == _val_0 or "foo" == _val_0
2973end
2974if (function()
2975 local _val_0 = a
2976 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
2977end)() then
2978 print("a 在表中")
2979end
2980local not_exist
2981do
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
2993end
2994local check
2995check = 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
3004end
3005local c
3006do
3007 local _val_0 = a
3008 c = 1 == _val_0
3009end
3010do
3011 local _val_0 = a
3012 c = 1 == _val_0
3013end
3014local _with_0 = tb
3015do
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
3027end
2969local have_coins = false 3028local have_coins = false
2970if have_coins then 3029if have_coins then
2971 print("有硬币") 3030 print("有硬币")
@@ -3022,6 +3081,65 @@ if (function()
3022end)() then 3081end)() then
3023 print("检查`a`是否在列表中") 3082 print("检查`a`是否在列表中")
3024end 3083end
3084local has
3085do
3086 local _val_0 = "foo"
3087 has = "bar" == _val_0 or "foo" == _val_0
3088end
3089if (function()
3090 local _val_0 = a
3091 return 1 == _val_0 or 2 == _val_0 or 3 == _val_0
3092end)() then
3093 print("a 在表中")
3094end
3095local not_exist
3096do
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
3108end
3109local check
3110check = 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
3119end
3120local c
3121do
3122 local _val_0 = a
3123 c = 1 == _val_0
3124end
3125do
3126 local _val_0 = a
3127 c = 1 == _val_0
3128end
3129local _with_0 = tb
3130do
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
3142end
3025for i = 10, 20 do 3143for i = 10, 20 do
3026 print(i) 3144 print(i)
3027end 3145end