diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-09-11 18:14:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-09-11 18:14:00 +0200 |
commit | 31c85bed04f79cca40e26af118964bd86e8edd16 (patch) | |
tree | 64815e1310af371e9ad9f87913b7fa33357f0da2 /tex/context/base/trac-tra.lua | |
parent | 8683bfc5e51de9f4436c7deebd9517c9f2779f0a (diff) | |
download | context-31c85bed04f79cca40e26af118964bd86e8edd16.tar.gz |
beta 2009.09.11 18:14
Diffstat (limited to 'tex/context/base/trac-tra.lua')
-rw-r--r-- | tex/context/base/trac-tra.lua | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/tex/context/base/trac-tra.lua b/tex/context/base/trac-tra.lua index afa264379..56ca02dfb 100644 --- a/tex/context/base/trac-tra.lua +++ b/tex/context/base/trac-tra.lua @@ -15,7 +15,7 @@ debugger = debugger or { } local counters = { } local names = { } local getinfo = debug.getinfo -local format, find, lower, gmatch = string.format, string.find, string.lower, string.gmatch +local format, find, lower, gmatch, gsub = string.format, string.find, string.lower, string.gmatch, string.gsub -- one @@ -149,7 +149,7 @@ local data, done = { }, { } local function set(what,value) if type(what) == "string" then - what = aux.settings_to_array(what) + what = aux.settings_to_array(what) -- inefficient but ok end for i=1,#what do local w = what[i] @@ -174,6 +174,19 @@ local function reset() end end +local function enable(what) + set(what,true) +end + +local function disable(what) + if not what or what == "" then + done = { } + reset() + else + set(what,false) + end +end + function trackers.register(what,...) what = lower(what) local w = data[what] @@ -192,20 +205,20 @@ function trackers.register(what,...) end function trackers.enable(what) - done = { } - set(what,true) + local e = trackers.enable + trackers.enable, done = enable, { } + enable(string.simpleesc(what)) + trackers.enable, done = e, { } end function trackers.disable(what) - done = { } - if not what or what == "" then - trackers.reset(what) - else - set(what,false) - end + local e = trackers.disable + trackers.disable, done = disable, { } + disable(string.simpleesc(what)) + trackers.disable, done = e, { } end -function trackers.reset(what) +function trackers.reset() done = { } reset() end |