aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/codes_from_doc_zh.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2025-05-28 18:20:16 +0800
committerLi Jin <dragon-fly@qq.com>2025-05-28 18:20:16 +0800
commit5604bbbb80bfcedb4a9085b90864e221f8104b33 (patch)
tree8828cddb1b0fe0ca734d6209507bdbda3133f48d /spec/outputs/codes_from_doc_zh.lua
parent87267ca9e93606b70bdc0397349b176b8d142514 (diff)
downloadyuescript-5604bbbb80bfcedb4a9085b90864e221f8104b33.tar.gz
yuescript-5604bbbb80bfcedb4a9085b90864e221f8104b33.tar.bz2
yuescript-5604bbbb80bfcedb4a9085b90864e221f8104b33.zip
Added `try!` syntax.
Diffstat (limited to 'spec/outputs/codes_from_doc_zh.lua')
-rw-r--r--spec/outputs/codes_from_doc_zh.lua100
1 files changed, 100 insertions, 0 deletions
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua
index 399f8c1..e267709 100644
--- a/spec/outputs/codes_from_doc_zh.lua
+++ b/spec/outputs/codes_from_doc_zh.lua
@@ -688,6 +688,56 @@ end)
688if success then 688if success then
689 print(result) 689 print(result)
690end 690end
691local a, b, c
692do
693 local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(function()
694 return func()
695 end)
696 if _ok_0 then
697 a, b, c = _ret_0, _ret_1, _ret_2
698 end
699end
700do
701 local _exp_0 = ((function()
702 return (function(_arg_0, ...)
703 local _ok_0 = _arg_0
704 if _ok_0 then
705 return ...
706 end
707 end)(pcall(function()
708 return func()
709 end))
710 end)())
711 if _exp_0 ~= nil then
712 a = _exp_0
713 else
714 a = "default"
715 end
716end
717f((function()
718 return (function(_arg_0, ...)
719 local _ok_0 = _arg_0
720 if _ok_0 then
721 return ...
722 end
723 end)(pcall(function()
724 return func()
725 end))
726end)())
727f((function()
728 return (function(_arg_0, ...)
729 local _ok_0 = _arg_0
730 if _ok_0 then
731 return ...
732 end
733 end)(xpcall(function()
734 print(123)
735 return func()
736 end, function(e)
737 print(e)
738 return e
739 end))
740end)())
691local a <const> = 123 741local a <const> = 123
692local _ <close> = setmetatable({ }, { 742local _ <close> = setmetatable({ }, {
693 __close = function() 743 __close = function()
@@ -2903,6 +2953,56 @@ end)
2903if success then 2953if success then
2904 print(result) 2954 print(result)
2905end 2955end
2956local a, b, c
2957do
2958 local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(function()
2959 return func()
2960 end)
2961 if _ok_0 then
2962 a, b, c = _ret_0, _ret_1, _ret_2
2963 end
2964end
2965do
2966 local _exp_0 = ((function()
2967 return (function(_arg_0, ...)
2968 local _ok_0 = _arg_0
2969 if _ok_0 then
2970 return ...
2971 end
2972 end)(pcall(function()
2973 return func()
2974 end))
2975 end)())
2976 if _exp_0 ~= nil then
2977 a = _exp_0
2978 else
2979 a = "default"
2980 end
2981end
2982f((function()
2983 return (function(_arg_0, ...)
2984 local _ok_0 = _arg_0
2985 if _ok_0 then
2986 return ...
2987 end
2988 end)(pcall(function()
2989 return func()
2990 end))
2991end)())
2992f((function()
2993 return (function(_arg_0, ...)
2994 local _ok_0 = _arg_0
2995 if _ok_0 then
2996 return ...
2997 end
2998 end)(xpcall(function()
2999 print(123)
3000 return func()
3001 end, function(e)
3002 print(e)
3003 return e
3004 end))
3005end)())
2906local a <const> = 123 3006local a <const> = 123
2907local _ <close> = setmetatable({ }, { 3007local _ <close> = setmetatable({ }, {
2908 __close = function() 3008 __close = function()