summaryrefslogtreecommitdiff
path: root/server/src/parser/ast.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/parser/ast.lua')
-rw-r--r--server/src/parser/ast.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index 45a0cbee..0cef46a1 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -414,9 +414,12 @@ local defs = {
}
return function (self, lua, mode)
- local gram, err = self.grammar(lua, mode, defs)
- if not gram then
+ local suc, res, err = pcall(self.grammar, lua, mode, defs)
+ if not suc then
+ return nil, res
+ end
+ if not res then
return nil, err
end
- return gram
+ return res
end