summaryrefslogtreecommitdiff
path: root/script/parser/parse.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-20 21:55:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-20 21:55:41 +0800
commitc63b2e404d8d2bb984afe3678a5ba2b2836380cc (patch)
treea70661effacc7a29caa8d49583673ac4be2faaf5 /script/parser/parse.lua
parent85c5a4210e4447422cd5677369ae740ed65725a0 (diff)
downloadlua-language-server-c63b2e404d8d2bb984afe3678a5ba2b2836380cc.zip
remove the old version
Diffstat (limited to 'script/parser/parse.lua')
-rw-r--r--script/parser/parse.lua41
1 files changed, 0 insertions, 41 deletions
diff --git a/script/parser/parse.lua b/script/parser/parse.lua
deleted file mode 100644
index 6ad79d9b..00000000
--- a/script/parser/parse.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local ast = require 'parser.ast'
-
-local Errs
-local State
-
-local function pushError(err)
- if err.finish < err.start then
- err.finish = err.start
- end
- local last = Errs[#Errs]
- if last then
- if last.start <= err.start and last.finish >= err.finish then
- return
- end
- end
- err.level = err.level or 'error'
- Errs[#Errs+1] = err
- return err
-end
-
-return function (self, lua, mode, version)
- Errs = {}
- State= {
- Break = 0,
- Label = {{}},
- Dots = {true},
- Version = version,
- Comments = {},
- Lua = lua,
- }
- ast.init(State, Errs)
- local suc, res, err = xpcall(self.grammar, debug.traceback, self, lua, mode)
- if not suc then
- return nil, res
- end
- if not res then
- pushError(err)
- return nil, Errs
- end
- return res, Errs, State.Comments
-end