diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-01-22 19:05:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-01-22 19:05:00 +0100 |
commit | 17f926ee2bc0c1e2d117085dbe80cedb96f30ab8 (patch) | |
tree | 5ced36b56dc014589b088f9b5091c88d539133dc /tex/context/base/node-tra.lua | |
parent | 6591e18e59fb54ae285d1a95ea74fc9101c00af8 (diff) | |
download | context-17f926ee2bc0c1e2d117085dbe80cedb96f30ab8.tar.gz |
beta 2010.01.22 19:05
Diffstat (limited to 'tex/context/base/node-tra.lua')
-rw-r--r-- | tex/context/base/node-tra.lua | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua index f709a8a6a..3534e9719 100644 --- a/tex/context/base/node-tra.lua +++ b/tex/context/base/node-tra.lua @@ -12,7 +12,7 @@ might become a runtime module instead.</p> --ldx]]-- local utf = unicode.utf8 -local format, match, concat, utfchar = string.format, string.match, table.concat, utf.char +local format, match, concat, rep, utfchar = string.format, string.match, table.concat, string.rep, utf.char local ctxcatcodes = tex.ctxcatcodes @@ -26,6 +26,8 @@ nodes.tracers.characters = nodes.tracers.characters or { } nodes.tracers.steppers = nodes.tracers.steppers or { } local glyph = node.id('glyph') +local hlist = node.id('hlist') +local vlist = node.id('vlist') local disc = node.id('disc') local glue = node.id('glue') local kern = node.id('kern') @@ -420,3 +422,26 @@ function nodes.ids_to_string(head,tail) end nodes.ids_tostring = nodes.ids_to_string + +local function show_simple_list(h,depth,n) + while h do + texio.write_nl(rep(" ",n) .. tostring(h)) + if not depth or n < depth then + local id = h.id + if id == hlist or id == vlist then + show_simple_list(h.list,depth,n+1) + end + end + h = h.next + end +end + +--~ \startluacode +--~ callback.register('buildpage_filter',function() nodes.show_simple_list(tex.lists.contrib_head) end) +--~ \stopluacode +--~ \vbox{b\footnote{n}a} +--~ \startluacode +--~ callback.register('buildpage_filter',nil) +--~ \stopluacode + +nodes.show_simple_list = function(h,depth) show_simple_list(h,depth,0) end |