summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-par.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/trac-par.lua')
-rw-r--r--tex/context/base/trac-par.lua39
1 files changed, 11 insertions, 28 deletions
diff --git a/tex/context/base/trac-par.lua b/tex/context/base/trac-par.lua
index aab57ce5c..262a9cc33 100644
--- a/tex/context/base/trac-par.lua
+++ b/tex/context/base/trac-par.lua
@@ -1,25 +1,8 @@
-if not modules then modules = { } end modules ['trac-par'] = {
- version = 1.001,
- comment = "companion to node-par.mkiv",
- author = "Hans Hagen",
- copyright = "ConTeXt Development Team",
- license = "see context related readme files",
- comment = "a translation of the built in parbuilder, initial convertsin by Taco Hoekwater",
-}
+-- for the moment here:
local utfchar = utf.char
local concat = table.concat
-local nuts = nodes.nuts
-local tonut = nuts.tonut
-
-local getfield = nuts.getfield
-local getid = nuts.getid
-local getnext = nuts.getnext
-local getlist = nuts.getlist
-local getfont = nuts.getfont
-local getchar = nuts.getchar
-
local nodecodes = nodes.nodecodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
@@ -59,14 +42,14 @@ local function colorize(n)
-- tricky: the built-in method creates dummy fonts and the last line normally has the
-- original font and that one then has ex.auto set
while n do
- local id = getid(n)
+ local id = n.id
if id == glyph_code then
- local ne = getfield(n,"expansion_factor")
+ local ne = n.expansion_factor
if ne == 0 then
if length > 0 then flush() end
setnodecolor(n,"hz:zero")
else
- local f = getfont(n)
+ local f = n.font
if f ~= font then
if length > 0 then
flush()
@@ -96,8 +79,8 @@ local function colorize(n)
end
if trace_verbose then
length = length + 1
- list[length] = utfchar(getchar(n))
- width = width + getfield(n,"width") -- no kerning yet
+ list[length] = utfchar(n.char)
+ width = width + n.width -- no kerning yet
end
end
end
@@ -105,13 +88,13 @@ local function colorize(n)
if length > 0 then
flush()
end
- colorize(getlist(n),flush)
+ colorize(n.list,flush)
else -- nothing to show on kerns
if length > 0 then
flush()
end
end
- n = getnext(n)
+ n = n.next
end
if length > 0 then
flush()
@@ -121,14 +104,14 @@ end
builders.paragraphs.expansion = builders.paragraphs.expansion or { }
function builders.paragraphs.expansion.trace(head)
- colorize(tonut(head),true)
+ colorize(head,true)
return head
end
local tasks = nodes.tasks
--- tasks.prependaction("shipouts","normalizers","builders.paragraphs.expansion.trace")
--- tasks.disableaction("shipouts","builders.paragraphs.expansion.trace")
+tasks.prependaction("shipouts","normalizers","builders.paragraphs.expansion.trace")
+tasks.disableaction("shipouts","builders.paragraphs.expansion.trace")
local function set(v)
if v then