diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/compile.lua | 3 | ||||
-rw-r--r-- | script/parser/parse.lua | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua index 1ba111ed..d4129ab4 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -1,5 +1,6 @@ local guide = require 'parser.guide' local type = type +local os = os local specials = { ['_G'] = true, @@ -537,6 +538,7 @@ return function (self, lua, mode, version, options) if not state then return nil, err end + local clock = os.clock() pushError = state.pushError if version == 'Lua 5.1' or version == 'LuaJIT' then ENVMode = '@fenv' @@ -557,6 +559,7 @@ return function (self, lua, mode, version, options) Compile(state.ast) end PostCompile() + state.compileClock = os.clock() - clock Compiled = nil GoToTag = nil return state diff --git a/script/parser/parse.lua b/script/parser/parse.lua index 909ce315..9b8d5496 100644 --- a/script/parser/parse.lua +++ b/script/parser/parse.lua @@ -36,6 +36,7 @@ return function (self, lua, mode, version, options) comms[#comms+1] = comment end } + local clock = os.clock() ast.init(state) local suc, res, err = xpcall(self.grammar, debug.traceback, self, lua, mode) ast.close() @@ -46,5 +47,6 @@ return function (self, lua, mode, version, options) state.pushError(err) end state.ast = res + state.parseClock = os.clock() - clock return state end |