diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-10-06 10:20:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-10-06 10:20:00 +0200 |
commit | e34ee22d154fbde65af2d2c6283e0049b41dee8b (patch) | |
tree | 6cb862be83fd861d5cf57e2c9aa764221d83f152 /tex/context/base/node-tra.lua | |
parent | 26e9babbd527be8c77f9eabf089aa0763aabc3bd (diff) | |
download | context-e34ee22d154fbde65af2d2c6283e0049b41dee8b.tar.gz |
beta 2010.10.06 10:20
Diffstat (limited to 'tex/context/base/node-tra.lua')
-rw-r--r-- | tex/context/base/node-tra.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua index c5cf04126..a5056d88d 100644 --- a/tex/context/base/node-tra.lua +++ b/tex/context/base/node-tra.lua @@ -483,6 +483,43 @@ function nodes.idstostring(head,tail) return concat(t," ") end +--~ function nodes.xidstostring(head,tail) -- only for special tracing of backlinks +--~ local n = head +--~ while n.next do +--~ n = n.next +--~ end +--~ local t, last_id, last_n = { }, nil, 0 +--~ while n do +--~ local id = n.id +--~ if not last_id then +--~ last_id, last_n = id, 1 +--~ elseif last_id == id then +--~ last_n = last_n + 1 +--~ else +--~ if last_n > 1 then +--~ t[#t+1] = format("[%s*%s]",last_n,node_type(last_id) or "?") +--~ else +--~ t[#t+1] = format("[%s]",node_type(last_id) or "?") +--~ end +--~ last_id, last_n = id, 1 +--~ end +--~ if n == head then +--~ break +--~ end +--~ n = n.prev +--~ end +--~ if not last_id then +--~ t[#t+1] = "no nodes" +--~ elseif last_n > 1 then +--~ t[#t+1] = format("[%s*%s]",last_n,node_type(last_id) or "?") +--~ else +--~ t[#t+1] = format("[%s]",node_type(last_id) or "?") +--~ end +--~ return table.concat(table.reverse(t)," ") +--~ end + + + local function showsimplelist(h,depth,n) while h do write_nl(rep(" ",n) .. tostring(h)) |