Skip to content

Commit becf780

Browse files
committed
update test
1 parent de44632 commit becf780

File tree

4 files changed

+4032
-1
lines changed

4 files changed

+4032
-1
lines changed

script/parser/compile.lua

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local guide = require 'parser.guide'
22
local type = type
3+
local os = os
34

45
local specials = {
56
['_G'] = true,
@@ -537,6 +538,7 @@ return function (self, lua, mode, version, options)
537538
if not state then
538539
return nil, err
539540
end
541+
local clock = os.clock()
540542
pushError = state.pushError
541543
if version == 'Lua 5.1' or version == 'LuaJIT' then
542544
ENVMode = '@fenv'
@@ -557,6 +559,7 @@ return function (self, lua, mode, version, options)
557559
Compile(state.ast)
558560
end
559561
PostCompile()
562+
state.compileClock = os.clock() - clock
560563
Compiled = nil
561564
GoToTag = nil
562565
return state

script/parser/parse.lua

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ return function (self, lua, mode, version, options)
3636
comms[#comms+1] = comment
3737
end
3838
}
39+
local clock = os.clock()
3940
ast.init(state)
4041
local suc, res, err = xpcall(self.grammar, debug.traceback, self, lua, mode)
4142
ast.close()
@@ -46,5 +47,6 @@ return function (self, lua, mode, version, options)
4647
state.pushError(err)
4748
end
4849
state.ast = res
50+
state.parseClock = os.clock() - clock
4951
return state
5052
end

0 commit comments

Comments
 (0)