summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/matcher/compile.lua16
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