diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-17 10:31:56 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-17 10:31:56 +0100 |
commit | b14f992ef5f4e868c9959b174278c86516d60dbc (patch) | |
tree | 28587bb46c025ea7b0d27ba93f09c93dcf53c73a /tex/context/base/mkiv/node-tra.lua | |
parent | 95a1799032dc61dbca4a11e495be34b4397c8fec (diff) | |
download | context-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz |
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/node-tra.lua')
-rw-r--r-- | tex/context/base/mkiv/node-tra.lua | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/node-tra.lua b/tex/context/base/mkiv/node-tra.lua index b3b4311e7..0d3192559 100644 --- a/tex/context/base/mkiv/node-tra.lua +++ b/tex/context/base/mkiv/node-tra.lua @@ -47,10 +47,14 @@ local getsubtype = nuts.getsubtype local getlist = nuts.getlist local getdisc = nuts.getdisc local setattr = nuts.setattr +local getglue = nuts.getglue local isglyph = nuts.isglyph +local getcomponents = nuts.getcomponents +local getdir = nuts.getdir +local getwidth = nuts.getwidth local flush_list = nuts.flush_list -local count_nodes = nuts.count +local count_nodes = nuts.countall local used_nodes = nuts.usedlist local traverse_by_id = nuts.traverse_id @@ -121,6 +125,7 @@ function nodes.handlers.checkforleaks(sparse) end local f_sequence = formatters["U+%04X:%s"] +local f_subrange = formatters["[[ %s ][ %s ][ %s ]]"] local function tosequence(start,stop,compact) if start then @@ -131,7 +136,7 @@ local function tosequence(start,stop,compact) local c, id = isglyph(start) if c then if compact then - local components = getfield(start,"components") + local components = getcomponents(start) if components then t[#t+1] = tosequence(components,nil,compact) else @@ -140,6 +145,9 @@ local function tosequence(start,stop,compact) else t[#t+1] = f_sequence(c,utfchar(c)) end + elseif id == disc_code then + local pre, post, replace = getdisc(start) + t[#t+1] = f_subrange(pre and tosequence(pre),post and tosequence(post),replace and tosequence(replace)) elseif id == rule_code then if compact then t[#t+1] = "|" @@ -147,7 +155,7 @@ local function tosequence(start,stop,compact) t[#t+1] = nodecodes[id] end elseif id == dir_code or id == localpar_code then - t[#t+1] = "[" .. getfield(start,"dir") .. "]" + t[#t+1] = "[" .. getdir(start) .. "]" elseif compact then t[#t+1] = "[]" else @@ -310,7 +318,7 @@ local function listtoutf(h,joiner,textonly,last,nodisc) end elseif textonly then if id == glue_code then - if getfield(h,"width") > 0 then + if getwidth(h) > 0 then w[#w+1] = " " end elseif id == hlist_code or id == vlist_code then @@ -375,7 +383,7 @@ local function nodetodimen(n) n = tonut(n) local id = getid(n) if id == kern_code then - local width = getfield(n,"width") + local width = getwidth(n) if width == 0 then return "0pt" else @@ -384,11 +392,10 @@ local function nodetodimen(n) elseif id ~= glue_code then return "0pt" end - local stretch_order = getfield(n,"stretch_order") - local shrink_order = getfield(n,"shrink_order") - local stretch = getfield(n,"stretch") / 65536 - local shrink = getfield(n,"shrink") / 65536 - local width = getfield(n,"width") / 65536 + local width, stretch, shrink, stretch_order, shrink_order = getglue(n) + stretch = stretch / 65536 + shrink = shrink / 65536 + width = width / 65536 if stretch_order ~= 0 then if shrink_order ~= 0 then return f_f_f(width,stretch,fillorders[stretch_order],shrink,fillorders[shrink_order]) |