From cf5b1b4a68d762e6e33cac8367611ecea15fa942 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sun, 15 Feb 2026 05:49:13 +0000 Subject: Add goto statement documentation and tests - 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 --- spec/outputs/codes_from_doc_zh.lua | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) (limited to 'spec/outputs/codes_from_doc_zh.lua') 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() end)() then print("检查`a`是否在列表中") end +local has +do + local _val_0 = "foo" + has = "bar" == _val_0 or "foo" == _val_0 +end +if (function() + local _val_0 = a + return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 +end)() then + print("a 在表中") +end +local not_exist +do + local _check_0 = list + local _val_0 = item + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + not_exist = not _find_0 +end +local check +check = function() + local _check_0 = table + local _val_0 = value + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return false + end + end + return true +end +local c +do + local _val_0 = a + c = 1 == _val_0 +end +do + local _val_0 = a + c = 1 == _val_0 +end +local _with_0 = tb +do + local _check_0 = _with_0[1] + local _val_0 = a + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + c = _find_0 +end local have_coins = false if have_coins then print("有硬币") @@ -3022,6 +3081,65 @@ if (function() end)() then print("检查`a`是否在列表中") end +local has +do + local _val_0 = "foo" + has = "bar" == _val_0 or "foo" == _val_0 +end +if (function() + local _val_0 = a + return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 +end)() then + print("a 在表中") +end +local not_exist +do + local _check_0 = list + local _val_0 = item + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + not_exist = not _find_0 +end +local check +check = function() + local _check_0 = table + local _val_0 = value + for _index_0 = 1, #_check_0 do + if _check_0[_index_0] == _val_0 then + return false + end + end + return true +end +local c +do + local _val_0 = a + c = 1 == _val_0 +end +do + local _val_0 = a + c = 1 == _val_0 +end +local _with_0 = tb +do + local _check_0 = _with_0[1] + local _val_0 = a + local _find_0 = false + for _index_0 = 1, #_check_0 do + local _item_0 = _check_0[_index_0] + if _item_0 == _val_0 then + _find_0 = true + break + end + end + c = _find_0 +end for i = 10, 20 do print(i) end -- cgit v1.2.3-55-g6feb