diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/util-deb.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/util-deb.lua | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/context/base/util-deb.lua b/Master/texmf-dist/tex/context/base/util-deb.lua index d82c1a114f5..785373f862a 100644 --- a/Master/texmf-dist/tex/context/base/util-deb.lua +++ b/Master/texmf-dist/tex/context/base/util-deb.lua @@ -1,4 +1,4 @@ -if not modules then modules = { } end modules ['util.deb'] = { +if not modules then modules = { } end modules ['util-deb'] = { version = 1.001, comment = "companion to luat-lib.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", @@ -18,11 +18,13 @@ local format, find = string.format, string.find local is_boolean = string.is_boolean utilities = utilities or { } -utilities.debugger = utilities.debugger or { } -local debugger = utilities.debugger +local debugger = utilities.debugger or { } +utilities.debugger = debugger -local counters = { } -local names = { } +local counters = { } +local names = { } + +local report = logs.reporter("debugger") -- one @@ -50,7 +52,7 @@ local function hook() end function debugger.showstats(printer,threshold) -- hm, something has changed, rubish now - printer = printer or texio.write or print + printer = printer or report threshold = threshold or 0 local total, grandtotal, functions = 0, 0, 0 local dataset = { } @@ -108,22 +110,6 @@ end --~ print("") --~ debugger.showstats(print,3) -local is_node = node and node.is_node -local is_lpeg = lpeg and lpeg.type - -function inspect(i) -- global function - local ti = type(i) - if ti == "table" then - table.print(i,"table") - elseif is_node and is_node(i) then - table.print(nodes.astable(i),tostring(i)) - elseif is_lpeg and is_lpeg(i) then - lpeg.print(i) - else - print(tostring(i)) - end -end - -- from the lua book: function traceback() |