📅  最后修改于: 2022-03-11 14:58:39.292000             🧑  作者: Mango
-- Protected Lua Call to Require Module (vscode style snippet + output)
-- Snippet
"Protected Lua Call to Require Module": {
"prefix": "prlua",
"body": [
"local ${1:module}_status_ok, ${1:module} = pcall(require, \"${1:module}\")",
"if not ${1:module}_status_ok then",
" return",
"end",
""
],
"description": "Protected Lua Call to Require Module"
}
-- Output
local module_status_ok, module = pcall(require, "module")
if not module_status_ok then
return
end