summaryrefslogtreecommitdiff
path: root/tex/context/base/node-tra.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-10-07 15:53:01 +0300
committerMarius <mariausol@gmail.com>2010-10-07 15:53:01 +0300
commit2040be98036288cccf0384479819e8c0c17e8d8d (patch)
tree1e775ec1491e701839806c9768d865ab829adccc /tex/context/base/node-tra.lua
parent592d84d67cf9d58d8a205b46bb912ed9fe84d7a2 (diff)
downloadcontext-2040be98036288cccf0384479819e8c0c17e8d8d.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.lua37
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))