diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-08 19:26:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-08 19:26:21 +0800 |
commit | 4fcc1fda1276fad2daf6c09e2ffddc8c01206aae (patch) | |
tree | 27ccf5c242e17e83aa208239f0b545eec3ef8fe9 /server | |
parent | d52bd13cb560abf9711412b759212f8845970139 (diff) | |
download | lua-language-server-4fcc1fda1276fad2daf6c09e2ffddc8c01206aae.zip |
pcall一下
Diffstat (limited to 'server')
-rw-r--r-- | server/src/matcher/compile.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/server/src/matcher/compile.lua b/server/src/matcher/compile.lua index b9bd4b6d..7db5ad4b 100644 --- a/server/src/matcher/compile.lua +++ b/server/src/matcher/compile.lua @@ -586,10 +586,7 @@ function mt:searchActions(actions) return nil end -return function (ast) - if not ast then - return nil - end +local function compile(ast) local searcher = setmetatable({ env = env { var = {}, @@ -608,3 +605,14 @@ return function (ast) return searcher.results end + +return function (ast) + if not ast then + return nil + end + local suc, res = xpcall(compile, log.error, ast) + if not suc then + return nil + end + return res +end |