diff options
author | Karl Berry <karl@freefriends.org> | 2015-04-18 22:52:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-04-18 22:52:45 +0000 |
commit | 16aa5a7c87f18a2483d0d61795899f886781b51c (patch) | |
tree | 1d72f00b2a4185425393598402fe055c61d1de58 /Master/texmf-dist/tex/context/base/trac-tex.lua | |
parent | e68dc4d5506d46bf72823234f902bc76d1f70352 (diff) |
context, from www.pragma-ade.com/context/beta/cont-tmf.zip (18apr15)
git-svn-id: svn://tug.org/texlive/trunk@36923 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/trac-tex.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/trac-tex.lua | 77 |
1 files changed, 62 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/context/base/trac-tex.lua b/Master/texmf-dist/tex/context/base/trac-tex.lua index 7e340607313..5fe4754cbde 100644 --- a/Master/texmf-dist/tex/context/base/trac-tex.lua +++ b/Master/texmf-dist/tex/context/base/trac-tex.lua @@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['trac-tex'] = { -- moved from trac-deb.lua -local format = string.format +local next = next local texhashtokens = tex.hashtokens @@ -20,23 +20,70 @@ function trackers.savehash() saved = texhashtokens() end -function trackers.dumphashtofile(filename,delta) - local list, hash, command_name = { }, texhashtokens(), token.command_name - for name, token in next, hash do - if not delta or not saved[name] then - -- token: cmd, chr, csid -- combination cmd,chr determines name - local category = command_name(token) - local dk = list[category] - if not dk then - -- a bit funny names but this sorts better (easier to study) - dk = { names = { }, found = 0, code = token[1] } - list[category] = dk +if newtoken then + + function trackers.dumphashtofile(filename,delta) + local list = { } + local hash = tex.hashtokens() + local create = newtoken.create + for name, token in next, hash do + if not delta or not saved[name] then + if token[2] ~= 0 then -- still old interface + local token = create(name) + -- inspect(token) + local category = token.cmdname + local dk = list[category] + if not dk then + dk = { + names = { }, + found = 0, + -- code = token[1], + } + list[category] = dk + end + if token.protected then + if token.expandable then + dk.names[name] = "ep" + else + dk.names[name] = "-p" + end + else + if token.expandable then + dk.names[name] = "ep" + else + dk.names[name] = "--" + end + end + dk.found = dk.found + 1 + end end - dk.names[name] = { token[2], token[3] } - dk.found = dk.found + 1 end + table.save(filename or tex.jobname .. "-hash.log",list) end - io.savedata(filename or tex.jobname .. "-hash.log",table.serialize(list,true)) + +else + + function trackers.dumphashtofile(filename,delta) + local list = { } + local hash = texhashtokens() + local getname = token.command_name + for name, token in next, hash do + if not delta or not saved[name] then + -- token: cmd, chr, csid -- combination cmd,chr determines name + local category = getname(token) + local dk = list[category] + if not dk then + -- a bit funny names but this sorts better (easier to study) + dk = { names = { }, found = 0, code = token[1] } + list[category] = dk + end + dk.names[name] = { token[2], token[3] } + dk.found = dk.found + 1 + end + end + table.save(filename or tex.jobname .. "-hash.log",list) + end + end local delta = nil |