summaryrefslogtreecommitdiff
path: root/server-beta/src/parser/parse.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/parser/parse.lua')
-rw-r--r--server-beta/src/parser/parse.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/server-beta/src/parser/parse.lua b/server-beta/src/parser/parse.lua
index 0fd64e80..bbc01b10 100644
--- a/server-beta/src/parser/parse.lua
+++ b/server-beta/src/parser/parse.lua
@@ -2,12 +2,14 @@ local ast = require 'parser.ast'
return function (self, lua, mode, version)
local errs = {}
+ local diags = {}
local state = {
version = version,
lua = lua,
emmy = {},
root = {},
errs = errs,
+ diags = diags,
pushError = function (err)
if err.finish < err.start then
err.finish = err.start
@@ -22,6 +24,12 @@ return function (self, lua, mode, version)
errs[#errs+1] = err
return err
end,
+ pushDiag = function (code, info)
+ if not diags[code] then
+ diags[code] = {}
+ end
+ diags[code][#diags[code]+1] = info
+ end
}
ast.init(state)
local suc, res, err = xpcall(self.grammar, debug.traceback, self, lua, mode)