summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-05-16 11:46:45 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-05-16 11:46:45 +0200
commit330909ad62342ff873dc758b909968c66d0252a4 (patch)
tree72b7552cdc6925b962badb33aa9b307d949144b0 /tex/context/base/mkiv
parent4396699cb99f42f6378ed7229788bbceb898851a (diff)
downloadcontext-330909ad62342ff873dc758b909968c66d0252a4.tar.gz
2021-05-15 22:44:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/anch-pgr.lua24
-rw-r--r--tex/context/base/mkiv/attr-ini.lua4
-rw-r--r--tex/context/base/mkiv/attr-ini.mkiv16
-rw-r--r--tex/context/base/mkiv/back-exp.lua4
-rw-r--r--tex/context/base/mkiv/blob-ini.lua56
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua13
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-cff.lua43
-rw-r--r--tex/context/base/mkiv/font-chk.lua6
-rw-r--r--tex/context/base/mkiv/font-col.lua1
-rw-r--r--tex/context/base/mkiv/font-lib.mkvi4
-rw-r--r--tex/context/base/mkiv/font-mis.lua2
-rw-r--r--tex/context/base/mkiv/font-mps.lua6
-rw-r--r--tex/context/base/mkiv/font-nod.lua20
-rw-r--r--tex/context/base/mkiv/font-ocl.lua24
-rw-r--r--tex/context/base/mkiv/font-ocm.lua78
-rw-r--r--tex/context/base/mkiv/font-osd.lua28
-rw-r--r--tex/context/base/mkiv/font-ota.lua10
-rw-r--r--tex/context/base/mkiv/font-otj.lua80
-rw-r--r--tex/context/base/mkiv/font-otl.lua2
-rw-r--r--tex/context/base/mkiv/font-otr.lua4
-rw-r--r--tex/context/base/mkiv/font-ots.lua97
-rw-r--r--tex/context/base/mkiv/font-phb.lua2
-rw-r--r--tex/context/base/mkiv/font-sol.lua38
-rw-r--r--tex/context/base/mkiv/font-txt.lua30
-rw-r--r--tex/context/base/mkiv/good-mth.lua6
-rw-r--r--tex/context/base/mkiv/grph-inc.lua5
-rw-r--r--tex/context/base/mkiv/lang-dis.lua13
-rw-r--r--tex/context/base/mkiv/lang-exp.lua6
-rw-r--r--tex/context/base/mkiv/lang-hyp.lua30
-rw-r--r--tex/context/base/mkiv/lang-ini.lua17
-rw-r--r--tex/context/base/mkiv/lang-rep.lua20
-rw-r--r--tex/context/base/mkiv/lang-tra.lua4
-rw-r--r--tex/context/base/mkiv/lpdf-fld.lua2
-rw-r--r--tex/context/base/mkiv/lpdf-mov.lua5
-rw-r--r--tex/context/base/mkiv/lpdf-wid.lua13
-rw-r--r--tex/context/base/mkiv/math-dir.lua8
-rw-r--r--tex/context/base/mkiv/math-noa.lua28
-rw-r--r--tex/context/base/mkiv/math-tag.lua4
-rw-r--r--tex/context/base/mkiv/meta-blb.lua6
-rw-r--r--tex/context/base/mkiv/meta-imp-txt.mkiv2
-rw-r--r--tex/context/base/mkiv/mlib-pdf.lua5
-rw-r--r--tex/context/base/mkiv/mlib-pps.lua8
-rw-r--r--tex/context/base/mkiv/mult-fmt.lua10
-rw-r--r--tex/context/base/mkiv/node-acc.lua10
-rw-r--r--tex/context/base/mkiv/node-aux.lua90
-rw-r--r--tex/context/base/mkiv/node-bck.lua4
-rw-r--r--tex/context/base/mkiv/node-bwc.lua92
-rw-r--r--tex/context/base/mkiv/node-fin.lua164
-rw-r--r--tex/context/base/mkiv/node-fnt.lua16
-rw-r--r--tex/context/base/mkiv/node-gcm.lua66
-rw-r--r--tex/context/base/mkiv/node-ini.mkiv1
-rw-r--r--tex/context/base/mkiv/node-ltp.lua76
-rw-r--r--tex/context/base/mkiv/node-met.lua202
-rw-r--r--tex/context/base/mkiv/node-mig.lua2
-rw-r--r--tex/context/base/mkiv/node-nut.lua275
-rw-r--r--tex/context/base/mkiv/node-ppt.lua2
-rw-r--r--tex/context/base/mkiv/node-pro.lua8
-rw-r--r--tex/context/base/mkiv/node-ref.lua9
-rw-r--r--tex/context/base/mkiv/node-res.lua36
-rw-r--r--tex/context/base/mkiv/node-rul.lua44
-rw-r--r--tex/context/base/mkiv/node-scn.lua2
-rw-r--r--tex/context/base/mkiv/node-ser.lua7
-rw-r--r--tex/context/base/mkiv/node-shp.lua2
-rw-r--r--tex/context/base/mkiv/node-syn.lua28
-rw-r--r--tex/context/base/mkiv/node-tra.lua6
-rw-r--r--tex/context/base/mkiv/node-typ.lua15
-rw-r--r--tex/context/base/mkiv/pack-rul.lua6
-rw-r--r--tex/context/base/mkiv/page-cst.lua5
-rw-r--r--tex/context/base/mkiv/page-ini.lua171
-rw-r--r--tex/context/base/mkiv/page-ini.mkiv26
-rw-r--r--tex/context/base/mkiv/page-mix.lua4
-rw-r--r--tex/context/base/mkiv/page-mix.mkiv4
-rw-r--r--tex/context/base/mkiv/page-str.lua8
-rw-r--r--tex/context/base/mkiv/scrn-hlp.lua4
-rw-r--r--tex/context/base/mkiv/scrp-cjk.lua212
-rw-r--r--tex/context/base/mkiv/scrp-ini.lua112
-rw-r--r--tex/context/base/mkiv/spac-ali.lua2
-rw-r--r--tex/context/base/mkiv/spac-chr.lua26
-rw-r--r--tex/context/base/mkiv/spac-ver.lua59
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23954 -> 23942 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin225900 -> 228905 bytes
-rw-r--r--tex/context/base/mkiv/supp-box.lua72
-rw-r--r--tex/context/base/mkiv/syst-lua.lua47
-rw-r--r--tex/context/base/mkiv/tabl-xtb.lua20
-rw-r--r--tex/context/base/mkiv/task-ini.lua2
-rw-r--r--tex/context/base/mkiv/toks-ini.lua225
-rw-r--r--tex/context/base/mkiv/trac-jus.lua4
-rw-r--r--tex/context/base/mkiv/trac-vis.lua66
-rw-r--r--tex/context/base/mkiv/typo-bld.lua6
-rw-r--r--tex/context/base/mkiv/typo-brk.lua32
-rw-r--r--tex/context/base/mkiv/typo-cap.lua18
-rw-r--r--tex/context/base/mkiv/typo-chr.lua10
-rw-r--r--tex/context/base/mkiv/typo-dha.lua35
-rw-r--r--tex/context/base/mkiv/typo-dig.lua13
-rw-r--r--tex/context/base/mkiv/typo-drp.lua11
-rw-r--r--tex/context/base/mkiv/typo-dua.lua19
-rw-r--r--tex/context/base/mkiv/typo-dub.lua19
-rw-r--r--tex/context/base/mkiv/typo-duc.lua19
-rw-r--r--tex/context/base/mkiv/typo-fkr.lua6
-rw-r--r--tex/context/base/mkiv/typo-fln.lua30
-rw-r--r--tex/context/base/mkiv/typo-itc.lua34
-rw-r--r--tex/context/base/mkiv/typo-krn.lua25
-rw-r--r--tex/context/base/mkiv/typo-lin.lua30
-rw-r--r--tex/context/base/mkiv/typo-mar.lua18
-rw-r--r--tex/context/base/mkiv/typo-pag.lua8
-rw-r--r--tex/context/base/mkiv/typo-pnc.lua4
-rw-r--r--tex/context/base/mkiv/typo-rep.lua1
-rw-r--r--tex/context/base/mkiv/typo-rub.lua3
-rw-r--r--tex/context/base/mkiv/typo-spa.lua16
-rw-r--r--tex/context/base/mkiv/typo-sus.lua20
-rw-r--r--tex/context/base/mkiv/typo-tal.lua22
-rw-r--r--tex/context/base/mkiv/typo-wrp.lua2
-rw-r--r--tex/context/base/mkiv/typo-wrp.mkiv2
115 files changed, 1780 insertions, 1643 deletions
diff --git a/tex/context/base/mkiv/anch-pgr.lua b/tex/context/base/mkiv/anch-pgr.lua
index 8e400cd12..e822f12b4 100644
--- a/tex/context/base/mkiv/anch-pgr.lua
+++ b/tex/context/base/mkiv/anch-pgr.lua
@@ -24,6 +24,7 @@ local lpegmatch = lpeg.match
local jobpositions = job.positions
local formatters = string.formatters
local setmetatableindex = table.setmetatableindex
+local settings_to_array = utilities.parsers.settings_to_array
local enableaction = nodes.tasks.enableaction
@@ -32,6 +33,7 @@ local context = context
local implement = interfaces.implement
+local texgetcount = tex.getcount
local report_graphics = logs.reporter("backgrounds")
local report_shapes = logs.reporter("backgrounds","shapes")
local report_free = logs.reporter("backgrounds","free")
@@ -78,9 +80,10 @@ local getdepth = nuts.getdepth
local nodecodes = nodes.nodecodes
local par_code = nodecodes.par
-local start_of_par = nuts.start_of_par
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local startofpar = nuts.startofpar
+
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local processranges = nuts.processranges
@@ -165,12 +168,12 @@ local function flush(head,f,l,a,parent,depth)
ln = new_hlist(setlink(new_rule(65536,65536*4,0),new_kern(-65536),ln))
rn = new_hlist(setlink(new_rule(65536,0,65536*4),new_kern(-65536),rn))
end
- if getid(f) == par_code and start_of_par(f) then -- we need to clean this mess
- insert_after(head,f,ln)
+ if getid(f) == par_code and startofpar(f) then -- we need to clean this mess
+ insertafter(head,f,ln)
else
- head, f = insert_before(head,f,ln)
+ head, f = insertbefore(head,f,ln)
end
- insert_after(head,l,rn)
+ insertafter(head,l,rn)
end
return head, true
end
@@ -222,7 +225,8 @@ end
nodes.handlers.textbackgrounds = function(head,where,parent) -- we have hlistdir and local dir
-- todo enable action in register
- index = index + 1
+ index = index + 1
+ realpage = texgetcount("realpageno")
return processranges(a_textbackground,flush,head,parent)
end
@@ -235,8 +239,6 @@ interfaces.implement {
-- optimized already but we can assume a cycle i.e. prune the last point and then
-- even less code .. we could merge some loops but his is more robust
--- use idiv here
-
local function topairs(t,n)
local r = { }
for i=1,n do
@@ -1213,7 +1215,7 @@ implement {
actions = function(tags,anchor,page) -- no caching (yet) / page
local collected = jobpositions.collected
if type(tags) == "string" then
- tags = utilities.parsers.settings_to_array(tags)
+ tags = settings_to_array(tags)
end
local list = { }
local nofboxes = 0
diff --git a/tex/context/base/mkiv/attr-ini.lua b/tex/context/base/mkiv/attr-ini.lua
index 5507f2a70..b05c343e5 100644
--- a/tex/context/base/mkiv/attr-ini.lua
+++ b/tex/context/base/mkiv/attr-ini.lua
@@ -35,8 +35,8 @@ attributes.states = attributes.states or { }
attributes.handlers = attributes.handlers or { }
attributes.unsetvalue = -0x7FFFFFFF
-local currentfont = font.current -- mabe nicer is attributes.current
-local currentattributes = node.current_attributes -- mabe nicer is fonts .current
+local currentfont = font.current
+local currentattributes = nodes and nodes.currentattributes or node.currentattributes or node.current_attr -- no nodes table yet
local names = attributes.names
local numbers = attributes.numbers
diff --git a/tex/context/base/mkiv/attr-ini.mkiv b/tex/context/base/mkiv/attr-ini.mkiv
index 71c6478f8..ad40a1ffe 100644
--- a/tex/context/base/mkiv/attr-ini.mkiv
+++ b/tex/context/base/mkiv/attr-ini.mkiv
@@ -168,19 +168,3 @@
% \to \everyafterpagebreak
\protect \endinput
-
-% for the luatex list:
-%
-% \attributedef\zeroattribute=0
-% \attributedef\someattribute=999
-%
-% \directlua {
-% local createtoken = newtoken.create
-% function attributenumber(name)
-% local n = createtoken(name).mode - createtoken("zeroattribute").mode
-% return n >= 0 and n or false
-% end
-% }
-%
-% \directlua{print(attributenumber("noneattribute"))}
-% \directlua{print(attributenumber("someattribute"))}
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index 7a37cc948..5928da538 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -3020,7 +3020,7 @@ local collectresults do -- too many locals otherwise
local getkern = nuts.getkern
local getwidth = nuts.getwidth
- local start_of_par = nuts.start_of_par
+ local startofpar = nuts.startofpar
local nexthlist = nuts.traversers.hlist
local nextnode = nuts.traversers.node
@@ -3390,7 +3390,7 @@ end
last = nil
currentparagraph = nil
end
- elseif not paragraph and id == par_code and start_of_par(n) then
+ elseif not paragraph and id == par_code and startofpar(n) then
paragraph = getattr(n,a_taggedpar)
elseif id == disc_code then
-- very unlikely because we stripped them
diff --git a/tex/context/base/mkiv/blob-ini.lua b/tex/context/base/mkiv/blob-ini.lua
index 0b35c3b65..012b4ddb0 100644
--- a/tex/context/base/mkiv/blob-ini.lua
+++ b/tex/context/base/mkiv/blob-ini.lua
@@ -25,28 +25,26 @@ if not modules then modules = { } end modules ['blob-ini'] = {
local type, tostring = type, tostring
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
-local report_blobs = logs.reporter("blobs")
+local report_blobs = logs.reporter("blobs")
-local flush_node_list = node.flush_list
-local hpack_node_list = node.hpack
------ vpack_node_list = node.vpack
-local write_node = node.write
+local flushnodelist = nodes.flushlist
+local hpacknodelist = nodes.hpack
-local typesetters = nodes.typesetters
-local tonodes = typesetters.tonodes
-local tohpack = typesetters.tohpack
-local tovpack = typesetters.tovpack
+local typesetters = nodes.typesetters
+local tonodes = typesetters.tonodes
+local tohpack = typesetters.tohpack
+local tovpack = typesetters.tovpack
-local implement = interfaces.implement
+local context = context
--- provide copies here (nicer for manuals)
+local implement = interfaces.implement
-blobs = blobs or { }
-local blobs = blobs
+blobs = blobs or { }
+local blobs = blobs
-blobs.tonodes = tonodes
-blobs.tohpack = tohpack
-blobs.tovpack = tovpack
+blobs.tonodes = tonodes
+blobs.tohpack = tohpack
+blobs.tovpack = tovpack
-- end of helpers
@@ -68,7 +66,7 @@ function blobs.dispose(t)
local li = list[i]
local pack = li.pack
if pack then
- flush_node_list(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -96,14 +94,14 @@ function blobs.pack(t,how)
for i=1,#list do
local pack = list[i].pack
if pack then
- flush_node_list(node.pack)
+ flushnodelist(pack)
end
if how == "vertical" then
-- we need to prepend a local par node
-- list[i].pack = vpack_node_list(list[i].head,"exactly")
report_blobs("vpack not yet supported")
else
- list[i].pack = hpack_node_list(list[i].head,"exactly")
+ list[i].pack = hpacknodelist(list[i].head,"exactly")
end
end
end
@@ -114,8 +112,8 @@ function blobs.write(t)
local li = list[i]
local pack = li.pack
if pack then
- write_node(pack)
- flush_node_list(pack)
+ context(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -158,28 +156,28 @@ end
local function strwd(str)
local l = tohpack(str)
local w = l.width
- flush_node_list(l)
+ flushnodelist(l)
return w
end
local function strht(str)
local l = tohpack(str)
local h = l.height
- flush_node_list(l)
+ flushnodelist(l)
return h
end
local function strdp(str)
local l = tohpack(str)
local d = l.depth
- flush_node_list(l)
+ flushnodelist(l)
return d
end
local function strhd(str)
local l = tohpack(str)
local s = l.height + l.depth
- flush_node_list(l)
+ flushnodelist(l)
return s
end
@@ -192,7 +190,7 @@ blobs.strhd = strhd
local scan_hbox = tokens.scanners.hbox
-implement { name = "strwd", actions = function() local l = scan_hbox() context(l.width) flush_node_list(l) end }
-implement { name = "strht", actions = function() local l = scan_hbox() context(l.height) flush_node_list(l) end }
-implement { name = "strdp", actions = function() local l = scan_hbox() context(l.depth) flush_node_list(l) end }
-implement { name = "strhd", actions = function() local l = scan_hbox() context(l.height + l.depth) flush_node_list(l) end }
+implement { name = "strwd", actions = function() local l = scan_hbox() context(l.width) flushnodelist(l) end }
+implement { name = "strht", actions = function() local l = scan_hbox() context(l.height) flushnodelist(l) end }
+implement { name = "strdp", actions = function() local l = scan_hbox() context(l.depth) flushnodelist(l) end }
+implement { name = "strhd", actions = function() local l = scan_hbox() context(l.height + l.depth) flushnodelist(l) end }
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index 5d4b3d8a8..10d87e139 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -98,16 +98,21 @@ local texsprint = tex.sprint -- just appended (no space,eol treatment
local texprint = tex.print -- each arg a separate line (not last in directlua)
----- texwrite = tex.write -- all 'space' and 'character'
-local isnode = node.is_node
+-- In this stage we don't yet have nodes populated so we access the library directly ...
+
+local isnode = node.isnode or node.is_node
+local copynodelist = node.copylist or node.copy_list
local writenode = node.write
-local copynodelist = node.copy_list
local tonut = node.direct.todirect
local tonode = node.direct.tonode
-local istoken = token.is_token
local newtoken = token.new
local createtoken = token.create
-local setluatoken = token.set_lua
+
+local istoken = token.istoken or token.is_token
+local setluatoken = token.setlua or token.set_lua
+
+-- ... till here.
local isprintable = tex.isprintable or function(n)
return n and (type(n) == "string" or isnode(n) or istoken(n))
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 9d7c8e584..26567e338 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.05.09 17:12}
+\newcontextversion{2021.05.15 22:41}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index b0a0aae71..57c7c2001 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.05.09 17:12}
+\edef\contextversion{2021.05.15 22:41}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-cff.lua b/tex/context/base/mkiv/font-cff.lua
index 4e2981011..ff87292ba 100644
--- a/tex/context/base/mkiv/font-cff.lua
+++ b/tex/context/base/mkiv/font-cff.lua
@@ -29,7 +29,7 @@ if not modules then modules = { } end modules ['font-cff'] = {
local next, type, tonumber, rawget = next, type, tonumber, rawget
local byte, char, gmatch, sub = string.byte, string.char, string.gmatch, string.sub
-local concat, remove, unpack = table.concat, table.remove, table.unpack
+local concat, insert, remove, unpack = table.concat, table.insert, table.remove, table.unpack
local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max
local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct
local lpegmatch = lpeg.match
@@ -745,6 +745,13 @@ do
-- some back. I inlined some of then and a bit speed can be gained by more
-- inlining but not that much.
+ -- Maybe have several action tables:
+ --
+ -- keep curve / checked
+ -- keep curve / not checked
+ -- checked
+ -- not checked
+
local function xymoveto()
if keepcurve then
r = r + 1
@@ -1968,8 +1975,38 @@ do
showstate(reverse[t] or "<action>")
end
if top > 0 then
- for i=1,top do
- r = r + 1 ; result[r] = encode[stack[i]]
+ -- if t == 8 and top > 42 then
+ if t == 8 and top > 48 then
+ -- let's assume this only happens for rrcurveto .. the other ones would need some more
+ -- complex handling (cff2 stuff)
+ local n = 0
+ for i=1,top do
+ -- if n == 42 then
+ if n == 48 then
+ local zero = encode[0]
+ local res3 = result[r-3]
+ local res2 = result[r-2]
+ local res1 = result[r-1]
+ local res0 = result[r]
+ result[r-3] = zero
+ result[r-2] = zero
+ r = r + 1 ; result[r] = chars[t]
+ r = r + 1 ; result[r] = zero
+ r = r + 1 ; result[r] = zero
+ r = r + 1 ; result[r] = res3
+ r = r + 1 ; result[r] = res2
+ r = r + 1 ; result[r] = res1
+ r = r + 1 ; result[r] = res0
+ n = 1
+ else
+ n = n + 1
+ end
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
end
top = 0
end
diff --git a/tex/context/base/mkiv/font-chk.lua b/tex/context/base/mkiv/font-chk.lua
index e18e4b804..693823a86 100644
--- a/tex/context/base/mkiv/font-chk.lua
+++ b/tex/context/base/mkiv/font-chk.lua
@@ -64,7 +64,7 @@ local implement = interfaces.implement
local glyph_code = nodes.nodecodes.glyph
local new_special = nodes.pool.special -- todo: literal
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -75,7 +75,7 @@ local setchar = nuts.setchar
local nextglyph = nuts.traversers.glyph
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
-- maybe in fonts namespace
-- deletion can be option
@@ -324,7 +324,7 @@ function checkers.missing(head)
local char, font = isglyph(node)
local kind, char = placeholder(font,char)
if kind == "node" then
- insert_node_after(head,node,tonut(char))
+ insertnodeafter(head,node,tonut(char))
head = remove_node(head,node,true)
elseif kind == "char" then
setchar(node,char)
diff --git a/tex/context/base/mkiv/font-col.lua b/tex/context/base/mkiv/font-col.lua
index c47a29906..ea9b9c98c 100644
--- a/tex/context/base/mkiv/font-col.lua
+++ b/tex/context/base/mkiv/font-col.lua
@@ -22,7 +22,6 @@ local nuts = nodes.nuts
local setfont = nuts.setfont
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local settings_to_hash = utilities.parsers.settings_to_hash
diff --git a/tex/context/base/mkiv/font-lib.mkvi b/tex/context/base/mkiv/font-lib.mkvi
index d05872653..dcb1ff1bb 100644
--- a/tex/context/base/mkiv/font-lib.mkvi
+++ b/tex/context/base/mkiv/font-lib.mkvi
@@ -52,9 +52,9 @@
% \ifcase\directlua{tex.print(callback.list()["provide_charproc_data"] == false and 1 or 0)}\relax
% % this is the generic variant that will become luatex-fonts-ocl once we have
% % more recent versions of luatex 1.13/1.14 on the garden
- \registerctxluafile{font-ocl}{}
+% \registerctxluafile{font-ocl}{}
% \else
-% \registerctxluafile{font-ocm}{}
+ \registerctxluafile{font-ocm}{}
% \fi
% we use otf code for type one
diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua
index 18120f524..8404c04f6 100644
--- a/tex/context/base/mkiv/font-mis.lua
+++ b/tex/context/base/mkiv/font-mis.lua
@@ -21,7 +21,7 @@ local readers = otf.readers
if readers then
- otf.version = otf.version or 3.113
+ otf.version = otf.version or 3.114
otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true)
function fonts.helpers.getfeatures(name,save)
diff --git a/tex/context/base/mkiv/font-mps.lua b/tex/context/base/mkiv/font-mps.lua
index 8bfe23b89..d75267a09 100644
--- a/tex/context/base/mkiv/font-mps.lua
+++ b/tex/context/base/mkiv/font-mps.lua
@@ -279,7 +279,7 @@ local getdepth = nuts.getdepth
local getexpansion = nuts.getexpansion
local isglyph = nuts.isglyph
-local effective_glue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local characters = fonts.hashes.characters
local parameters = fonts.hashes.parameters
@@ -362,7 +362,7 @@ function fonts.metapost.boxtomp(n,kind)
elseif id == kern_code then
dx = dx + getkern(current) * fc
elseif id == glue_code then
- dx = dx + effective_glue(current,parent) * fc
+ dx = dx + effectiveglue(current,parent) * fc
elseif id == hlist_code then
local list = getlist(current)
if list then
@@ -420,7 +420,7 @@ function fonts.metapost.boxtomp(n,kind)
elseif id == kern_code then
dy = dy - getkern(current) * fc
elseif id == glue_code then
- dy = dy - effective_glue(current,parent) * fc
+ dy = dy - effectiveglue(current,parent) * fc
elseif id == rule_code then
local wd, ht, dp = getwhd(current)
local hd = (ht + dp) * fc
diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua
index ed307e7c5..a7dcfd9b0 100644
--- a/tex/context/base/mkiv/font-nod.lua
+++ b/tex/context/base/mkiv/font-nod.lua
@@ -70,11 +70,11 @@ local setbox = nuts.setbox
local setchar = nuts.setchar
local setsubtype = nuts.setsubtype
-local copy_node_list = nuts.copy_list
-local hpack_node_list = nuts.hpack
-local flush_node_list = nuts.flush_list
-local protect_glyphs = nuts.protect_glyphs
-local start_of_par = nuts.start_of_par
+local copy_node_list = nuts.copylist
+local hpacknodelist = nuts.hpack
+local flushnodelist = nuts.flushlist
+local protectglyphs = nuts.protectglyphs
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nextglyph = nuts.traversers.glyph
@@ -144,7 +144,7 @@ function step_tracers.reset()
for i=1,#collection do
local c = collection[i]
if c then
- flush_node_list(c)
+ flushnodelist(c)
end
end
collection, messages = { }, { }
@@ -158,7 +158,7 @@ function step_tracers.glyphs(n,i)
local c = collection[i]
if c then
local c = copy_node_list(c)
- local b = hpack_node_list(c) -- multiple arguments
+ local b = hpacknodelist(c) -- multiple arguments
setbox(n,b)
end
end
@@ -266,7 +266,7 @@ function step_tracers.codes(i,command,space)
local char, id = isglyph(c)
if char then
showchar(char,id)
- elseif id == dir_code or (id == par_code and start_of_par(c)) then
+ elseif id == dir_code or (id == par_code and startofpar(c)) then
context("[%s]",getdirection(c) or "?")
elseif id == disc_code then
local pre, post, replace = getdisc(c)
@@ -317,7 +317,7 @@ function step_tracers.check(head)
if l then -- hm, can be false
n = l
end
- protect_glyphs(n)
+ protectglyphs(n)
collection[1] = n
end
end
@@ -333,7 +333,7 @@ function step_tracers.register(head)
if l then -- hm, can be false
n = l
end
- protect_glyphs(n)
+ protectglyphs(n)
collection[nc] = n
end
end
diff --git a/tex/context/base/mkiv/font-ocl.lua b/tex/context/base/mkiv/font-ocl.lua
index e6a38af5c..9e1f49433 100644
--- a/tex/context/base/mkiv/font-ocl.lua
+++ b/tex/context/base/mkiv/font-ocl.lua
@@ -370,13 +370,24 @@ if context then
local xmlconvert = xml.convert
local xmlfirst = xml.first
+ -- function otfsvg.filterglyph(entry,index)
+ -- -- we only support decompression in lmtx, so one needs to wipe the
+ -- -- cache when invalid xml is reported
+ -- local svg = xmlconvert(entry.data)
+ -- local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
+ -- local data = root and tostring(root)
+ -- -- report_svg("data for glyph %04X: %s",index,data)
+ -- return data
+ -- end
+
function otfsvg.filterglyph(entry,index)
- -- we only support decompression in lmtx, so one needs to wipe the
- -- cache when invalid xml is reported
- local svg = xmlconvert(entry.data)
+ local d = entry.data
+ if gzip.compressed(d) then
+ d = gzip.decompress(d) or d
+ end
+ local svg = xmlconvert(d)
local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
local data = root and tostring(root)
- -- report_svg("data for glyph %04X: %s",index,data)
return data
end
@@ -412,6 +423,9 @@ end
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -432,7 +446,7 @@ end
local nofshapes = #svgshapes
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
diff --git a/tex/context/base/mkiv/font-ocm.lua b/tex/context/base/mkiv/font-ocm.lua
index 2f6c29e65..bb1550ac9 100644
--- a/tex/context/base/mkiv/font-ocm.lua
+++ b/tex/context/base/mkiv/font-ocm.lua
@@ -408,6 +408,7 @@ local pdftovirtual do
scale = scale * (width / (xform.width * bpfactor))
dy = - depth + dy
+-- png .. no time to figure it out now
-- dx = 0
-- dy = 0
local object = pdf.immediateobj("stream",f_stream(width,scale,scale,dx,dy,c)), width
@@ -558,6 +559,9 @@ local initializesvg do
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -578,7 +582,7 @@ local initializesvg do
local nofshapes = #svgshapes
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -695,34 +699,53 @@ end
local initializepng do
- local otfpng = otf.png or { }
- otf.png = otfpng
- otf.pngenabled = true
+ -- Alternatively we can create a single pdf file with -adjoin and then pick up pages from
+ -- that file but creating thousands of small files is no fun either.
+ local otfpng = otf.png or { }
+ otf.png = otfpng
+ otf.pngenabled = true
local report_png = logs.reporter("fonts","png conversion")
-
local loaddata = io.loaddata
local savedata = io.savedata
local remove = os.remove
-
- local runner = sandbox and sandbox.registerrunner {
- name = "otfpng",
- program = "gm",
- template = "convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log",
- -- reporter = report_png,
- }
-
- if not runner then
- --
- -- poor mans variant for generic:
- --
- runner = function()
- return os.execute("gm convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log")
+ local texhack = [[\startTEXpage\externalfigure[temp-otf-png-shape.png]\stopTEXpage]]
+ local runner = false
+ local method = "gm"
+
+ local function initialize(v)
+ if v == "lmtx" then
+ report_png("using lmtx converter, slow but okay")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "mtxrun --script context",
+ template = "--once --batch --silent temp-otf-png-shape.tex > temp-otf-svg-shape.log",
+ }
+ method = v
+ elseif v == "mutool" then
+ report_png("using lmtx converter, no mask, black background")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "mutool",
+ template = "convert -o temp-otf-png-shape.pdf temp-otf-png-shape.png",
+ }
+ method = v
+ else
+ report_png("using lmtx converter, no mask, white background")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "gm",
+ template = "convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log",
+ }
+ method = "gm"
end
+ return runner
end
- -- Alternatively we can create a single pdf file with -adjoin and then pick up pages from
- -- that file but creating thousands of small files is no fun either.
+ directives.register("backend.otfpng.method",initialize)
local files = utilities.files
local openfile = files.open
@@ -735,12 +758,19 @@ local initializepng do
local pdfshapes = { }
local pngfile = "temp-otf-png-shape.png"
local pdffile = "temp-otf-png-shape.pdf"
+ local logfile = "temp-otf-png-shape.log"
+ local texfile = "temp-otf-png-shape.tex"
+ local tucfile = "temp-otf-png-shape.tuc"
local nofdone = 0
local indices = sortedkeys(pngshapes) -- can be sparse
local nofindices = #indices
report_png("processing %i png containers",nofindices)
statistics.starttiming()
local filehandle = openfile(filename)
+ savedata(texfile,texhack) -- not always used but who cares
+ if not runner then
+ initialize()
+ end
for i=1,nofindices do
local index = indices[i]
local entry = pngshapes[index]
@@ -771,6 +801,9 @@ local initializepng do
report_png("processing %i pdf results",nofindices)
remove(pngfile)
remove(pdffile)
+ remove(logfile)
+ remove(texfile)
+ remove(tucfile)
statistics.stoptiming()
if statistics.elapsedseconds then
report_png("png conversion time %s",statistics.elapsedseconds() or "-")
@@ -789,7 +822,7 @@ local initializepng do
end
local pdffile = containers.read(otf.pdfcache,hash)
local pdfshapes = pdffile and pdffile.pdfshapes
- if not pdfshapes or pdffile.timestamp ~= timestamp then
+ if not pdfshapes or pdffile.timestamp ~= timestamp or pdffile.timestamp ~= method then
local pngfile = containers.read(otf.pngcache,hash)
local filename = tfmdata.resources.filename
local pngshapes = pngfile and pngfile.pngshapes
@@ -797,6 +830,7 @@ local initializepng do
containers.write(otf.pdfcache, hash, {
pdfshapes = pdfshapes,
timestamp = timestamp,
+ method = method,
})
end
--
diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua
index 87453d9e2..2d0e685c1 100644
--- a/tex/context/base/mkiv/font-osd.lua
+++ b/tex/context/base/mkiv/font-osd.lua
@@ -118,11 +118,11 @@ local setstate = nuts.setstate
local ischar = nuts.ischar
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+local flushlist = nuts.flushlist
+local flushnode = nuts.flushnode
local copyinjection = nodes.injections.copy -- KE: is this necessary? HH: probably not as positioning comes later and we rawget/set
@@ -826,7 +826,7 @@ local function inject_syntax_error(head,current,char)
else
setchar(current,dotted_circle)
end
- return insert_node_after(head,current,signal)
+ return insertnodeafter(head,current,signal)
end
-- hm, this is applied to one character:
@@ -968,7 +968,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -998,7 +998,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
tempcurrent = processcharacters(tempcurrent,font)
setstate(tempcurrent,unsetvalue)
if getchar(next) == getchar(tempcurrent) then
- flush_list(tempcurrent)
+ flushlist(tempcurrent)
if show_syntax_errors then
head, current = inject_syntax_error(head,current,char)
end
@@ -1006,8 +1006,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setchar(current,getchar(tempcurrent)) -- we assumes that the result of blwf consists of one node
local freenode = getnext(current)
setlink(current,tmp)
- flush_node(freenode)
- flush_list(tempcurrent)
+ flushnode(freenode)
+ flushlist(tempcurrent)
if changestop then
stop = current
end
@@ -1154,7 +1154,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
ch = tpm[1]
setchar(n,ch)
setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
+ head = insertnodeafter(head,current,extra)
tpm = twopart_mark[ch]
end
while c ~= stop and dependent_vowel[ch] do
@@ -1335,7 +1335,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
stop = getprev(stop)
end
head = remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head, stop, nbspaces
@@ -1712,7 +1712,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme
if head == start then
head = stop
end
- flush_list(start)
+ flushlist(start)
return head, stop, true
end
@@ -1876,7 +1876,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -1979,7 +1979,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
char = tpm[1]
setchar(current,char)
setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
+ head = insertnodeafter(head,current,extra)
tpm = twopart_mark[char]
end
--
@@ -2154,7 +2154,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
end
nbspaces = nbspaces - 1
head = remove_node(head, base)
- flush_node(base)
+ flushnode(base)
end
return head, stop, nbspaces
diff --git a/tex/context/base/mkiv/font-ota.lua b/tex/context/base/mkiv/font-ota.lua
index ce1b22b50..a8f9f0047 100644
--- a/tex/context/base/mkiv/font-ota.lua
+++ b/tex/context/base/mkiv/font-ota.lua
@@ -40,7 +40,7 @@ local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local ischar = nuts.ischar
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodecodes = nodes.nodecodes
----- glyph_code = nodecodes.glyph
@@ -173,7 +173,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
elseif id == disc_code then
-- always in the middle .. it doesn't make much sense to assign a property
@@ -189,7 +189,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -435,7 +435,7 @@ function methods.arab(head,font,attr)
first = nil
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -562,7 +562,7 @@ do
wrapup()
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua
index bb02044dc..c21790100 100644
--- a/tex/context/base/mkiv/font-otj.lua
+++ b/tex/context/base/mkiv/font-otj.lua
@@ -98,13 +98,11 @@ local setlink = nuts.setlink
local setwidth = nuts.setwidth
local getwidth = nuts.getwidth
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglue = nuts.traversers.glue
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local properties = nodes.properties.data
@@ -124,7 +122,7 @@ if not fontkern then -- generic
local thekern = nuts.new("kern",0) -- fontkern
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
fontkern = function(k)
local n = copy_node(thekern)
@@ -138,7 +136,7 @@ if not italickern then -- generic
local thekern = nuts.new("kern",3) -- italiccorrection
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
italickern = function(k)
local n = copy_node(thekern)
@@ -667,12 +665,12 @@ local function inject_kerns_only(head,where)
if leftkern and leftkern ~= 0 then
if prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
end
@@ -731,7 +729,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
end
@@ -747,7 +745,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
end
@@ -763,7 +761,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
end
@@ -830,23 +828,23 @@ local function inject_positions_only(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
else
@@ -925,12 +923,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
end
@@ -950,12 +948,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
end
@@ -975,12 +973,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
end
@@ -996,7 +994,7 @@ local function inject_positions_only(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1010,7 +1008,7 @@ local function inject_positions_only(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1144,8 +1142,8 @@ local function inject_everything(head,where)
--
-- todo: head and check for prev / next kern
--
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,fontkern(-wn))
+ insertnodeafter(n,n,fontkern(-wn))
end
end
end
@@ -1295,23 +1293,23 @@ local function inject_everything(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
end
@@ -1406,12 +1404,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1437,12 +1435,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1468,12 +1466,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1495,7 +1493,7 @@ local function inject_everything(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1509,7 +1507,7 @@ local function inject_everything(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1711,8 +1709,8 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar)
end
- head = insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head = insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new = old + (leftkern + rightkern) * factor
if trace_spaces then
@@ -1727,7 +1725,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p]",prevchar,old,new)
end
- insert_node_after(head,n,italickern(new)) -- tricky with traverse but ok
+ insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok
else
local new = old + leftkern * factor
if trace_spaces then
@@ -1746,7 +1744,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new = old + rightkern * factor
if trace_spaces then
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 8159db180..51111fa71 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.113 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.114 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua
index 531f665de..4b154b256 100644
--- a/tex/context/base/mkiv/font-otr.lua
+++ b/tex/context/base/mkiv/font-otr.lua
@@ -1292,8 +1292,8 @@ readers.post = function(f,fontdata,specification)
if length > 0 then
glyphs[mapping].name = readstring(f,length)
else
- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
- break
+ -- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
+ -- break
end
end
end
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 47e2e93d4..30d79c407 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -213,27 +213,29 @@ local getglyphdata = nuts.getglyphdata
-- their positions because some complex ligatures might need that. For the moment we
-- use an x_ prefix because for now generic follows the other approach.
-local copy_no_components = nuts.copy_no_components
-local copy_only_glyphs = nuts.copy_only_glyphs
-local count_components = nuts.count_components
-local set_components = nuts.set_components
-local get_components = nuts.get_components
-local flush_components = nuts.flush_components
+local components = nuts.components
+local copynocomponents = components.copynocomponents
+local copyonlyglyphs = components.copyonlyglyphs
+local countcomponents = components.count
+local setcomponents = components.set
+local getcomponents = components.get
+local flushcomponents = components.flush
---------------------------------------------------------------------------------------
local ischar = nuts.ischar
-local usesfont = nuts.uses_font
+local usesfont = nuts.usesfont
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local copy_node = nuts.copy
-local copy_node_list = nuts.copy_list
+local copy_node_list = nuts.copylist
local remove_node = nuts.remove
local find_node_tail = nuts.tail
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local setmetatable = setmetatable
local setmetatableindex = table.setmetatableindex
@@ -317,13 +319,6 @@ local checkstep = (tracers and tracers.steppers.check) or function()
local registerstep = (tracers and tracers.steppers.register) or function() end
local registermessage = (tracers and tracers.steppers.message) or function() end
--- local function checkdisccontent(d)
--- local pre, post, replace = getdisc(d)
--- if pre then for n in traverse_id(glue_code,pre) do report("pre: %s",nodes.idstostring(pre)) break end end
--- if post then for n in traverse_id(glue_code,post) do report("pos: %s",nodes.idstostring(post)) break end end
--- if replace then for n in traverse_id(glue_code,replace) do report("rep: %s",nodes.idstostring(replace)) break end end
--- end
-
local function logprocess(...)
if trace_steps then
registermessage(...)
@@ -423,12 +418,12 @@ local function flattendisk(head,disc)
local prev, next = getboth(disc)
local ishead = head == disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -480,16 +475,16 @@ local function markstoligature(head,start,stop,char)
local next = getnext(stop)
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if head == start then
head = base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head, base
end
end
@@ -509,7 +504,7 @@ local no_right_ligature_code = 2
local no_left_kern_code = 4
local no_right_kern_code = 8
-local has_glyph_option = node.direct.has_glyph_option or function(n,c)
+local hasglyphoption = function(n,c)
if c == no_left_ligature_code or c == no_right_ligature_code then
return getattr(n,a_noligature) == 1
else
@@ -520,7 +515,7 @@ end
-- in lmtx we need to check the components and can be slightly more clever
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head
- if has_glyph_option(start,no_right_ligature_code) then
+ if hasglyphoption(start,no_right_ligature_code) then
return head, start
end
if start == stop and getchar(start) == char then
@@ -533,14 +528,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp = start
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if start == head then
head = base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks = not skiphash or hasmarks
@@ -554,7 +549,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char = getchar(start)
if not marks[char] then
baseindex = baseindex + componentindex
- componentindex = count_components(start,marks)
+ componentindex = countcomponents(start,marks)
-- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
-- and such:
elseif not deletemarks then
@@ -565,7 +560,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
local n = copy_node(start)
copyinjection(n,start) -- is this ok ? we position later anyway
- head, current = insert_node_after(head,current,n) -- unlikely that mark has components
+ head, current = insertnodeafter(head,current,n) -- unlikely that mark has components
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -590,7 +585,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
local discprev, discnext = getboth(discfound)
@@ -602,8 +597,8 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if not replace then
-- looks like we never come here as it's not okay
local prev = getprev(base)
- -- local comp = get_components(base) -- already set
- local copied = copy_only_glyphs(comp)
+ -- local comp = getcomponents(base) -- already set
+ local copied = copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -620,7 +615,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
setlink(prev,discfound,next)
setboth(base)
-- here components have a pointer so we can't free it!
- set_components(base,copied)
+ setcomponents(base,copied)
replace = base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -650,7 +645,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t
local n = copy_node(start) -- ignore components
resetinjection(n)
setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start = n
end
if what == true then
@@ -661,7 +656,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t
local n = copy_node(start) -- ignore components
resetinjection(n)
setchar(n,m)
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start = n
end
end
@@ -924,7 +919,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local startchar = getchar(start)
@@ -945,7 +940,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local snext = getnext(start)
@@ -1536,7 +1531,7 @@ end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1566,7 +1561,7 @@ end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ?
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1934,13 +1929,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head = kern
current = next
else
local prev, next = getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current = next
end
else
@@ -3795,7 +3790,7 @@ do
local initialrl = 0
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
initialrl = pardirstate(head)
elseif direction == righttoleft_code then
initialrl = -1
@@ -3945,11 +3940,11 @@ do
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4029,11 +4024,11 @@ do
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4140,11 +4135,11 @@ do
-- a different font|state or glue (happens often)
start = getnext(start)
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
diff --git a/tex/context/base/mkiv/font-phb.lua b/tex/context/base/mkiv/font-phb.lua
index 42ebfcbc6..ce42e5a59 100644
--- a/tex/context/base/mkiv/font-phb.lua
+++ b/tex/context/base/mkiv/font-phb.lua
@@ -513,7 +513,7 @@ local function harfbuzz(head,font,attr,rlmode,start,stop,text,leading,trailing)
if trace_colors then
resetcolor(g)
end
- setlink(current,g,getnext(current)) -- insert_before
+ setlink(current,g,getnext(current))
current = g
copied = true
else
diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua
index c61873995..b3b514a16 100644
--- a/tex/context/base/mkiv/font-sol.lua
+++ b/tex/context/base/mkiv/font-sol.lua
@@ -75,14 +75,14 @@ local setnext = nuts.setnext
local setlist = nuts.setlist
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local flush_node_list = nuts.flush_list
-local copy_node_list = nuts.copy_list
+local flushnode = nuts.flushnode
+local flushnodelist = nuts.flushlist
+local copy_node_list = nuts.copylist
local hpack_nodes = nuts.hpack
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local protect_glyphs = nuts.protect_glyphs
-local start_of_par = nuts.start_of_par
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local protectglyphs = nuts.protectglyphs
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.next
local nexthlist = nuts.traversers.hlist
@@ -92,7 +92,7 @@ local repack_hlist = nuts.repackhlist
local nodes_to_utf = nodes.listtoutf
------ protect_glyphs = nodes.handlers.protectglyphs
+----- protectglyphs = nodes.handlers.protectglyphs
local setnodecolor = nodes.tracers.colors.set
@@ -367,8 +367,8 @@ function splitters.split(head) -- best also pass the direction
if encapsulate then
local user_one = new_usernode(splitter_one,n)
local user_two = new_usernode(splitter_two,n)
- head, start = insert_node_before(head,start,user_one)
- insert_node_after(head,stop,user_two)
+ head, start = insertnodebefore(head,start,user_one)
+ insertnodeafter(head,stop,user_two)
else
local current = start
while true do
@@ -437,7 +437,7 @@ function splitters.split(head) -- best also pass the direction
end
local direction, pop = getdirection(current)
r2l = not pop and direction == righttoleft_code
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
if start then
flush() -- very unlikely as this starts a paragraph
end
@@ -636,7 +636,7 @@ local function doit(word,list,best,width,badness,line,set,listdir)
if getid(first) == whatsit_code then
local temp = first
first = getnext(first)
- flush_node(temp)
+ flushnode(temp)
end
local last = find_node_tail(first)
-- replace [u]h->t by [u]first->last
@@ -660,14 +660,14 @@ local function doit(word,list,best,width,badness,line,set,listdir)
setnext(t)
end
setnext(last)
- flush_node_list(first)
+ flushnodelist(first)
else
if trace_optimize then
report_optimizers("line %a, set %a, badness before: %a, after %a, criterium %a, verdict %a",line,set or "?",badness,b,criterium,"continue")
end
-- free old h->t
setnext(t)
- flush_node_list(h) -- somehow fails
+ flushnodelist(h) -- somehow fails
if not encapsulate then
word[2] = first
word[3] = last
@@ -784,7 +784,7 @@ function splitters.optimize(head)
if not encapsulate and getid(list) == glyph_code then
-- nasty .. we always assume a prev being there .. future luatex will always have a leftskip set
-- is this assignment ok ? .. needs checking
- list = insert_node_before(list,list,new_leftskip(0)) -- new_glue(0)
+ list = insertnodebefore(list,list,new_leftskip(0)) -- new_glue(0)
setlist(current,list)
end
local temp, badness = repack_hlist(list,width,"exactly",direction) -- it would be nice if the badness was stored in the node
@@ -813,7 +813,7 @@ function splitters.optimize(head)
local bb, base
for i=1,max do
if base then
- flush_node_list(base)
+ flushnodelist(base)
end
base = copy_node_list(list)
local words = collect_words(base) -- beware: words is adapted
@@ -841,7 +841,7 @@ function splitters.optimize(head)
break
end
end
- flush_node_list(base)
+ flushnodelist(base)
end
local words = collect_words(list)
for best=lastbest or 1,max do
@@ -852,7 +852,7 @@ function splitters.optimize(head)
end
if done then
if b <= criterium then -- was == 0
- protect_glyphs(list)
+ protectglyphs(list)
break
end
end
@@ -869,7 +869,7 @@ function splitters.optimize(head)
end
for i=1,nc do
local ci = cache[i]
- flush_node_list(ci.original)
+ flushnodelist(ci.original)
end
cache = { }
tex.hbadness = tex_hbadness
diff --git a/tex/context/base/mkiv/font-txt.lua b/tex/context/base/mkiv/font-txt.lua
index c52878ca7..b8614c8f5 100644
--- a/tex/context/base/mkiv/font-txt.lua
+++ b/tex/context/base/mkiv/font-txt.lua
@@ -101,15 +101,15 @@ local getwidth = nuts.getwidth
local ischar = nuts.ischar
local isglyph = nuts.isglyph
-local traverse_id = nuts.traverse_id
-local usesfont = nuts.uses_font
+local usesfont = nuts.usesfont
-local copy_node_list = nuts.copy_list
+local copy_node_list = nuts.copylist
local find_node_tail = nuts.tail
-local flush_list = nuts.flush_list
-local free_node = nuts.free
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local flushlist = nuts.flushlist
+local freenode = nuts.free
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local nodecodes = nodes.nodecodes
@@ -138,10 +138,10 @@ local function deletedisc(head)
local pre, post, replace, pre_tail, post_tail, replace_tail = getdisc(current,true)
setdisc(current)
if pre then
- flush_list(pre)
+ flushlist(pre)
end
if post then
- flush_list(post)
+ flushlist(post)
end
local p, n = getboth(current)
if replace then
@@ -158,7 +158,7 @@ local function deletedisc(head)
else
setlink(p,n)
end
- free_node(current)
+ freenode(current)
end
current = next
end
@@ -260,7 +260,7 @@ do
stopspacing = false
end
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
rlmode = pardirstate(head)
elseif rlmode == righttoleft_code then
rlmode = -1
@@ -433,7 +433,7 @@ do
else
setnext(getprev(cpostnew))
end
- flush_list(cpostnew)
+ flushlist(cpostnew)
if creplacenew == current_replace then
current_replace = nil
else
@@ -466,7 +466,7 @@ do
setprev(current_pre)
end
setnext(cprenew)
- flush_list(cpre)
+ flushlist(cpre)
creplace = current_replace
current_replace = getnext(creplacenew)
if current_replace then
@@ -487,12 +487,12 @@ do
startspacing = false
stopspacing = false
if id == math_code then
- current = getnext(end_of_math(current))
+ current = getnext(endofmath(current))
elseif id == dir_code then
startspacing = false
topstack, rlmode = txtdirstate(current,dirstack,topstack,rlparmode)
current = getnext(current)
- -- elseif id == par_code and start_of_par(current) then
+ -- elseif id == par_code and startofpar(current) then
-- startspacing = false
-- rlparmode, rlmode = pardirstate(current)
-- current = getnext(current)
diff --git a/tex/context/base/mkiv/good-mth.lua b/tex/context/base/mkiv/good-mth.lua
index 3473cc205..efc7cb22a 100644
--- a/tex/context/base/mkiv/good-mth.lua
+++ b/tex/context/base/mkiv/good-mth.lua
@@ -36,7 +36,7 @@ local new_glyph = nodepool.glyph
local new_hlist = nodepool.hlist
local new_vlist = nodepool.vlist
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local helpers = fonts.helpers
local upcommand = helpers.commands.up
@@ -361,7 +361,7 @@ local function mathradicalaction(n,h,v,font,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
@@ -397,7 +397,7 @@ local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function initialize(tfmdata)
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index d4e382a21..c27dade9d 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -78,9 +78,10 @@ local resolveprefix = resolvers.resolve
local texgetbox = tex.getbox
local texsetbox = tex.setbox
-local hpack = node.hpack
+local hpack = nodes.hpack
local new_latelua = nodes.pool.latelua
+local new_hlist = nodes.pool.hlist
local context = context
@@ -1392,7 +1393,7 @@ end
function figures.dummy(data)
data = data or callstack[#callstack] or lastfiguredata
local dr, du, nr = data.request, data.used, figures.boxnumber
- local box = hpack(node.new("hlist")) -- we need to set the dir (luatex 0.60 buglet)
+ local box = hpack(new_hlist()) -- we need to set the dir (luatex 0.60 buglet)
du.width = du.width or figures.defaultwidth
du.height = du.height or figures.defaultheight
du.depth = du.depth or figures.defaultdepth
diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua
index 3e4678801..f6b27175c 100644
--- a/tex/context/base/mkiv/lang-dis.lua
+++ b/tex/context/base/mkiv/lang-dis.lua
@@ -36,8 +36,7 @@ local isglyph = nuts.isglyph
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+----- flushnode = nuts.flushnode
local nextdisc = nuts.traversers.disc
@@ -124,12 +123,12 @@ end
local wiped = 0
-local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
+local flattendiscretionaries = nuts.flattendiscretionaries -- todo in nodes
--- if flatten_discretionaries then
+-- if flattendiscretionaries then
function languages.flatten(head)
- local h, n = flatten_discretionaries(head)
+ local h, n = flattendiscretionaries(head)
wiped = wiped + n
return h, n > 0
end
@@ -152,7 +151,7 @@ local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
-- head = h
-- end
-- wiped = wiped + 1
--- flush_node(delayed)
+-- flushnode(delayed)
-- return head
-- end
--
@@ -202,7 +201,7 @@ function languages.explicithyphen(template)
local pre, post
local disc = new_disc()
if template then
- local langdata = getlanguagedata(getlang(template))
+ local langdata = getlanguagedata(getlanguage(template))
local instance = langdata and langdata.instance
if instance then
local prechr = prehyphenchar(instance)
diff --git a/tex/context/base/mkiv/lang-exp.lua b/tex/context/base/mkiv/lang-exp.lua
index c2eb46990..758ab0f77 100644
--- a/tex/context/base/mkiv/lang-exp.lua
+++ b/tex/context/base/mkiv/lang-exp.lua
@@ -46,7 +46,7 @@ if LUATEXVERSION < 1.005 then -- not loaded any more
local char = isglyph(pre)
if char and char <= 0 then
done = true
- flush_list(pre)
+ flushlist(pre)
pre = nil
end
end
@@ -54,7 +54,7 @@ if LUATEXVERSION < 1.005 then -- not loaded any more
local char = isglyph(post)
if char and char <= 0 then
done = true
- flush_list(post)
+ flushlist(post)
post = nil
end
end
@@ -179,7 +179,7 @@ languages.expanders = expanders
-- expanded = function(head)
-- local done = hyphenate(head)
-- if done then
--- for d in traverse_id(disc_code,head) do
+-- for d in traverseid(disc_code,head) do
-- local s = getsubtype(d)
-- if s ~= discretionary_code then
-- expanders[s](d,template)
diff --git a/tex/context/base/mkiv/lang-hyp.lua b/tex/context/base/mkiv/lang-hyp.lua
index 01ffe2335..e098e93af 100644
--- a/tex/context/base/mkiv/lang-hyp.lua
+++ b/tex/context/base/mkiv/lang-hyp.lua
@@ -656,12 +656,12 @@ if context then
local setprev = nuts.setprev
local setnext = nuts.setnext
- local insert_before = nuts.insert_before
- local insert_after = nuts.insert_after
+ local insertbefore = nuts.insertbefore
+ local insertafter = nuts.insertafter
local copy_node = nuts.copy
- local copy_list = nuts.copy_list
+ local copylist = nuts.copylist
local remove_node = nuts.remove
- local end_of_math = nuts.end_of_math
+ local endofmath = nuts.endofmath
local node_tail = nuts.tail
local nexthlist = nuts.traversers.hlist
@@ -1087,7 +1087,7 @@ featureset.hyphenonly = hyphenonly == v_yes
nuts.setvisual(p,"penalty")
end
last = getprev(last)
- first, last = insert_after(first,last,p)
+ first, last = insertafter(first,last,p)
end
local function synchronizefeatureset(a)
@@ -1245,7 +1245,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[replacement])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1256,7 +1256,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[list[i]])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1265,7 +1265,7 @@ featureset.hyphenonly = hyphenonly == v_yes
end
if rightchar then
local glyph = copy_node(stop)
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
setchar(glyph,rightchar)
end
return head
@@ -1291,7 +1291,7 @@ featureset.hyphenonly = hyphenonly == v_yes
setattrlist(disc,attrnode)
end
-- could be a replace as well
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
elseif type(r) == "table" then
local disc = new_disc()
local pre = r[1]
@@ -1325,7 +1325,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if attrnode then
setattrlist(disc,attrnode)
end
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
else
setchar(current,characters[r])
if i < rsize then
@@ -1347,7 +1347,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if first ~= current then
local disc = new_disc()
first, current, glyph = remove_node(first,current)
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
if trace_visualize then
setcolor(glyph,"darkred") -- these get checked
setcolor(disc,"darkgreen") -- in the colorizer
@@ -1372,7 +1372,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local function injectseries(current,last,next,attrnode)
local disc = new_disc()
local start = current
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
setprev(start)
setnext(last)
if next then
@@ -1380,7 +1380,7 @@ featureset.hyphenonly = hyphenonly == v_yes
else
setnext(current)
end
- local pre = copy_list(start)
+ local pre = copylist(start)
local post = nil
local replace = start
setdisc(disc,pre,post,replace,automaticdisc_code,hyphenpenalty) -- ex ?
@@ -1547,10 +1547,10 @@ featureset.hyphenonly = hyphenonly == v_yes
skipping = true
end
-- elseif strict and strict[id] then
- -- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ -- current = id == math_code and getnext(endofmath(current)) or getnext(current)
-- size = 0
else
- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ current = id == math_code and getnext(endofmath(current)) or getnext(current)
end
if size > 0 then
if dictionary and size > charmin and leftmin + rightmin <= size then
diff --git a/tex/context/base/mkiv/lang-ini.lua b/tex/context/base/mkiv/lang-ini.lua
index 7a8aab818..c8b5ee158 100644
--- a/tex/context/base/mkiv/lang-ini.lua
+++ b/tex/context/base/mkiv/lang-ini.lua
@@ -36,19 +36,20 @@ local trace_patterns = false trackers.register("languages.patterns", function(v
local report_initialization = logs.reporter("languages","initialization")
local lang = lang
+language = lang -- we use that in lmtx
-local prehyphenchar = lang.prehyphenchar -- global per language
-local posthyphenchar = lang.posthyphenchar -- global per language
-local preexhyphenchar = lang.preexhyphenchar -- global per language
-local postexhyphenchar = lang.postexhyphenchar -- global per language
------ lefthyphenmin = lang.lefthyphenmin
------ righthyphenmin = lang.righthyphenmin
-local sethjcode = lang.sethjcode
+local prehyphenchar = language.prehyphenchar -- global per language
+local posthyphenchar = language.posthyphenchar -- global per language
+local preexhyphenchar = language.preexhyphenchar -- global per language
+local postexhyphenchar = language.postexhyphenchar -- global per language
+----- lefthyphenmin = language.lefthyphenmin
+----- righthyphenmin = language.righthyphenmin
+local sethjcode = language.sethjcode
local uccodes = characters.uccodes
local lccodes = characters.lccodes
-local new_language = lang.new
+local new_language = language.new
languages = languages or {}
local languages = languages
diff --git a/tex/context/base/mkiv/lang-rep.lua b/tex/context/base/mkiv/lang-rep.lua
index 9f89fa248..d2c47f5ba 100644
--- a/tex/context/base/mkiv/lang-rep.lua
+++ b/tex/context/base/mkiv/lang-rep.lua
@@ -62,11 +62,11 @@ local setprev = nuts.setprev
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
-local insert_node_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local remove_node = nuts.remove
local copy_node = nuts.copy
-local flush_list = nuts.flush_list
-local insert_after = nuts.insert_after
+local flushlist = nuts.flushlist
local nodepool = nuts.pool
local new_disc = nodepool.disc
@@ -170,7 +170,7 @@ local function tonodes(list,template)
local new = copy_node(template)
setchar(new,list[i])
if head then
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
else
head, current = new, new
end
@@ -230,7 +230,7 @@ local function replace(head,first,last,final,hasspace,overload)
-- todo: also set attr
local new = new_disc(pre,post,replace)
setattrlist(new,first)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
elseif method == "noligature" then
-- not that efficient to copy but ok for testing
local list = codes[2]
@@ -239,12 +239,12 @@ local function replace(head,first,last,final,hasspace,overload)
local new = copy_node(first)
setchar(new,list[i])
setattr(new,a_noligature,1)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
else
local new = copy_node(first)
setchar(new,zwnj)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
else
report_replacement("unknown method %a",method or "?")
@@ -252,11 +252,11 @@ local function replace(head,first,last,final,hasspace,overload)
else
local new = copy_node(first)
setchar(new,codes)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
i = i + 1
end
- flush_list(list)
+ flushlist(list)
elseif newlength == 0 then
-- we overload
elseif oldlength == newlength then
@@ -271,7 +271,7 @@ local function replace(head,first,last,final,hasspace,overload)
for i=1,newlength-oldlength do
local n = copy_node(current)
setchar(n,newcodes[i])
- head, current = insert_node_before(head,current,n)
+ head, current = insertbefore(head,current,n)
current = getnext(current)
end
for i=newlength-oldlength+1,newlength do
diff --git a/tex/context/base/mkiv/lang-tra.lua b/tex/context/base/mkiv/lang-tra.lua
index 5fd123349..35e9344aa 100644
--- a/tex/context/base/mkiv/lang-tra.lua
+++ b/tex/context/base/mkiv/lang-tra.lua
@@ -15,7 +15,7 @@ local nextchar = nuts.traversers.char
local getattr = nuts.getattr
local setchar = nuts.setchar
-local insert_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
local copy_node = nuts.copy
local texsetattribute = tex.setattribute
@@ -97,7 +97,7 @@ function transliteration.handler(head)
for i = n-1,1,-1 do
local g = copy_node(current)
setchar(g,t[i])
- head, p = insert_before(head, p, g)
+ head, p = insertbefore(head, p, g)
end
end
end
diff --git a/tex/context/base/mkiv/lpdf-fld.lua b/tex/context/base/mkiv/lpdf-fld.lua
index e14968eb8..50720c84a 100644
--- a/tex/context/base/mkiv/lpdf-fld.lua
+++ b/tex/context/base/mkiv/lpdf-fld.lua
@@ -97,7 +97,7 @@ local pdfcolor = lpdf.color
local pdfcolorvalues = lpdf.colorvalues
local pdflayerreference = lpdf.layerreference
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local submitoutputformat = 0 -- 0=unknown 1=HTML 2=FDF 3=XML => not yet used, needs to be checked
diff --git a/tex/context/base/mkiv/lpdf-mov.lua b/tex/context/base/mkiv/lpdf-mov.lua
index 42ba6fb00..a0f82b25b 100644
--- a/tex/context/base/mkiv/lpdf-mov.lua
+++ b/tex/context/base/mkiv/lpdf-mov.lua
@@ -16,7 +16,6 @@ local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfborder = lpdf.border
-local write_node = node.write
function nodeinjections.insertmovie(specification)
-- managed in figure inclusion: width, height, factor, repeat, controls, preview, label, foundname
@@ -41,7 +40,7 @@ function nodeinjections.insertmovie(specification)
Movie = moviedict,
A = controldict,
}
- write_node(nodeinjections.annotation(width,height,0,action())) -- test: context(...)
+ context(nodeinjections.annotation(width,height,0,action())) -- test: context(...)
end
function nodeinjections.insertsound(specification)
@@ -63,6 +62,6 @@ function nodeinjections.insertsound(specification)
Movie = sounddict,
A = controldict,
}
- write_node(nodeinjections.annotation(0,0,0,action())) -- test: context(...)
+ context(nodeinjections.annotation(0,0,0,action())) -- test: context(...)
end
end
diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua
index 106eb98cc..a0e41e4d0 100644
--- a/tex/context/base/mkiv/lpdf-wid.lua
+++ b/tex/context/base/mkiv/lpdf-wid.lua
@@ -43,6 +43,8 @@ local context = context
local texgetcount = tex.getcount
+local hpacknode = nodes.hpack
+
local nodeinjections = backends.pdf.nodeinjections
local codeinjections = backends.pdf.codeinjections
local registrations = backends.pdf.registrations
@@ -76,9 +78,6 @@ local pdfborder = lpdf.border
local pdftransparencyvalue = lpdf.transparencyvalue
local pdfcolorvalues = lpdf.colorvalues
-local hpack_node = node.hpack
-local write_node = node.write -- test context(...) instead
-
-- symbols
local presets = { } -- xforms
@@ -453,7 +452,7 @@ function nodeinjections.attachfile(specification)
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- local box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ local box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
box.width = width
box.height = height
box.depth = depth
@@ -554,12 +553,12 @@ function nodeinjections.comment(specification) -- brrr: seems to be done twice
Parent = pdfreference(nd),
}
d.Popup = pdfreference(nc)
- box = hpack_node(
+ box = hpacknode(
nodeinjections.annotation(0,0,0,d(),nd),
nodeinjections.annotation(width,height,depth,c(),nc)
)
else
- box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
end
box.width = width -- redundant
box.height = height -- redundant
@@ -652,7 +651,7 @@ local function insertrenderingwindow(specification)
if height == 0 or width == 0 then
-- todo: sound needs no window
end
- write_node(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
+ context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
return pdfreference(r)
end
diff --git a/tex/context/base/mkiv/math-dir.lua b/tex/context/base/mkiv/math-dir.lua
index 38aa44358..f26324ed9 100644
--- a/tex/context/base/mkiv/math-dir.lua
+++ b/tex/context/base/mkiv/math-dir.lua
@@ -36,8 +36,8 @@ local getattr = nuts.getattr
local setchar = nuts.setchar
local setlist = nuts.setlist
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local nodecodes = nodes.nodecodes
local enableaction = nodes.tasks.enableaction
@@ -65,8 +65,8 @@ local function processmath(head)
local start = nil
local stop = nil
local function capsulate()
- head = insert_node_before(head,start,new_direction(lefttoright_code))
- insert_node_after(head,stop,new_direction(lefttoright_code,true))
+ head = insertnodebefore(head,start,new_direction(lefttoright_code))
+ insertnodeafter(head,stop,new_direction(lefttoright_code,true))
if trace_directions then
report_directions("reversed: %s",nodes.listtoutf(start,false,false,stop))
end
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 1fb763a3b..fdc2d0177 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -134,12 +134,12 @@ local setsup = nuts.setsup
local setsubpre = nuts.setsubpre
local setsuppre = nuts.setsuppre
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local copy_node = nuts.copy
local slide_nodes = nuts.slide
local set_visual = nuts.setvisual
-local mlist_to_hlist = nuts.mlist_to_hlist
+local mlisttohlist = nuts.mlisttohlist
local new_kern = nodepool.kern
local new_submlist = nodepool.submlist
@@ -884,7 +884,7 @@ do
end
setchar(d,chr)
setfam(d,fam)
- flush_node(sym)
+ flushnode(sym)
end
setattrlist(d,char)
setattrlist(f,char)
@@ -930,7 +930,7 @@ do
if midl then
local fence = makefence(middlefence_code,current)
setnucleus(current)
- flush_node(current)
+ flushnode(current)
middle[current] = nil
-- replace_node
setlink(prev,fence,next)
@@ -956,7 +956,7 @@ do
local f_c = makefence(rightfence_code,close)
makelist(middle,open,f_o,o_next,c_prev,f_c)
setnucleus(close)
- flush_node(close)
+ flushnode(close)
-- open is now a list
setlink(open,c_next)
return open
@@ -1883,7 +1883,7 @@ do
end
while c ~= l do
local n = getnext(c)
- flush_node(c)
+ flushnode(c)
c = n
end
setlink(parent,l)
@@ -2097,7 +2097,7 @@ do
end
setprev(next,pointer)
setnext(parent,getnext(next))
- flush_node(next)
+ flushnode(next)
end
end
end
@@ -2350,16 +2350,10 @@ do
-- force_penalties = v
-- end)
- function builders.kernel.mlist_to_hlist(head,style,penalties)
- return mlist_to_hlist(head,style,force_penalties or penalties)
+ function builders.kernel.mlisttohlist(head,style,penalties)
+ return mlisttohlist(head,style,force_penalties or penalties)
end
- -- function builders.kernel.mlist_to_hlist(head,style,penalties)
- -- local h = mlist_to_hlist(head,style,force_penalties or penalties)
- -- inspect(nodes.totree(h,true,true,true))
- -- return h
- -- end
-
implement {
name = "setmathpenalties",
arguments = "integer",
@@ -2374,14 +2368,14 @@ local actions = tasks.actions("math") -- head, style, penalties
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-function processors.mlist_to_hlist(head,style,penalties)
+function processors.mlisttohlist(head,style,penalties)
starttiming(noads)
head = actions(head,style,penalties)
stoptiming(noads)
return head
end
-callbacks.register('mlist_to_hlist',processors.mlist_to_hlist,"preprocessing math list")
+callbacks.register('mlisttohlist',processors.mlisttohlist,"preprocessing math list")
-- tracing
diff --git a/tex/context/base/mkiv/math-tag.lua b/tex/context/base/mkiv/math-tag.lua
index 41373fcb5..3c53c2cc8 100644
--- a/tex/context/base/mkiv/math-tag.lua
+++ b/tex/context/base/mkiv/math-tag.lua
@@ -38,7 +38,7 @@ local getnucleus = nuts.getnucleus
local getsub = nuts.getsub
local getsup = nuts.getsup
-local set_attributes = nuts.setattributes
+local setattributes = nuts.setattributes
local nextnode = nuts.traversers.node
@@ -297,7 +297,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
-- empty list
elseif not attr then
-- box comes from strange place
- set_attributes(list,a_tagged,text) -- only the first node ?
+ setattributes(list,a_tagged,text) -- only the first node ?
else
-- Beware, the first node in list is the actual list so we definitely
-- need to nest. This approach is a hack, maybe I'll make a proper
diff --git a/tex/context/base/mkiv/meta-blb.lua b/tex/context/base/mkiv/meta-blb.lua
index c690f3902..e57bc3c23 100644
--- a/tex/context/base/mkiv/meta-blb.lua
+++ b/tex/context/base/mkiv/meta-blb.lua
@@ -221,9 +221,9 @@ local getsubtype = nuts.getsubtype
local setlink = nuts.setlink
local setlist = nuts.setlist
local getnext = nuts.getnext
-local flatten_list = nuts.flatten_discretionaries
+local flatten_list = nuts.flattendiscretionaries
local remove_node = nuts.remove
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local addblob = mp.mf_blob_add
local newblob = mp.mf_blob_new
@@ -276,7 +276,7 @@ local function initialize(category,box)
end
setlist(wrap,head)
end
- flush_node(wrap)
+ flushnode(wrap)
end
end
diff --git a/tex/context/base/mkiv/meta-imp-txt.mkiv b/tex/context/base/mkiv/meta-imp-txt.mkiv
index 2c28acf72..8e7af88b7 100644
--- a/tex/context/base/mkiv/meta-imp-txt.mkiv
+++ b/tex/context/base/mkiv/meta-imp-txt.mkiv
@@ -243,7 +243,7 @@
if head then
n = { }
s = 0
- head = node.flatten_discretionaries(head)
+ head = nodes.flattendiscretionaries(head)
local current = head
while current do
local id = current.id
diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua
index e737b5d86..7566d9310 100644
--- a/tex/context/base/mkiv/mlib-pdf.lua
+++ b/tex/context/base/mkiv/mlib-pdf.lua
@@ -23,9 +23,6 @@ local context = context
local allocate = utilities.storage.allocate
-local copy_node = node.copy
-local write_node = node.write
-
local pen_info = mplib.pen_info
local getfields = mplib.getfields or mplib.fields -- todo: in lmtx get them once and then use gettype
@@ -91,7 +88,7 @@ end
function metapost.flushliteral(d)
if savedliterals then
- write_node(mpsliteral(savedliterals[d]))
+ context(mpsliteral(savedliterals[d]))
else
report_metapost("problem flushing literal %a",d)
end
diff --git a/tex/context/base/mkiv/mlib-pps.lua b/tex/context/base/mkiv/mlib-pps.lua
index 8a6f4b4f8..122ca6f99 100644
--- a/tex/context/base/mkiv/mlib-pps.lua
+++ b/tex/context/base/mkiv/mlib-pps.lua
@@ -26,8 +26,8 @@ local setmacro = interfaces.setmacro
local texsetbox = tex.setbox
local textakebox = tex.takebox -- or: nodes.takebox
local texrunlocal = tex.runlocal
-local copy_list = node.copy_list
-local flush_list = node.flush_list
+local copylist = nodes.copylist
+local flushlist = nodes.flushlist
local setmetatableindex = table.setmetatableindex
local sortedhash = table.sortedhash
@@ -271,7 +271,7 @@ local function stopjob()
if top then
for slot, content in next, top.textexts do
if content then
- flush_list(content)
+ flushlist(content)
if trace_textexts then
report_textexts("freeing text %s",slot)
end
@@ -1078,7 +1078,7 @@ local tx_reset, tx_process do
end
box = cache[mp_hash]
if box then
- box = copy_list(box)
+ box = copylist(box)
else
texrunlocal("mptexttoks")
box = textakebox("mptextbox")
diff --git a/tex/context/base/mkiv/mult-fmt.lua b/tex/context/base/mkiv/mult-fmt.lua
index 0d11a4253..67133aab2 100644
--- a/tex/context/base/mkiv/mult-fmt.lua
+++ b/tex/context/base/mkiv/mult-fmt.lua
@@ -11,12 +11,12 @@ local concat, sortedhash = table.concat, table.sortedhash
local sub, formatters = string.sub, string.formatters
local utfsplit = utf.split
-local prtcatcodes = catcodes.numbers.prtcatcodes
-local contextsprint = context.sprint
-local implement = interfaces.implement
+local prtcatcodes = catcodes.numbers.prtcatcodes
+local contextsprint = context.sprint
+local implement = interfaces.implement
-local setmacro = token.set_macro
-local definedmacro = token.is_defined
+local setmacro = token.setmacro or token.set_macro
+local definedmacro = token.isdefined or token.is_defined
local report = logs.reporter("interface")
local report_interface = logs.reporter("interface","initialization")
diff --git a/tex/context/base/mkiv/node-acc.lua b/tex/context/base/mkiv/node-acc.lua
index d8f4b25bf..5849c045c 100644
--- a/tex/context/base/mkiv/node-acc.lua
+++ b/tex/context/base/mkiv/node-acc.lua
@@ -32,8 +32,8 @@ local nextglyph = nuts.traversers.glyph
local nextnode = nuts.traversers.node
----- copy_node = nuts.copy
-local insert_after = nuts.insert_after
-local copy_no_components = nuts.copy_no_components
+local insertafter = nuts.insertafter
+local copynocomponents = nuts.components.copynocomponents
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -71,7 +71,7 @@ local function injectspaces(head)
if s == spaceskip_code or s == xspaceskip_code then
-- unless we don't care about the little bit of overhead
-- we can just: local g = copy_node(g)
- local g = copy_no_components(p)
+ local g = copynocomponents(p)
local a = getattr(n,a_characters)
setchar(g,slot)
setlink(p,g,n)
@@ -163,8 +163,8 @@ end)
-- local str = codes[a]
-- local b = pageliteral(format("/Span << /ActualText %s >> BDC", lpdf.tosixteen(str)))
-- local e = pageliteral("EMC")
--- insert_before(head,n,b)
--- insert_after(head,n,e)
+-- insertbefore(head,n,b)
+-- insertafter(head,n,e)
-- done = true
-- end
-- elseif id == hlist_code or id == vlist_code then
diff --git a/tex/context/base/mkiv/node-aux.lua b/tex/context/base/mkiv/node-aux.lua
index d3c537a3b..5a98b2ea3 100644
--- a/tex/context/base/mkiv/node-aux.lua
+++ b/tex/context/base/mkiv/node-aux.lua
@@ -53,11 +53,11 @@ local traversers = nuts.traversers
local nextnode = traversers.node
local nextglyph = traversers.glyph
-local flush_node = nuts.flush
-local flush_list = nuts.flush_list
+local flushnode = nuts.flush
+local flushlist = nuts.flushlist
local hpack_nodes = nuts.hpack
-local unset_attribute = nuts.unset_attribute
-local first_glyph = nuts.first_glyph
+local unsetattribute = nuts.unsetattribute
+local firstglyph = nuts.firstglyph
local copy_node = nuts.copy
local find_tail = nuts.tail
local getbox = nuts.getbox
@@ -85,7 +85,7 @@ local report_error = logs.reporter("node-aux:error")
-- function tex.takebox(id)
-- local box = tex.getbox(id)
-- if box then
--- local copy = node.copy(box)
+-- local copy = nodes.copy(box)
-- local list = box.list
-- copy.list = list
-- box.list = nil
@@ -129,7 +129,7 @@ end
function nuts.takelist(n)
local l = getlist(n)
setlist(n)
- flush_node(n)
+ flushnode(n)
return l
end
@@ -142,7 +142,7 @@ local function repackhlist(list,...)
local temp, b = hpack_nodes(list,...)
list = getlist(temp)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return list, b
end
@@ -153,50 +153,59 @@ function nodes.repackhlist(list,...)
return tonode(list), b
end
-local function set_attributes(head,attr,value)
- for n, id in nextnode, head do
- setattr(n,attr,value)
- if id == hlist_node or id == vlist_node then
- set_attributes(getlist(n),attr,value)
- end
- end
-end
+if not nuts.setattributes then
-local function set_unset_attributes(head,attr,value)
- for n, id in nextnode, head do
- if not getattr(n,attr) then
+ local function setattributes(head,attr,value)
+ for n, id in nextnode, head do
setattr(n,attr,value)
- end
- if id == hlist_code or id == vlist_code then
- set_unset_attributes(getlist(n),attr,value)
+ if id == hlist_node or id == vlist_node then
+ setattributes(getlist(n),attr,value)
+ end
end
end
+
+ nuts .setattributes = setattributes
+ nodes.setattributes = vianuts(setattributes)
+
end
-local function unset_attributes(head,attr)
- for n, id in nextnode, head do
- setattr(n,attr,unsetvalue)
- if id == hlist_code or id == vlist_code then
- unset_attributes(getlist(n),attr)
+if not nuts.setunsetattributes then
+
+ local function setunsetattributes(head,attr,value)
+ for n, id in nextnode, head do
+ if not getattr(n,attr) then
+ setattr(n,attr,value)
+ end
+ if id == hlist_code or id == vlist_code then
+ setunsetattributes(getlist(n),attr,value)
+ end
end
end
+
+ nuts .setunsetattributes = setunsetattributes
+ nodes.setunsetattributes = vianuts(setunsetattributes)
+
end
--- for old times sake
+if not nuts.unsetattributes then
-nuts.setattribute = nuts.setattr nodes.setattribute = nodes.setattr
-nuts.getattribute = nuts.getattr nodes.getattribute = nodes.getattr
-nuts.unsetattribute = nuts.unset_attribute nodes.unsetattribute = nodes.unset_attribute
-nuts.has_attribute = nuts.has_attribute nodes.has_attribute = nodes.has_attribute
-nuts.firstglyph = nuts.first_glyph nodes.firstglyph = nodes.first_glyph
+ local function unsetattributes(head,attr)
+ for n, id in nextnode, head do
+ setattr(n,attr,unsetvalue)
+ if id == hlist_code or id == vlist_code then
+ unsetattributes(getlist(n),attr)
+ end
+ end
+ end
+
+ nuts .unsetattributes = unsetattributes
+ nodes.unsetattributes = vianuts(unsetattributes)
-nuts.setattributes = set_attributes nodes.setattributes = vianuts(set_attributes)
-nuts.setunsetattributes = set_unset_attributes nodes.setunsetattributes = vianuts(set_unset_attributes)
-nuts.unsetattributes = unset_attributes nodes.unsetattributes = vianuts(unset_attributes)
+end
function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255
if untagged then
- return first_glyph(n)
+ return firstglyph(n)
else
for g in nextglyph ,n do
return g
@@ -370,7 +379,7 @@ local function rehpack(n,width)
local set, order, sign = getboxglue(temp)
setboxglue(n,set,order,sign)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return n
end
@@ -406,7 +415,7 @@ do
local getsubtype = nodes.getsubtype
- function nodes.start_of_par(n)
+ function nodes.startofpar(n)
local s = getsubtype(n)
return s == hmodepar_code or s == vmodepar_code
end
@@ -423,8 +432,6 @@ if not nuts.getnormalizedline then
local getlist = nuts.getlist
local getwidth = nuts.getwidth
- local direct = node.direct
-
local nodecodes = nodes.nodecodes
local skipcodes = nodes.skipcodes
@@ -438,7 +445,7 @@ if not nuts.getnormalizedline then
local indentskip_code = skipcodes.indentskip
local parfillskip_code = skipcodes.parfillskip
- local find_node = direct.find_node or function(h,t,s)
+ nuts.findnode = node.direct.find_node or function(h,t,s)
if h then
if s then
for node, subtype in traversers[t] do
@@ -454,7 +461,6 @@ if not nuts.getnormalizedline then
end
end
- nuts.find_node = find_node
function nuts.getnormalizedline(h)
if getid(h) == hlist_code and getsubtype(h) == line_code then
diff --git a/tex/context/base/mkiv/node-bck.lua b/tex/context/base/mkiv/node-bck.lua
index ec84a3db5..d81d2a27b 100644
--- a/tex/context/base/mkiv/node-bck.lua
+++ b/tex/context/base/mkiv/node-bck.lua
@@ -52,7 +52,7 @@ local nextnode = nuts.traversers.node
local nexthlist = nuts.traversers.hlist
local nextlist = nuts.traversers.list
-local flush_node_list = nuts.flush_list
+local flushnodelist = nuts.flushlist
local new_rule = nodepool.rule
local new_kern = nodepool.kern
@@ -160,7 +160,7 @@ local function add_alignbackgrounds(head,list)
local template = getprop(head,"alignmentchecked")
if template then
list = colored_b(head,list,template[1],hlist_code,template[2])
- flush_node_list(template)
+ flushnodelist(template)
templates[currentrow] = false
return list
end
diff --git a/tex/context/base/mkiv/node-bwc.lua b/tex/context/base/mkiv/node-bwc.lua
new file mode 100644
index 000000000..e287de68e
--- /dev/null
+++ b/tex/context/base/mkiv/node-bwc.lua
@@ -0,0 +1,92 @@
+if not modules then modules = { } end modules ['node-bwc'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is a backward compatibility list.
+
+local nodes = nodes
+local nuts = nodes.nuts
+
+nuts .check_discretionaries = nuts .checkdiscretionaries
+nuts .copy_list = nuts .copylist
+nuts .copy_node = nuts .copynode
+nuts .copy_only = nuts .copyonly
+nuts .current_attr = nuts .currentattributes
+nuts .effective_glue = nuts .effectiveglue
+nuts .end_of_math = nuts .endofmath
+nuts .find_attribute = nuts .findattribute
+nuts .first_glyph = nuts .firstglyph
+nuts .flatten_discretionaries = nuts .flattendiscretionaries
+nuts .flush_list = nuts .flushlist
+nuts .flush_node = nuts .flushnode
+nuts .get_attribute = nuts .getattribute
+nuts .get_synctex_fields = nuts .getsynctexfields
+nuts .has_attribute = nuts .hasattribute
+nuts .has_dimensions = nuts .hasdimensions
+nuts .has_field = nuts .hasfield
+nuts .has_glyph = nuts .hasglyph
+nuts .insert_after = nuts .insertafter
+nuts .insert_before = nuts .insertbefore
+nuts .is_direct = nuts .isdirect
+nuts .is_node = nuts .isnode
+nuts .is_nut = nuts .isnut
+nuts .is_zero_glue = nuts .iszeroglue
+nuts .mlist_to_hlist = nuts .mlisttohlist
+nuts .protect_glyph = nuts .protectglyph
+nuts .protect_glyphs = nuts .protectglyphs
+-----.protrusion_skippable = nuts .protrusionskippable
+nuts .set_attribute = nuts .setattribute
+-----.set_synctex_fields = nuts .setsynctexfields
+nuts .start_of_par = nuts .startofpar
+nuts .traverse_id = nuts .traverseid
+nuts .traverse_char = nuts .traversechar
+nuts .traverse_glyph = nuts .traverseglyph
+nuts .traverse_id = nuts .traverseid
+nuts .traverse_list = nuts .traverselist
+nuts .unprotect_glyph = nuts .unprotectglyph
+nuts .unprotect_glyphs = nuts .unprotectglyphs
+nuts .unset_attribute = nuts .unsetattribute
+nuts .uses_font = nuts .usesfont
+nuts .getattr = nuts .getattribute
+nuts .getattrs = nuts .getattributes
+nuts .getattrlist = nuts .getattributelist
+
+-----.check_discretionaries = nodes.checkdiscretionaries
+nodes.copy_list = nodes.copylist
+nodes.copy_node = nodes.copynode
+nodes.current_attributes = nodes.currentattributes
+nodes.effective_glue = nodes.effectiveglue
+nodes.end_of_math = nodes.endofmath
+nodes.find_attribute = nodes.findattribute
+nodes.first_glyph = nodes.firstglyph
+-----.flatten_discretionaries = nodes.flattendiscretionaries
+nodes.flush_list = nodes.flushlist
+nodes.flush_node = nodes.flushnode
+nodes.has_attribute = nodes.hasattribute
+nodes.has_field = nodes.hasfield
+nodes.has_glyph = nodes.hasglyph
+nodes.insert_after = nodes.insertafter
+nodes.insert_before = nodes.insertbefore
+nodes.is_node = nodes.isnode
+nodes.is_direct = nodes.isdirect
+nodes.is_nut = nodes.isnut
+nodes.is_zero_glue = nodes.iszeroglue
+nodes.last_node = nodes.lastnode
+nodes.mlist_to_hlist = nodes.mlisttohlist
+nodes.protect_glyph = nodes.protectglyph
+nodes.protect_glyphs = nodes.protectglyphs
+nodes.protrusion_skippable = nodes.protrusionskippable
+nodes.set_attribute = nodes.setattribute
+nodes.traverse_id = nodes.traverseid
+nodes.traverse_char = nodes.traversechar
+nodes.traverse_glyph = nodes.traverseglyph
+nodes.traverse_id = nodes.traverseid
+nodes.traverse_list = nodes.traverselist
+nodes.unprotect_glyph = nodes.unprotectglyph
+nodes.unprotect_glyphs = nodes.unprotectglyphs
+nodes.unset_attribute = nodes.unsetattribute
+nodes.uses_font = nodes.usesfont
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua
index 373cce3ce..42c24378f 100644
--- a/tex/context/base/mkiv/node-fin.lua
+++ b/tex/context/base/mkiv/node-fin.lua
@@ -17,57 +17,57 @@ local setmetatableindex = table.setmetatableindex
local attributes, nodes, node = attributes, nodes, node
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getlist = nuts.getlist
-local getleader = nuts.getleader
-local getattr = nuts.getattr
-local getwidth = nuts.getwidth
-local getwhd = nuts.getwhd
-local getorientation = nuts.getorientation
-local has_dimensions = nuts.has_dimensions
-local getbox = nuts.getbox
-
-local setlist = nuts.setlist
-local setleader = nuts.setleader
-
-local copy_node = nuts.copy
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-
-local nextnode = nuts.traversers.node
-
-local nodecodes = nodes.nodecodes
-local rulecodes = nodes.rulecodes
-
-local boxrule_code = rulecodes.box
-local imagerule_code = rulecodes.image
-local emptyrule_code = rulecodes.empty
-
-local glyph_code = nodecodes.glyph
-local disc_code = nodecodes.disc
-local glue_code = nodecodes.glue
-local rule_code = nodecodes.rule
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-
-local texlists = tex.lists
-local texgetnest = tex.getnest
-
-local states = attributes.states
-local numbers = attributes.numbers
-local a_trigger = attributes.private('trigger')
-local triggering = false
-
-local implement = interfaces.implement
-
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-local loadstripped = utilities.lua.loadstripped
-local unsetvalue = attributes.unsetvalue
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getleader = nuts.getleader
+local getattr = nuts.getattr
+local getwidth = nuts.getwidth
+local getwhd = nuts.getwhd
+local getorientation = nuts.getorientation
+local hasdimensions = nuts.hasdimensions
+local getbox = nuts.getbox
+
+local setlist = nuts.setlist
+local setleader = nuts.setleader
+
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+
+local nextnode = nuts.traversers.node
+
+local nodecodes = nodes.nodecodes
+local rulecodes = nodes.rulecodes
+
+local boxrule_code = rulecodes.box
+local imagerule_code = rulecodes.image
+local emptyrule_code = rulecodes.empty
+
+local glyph_code = nodecodes.glyph
+local disc_code = nodecodes.disc
+local glue_code = nodecodes.glue
+local rule_code = nodecodes.rule
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+
+local texlists = tex.lists
+local texgetnest = tex.getnest
+
+local states = attributes.states
+local numbers = attributes.numbers
+local a_trigger = attributes.private('trigger')
+local triggering = false
+
+local implement = interfaces.implement
+
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+local loadstripped = utilities.lua.loadstripped
+local unsetvalue = attributes.unsetvalue
-- these two will be like trackers
@@ -163,13 +163,13 @@ function states.finalize(namespace,attribute,head) -- is this one ok?
if id == hlist_code or id == vlist_code then
local content = getlist(head)
if content then
- local list = insert_node_before(content,content,copy_node(nsnone)) -- two return values
+ local list = insertnodebefore(content,content,copy_node(nsnone)) -- two return values
if list ~= content then
setlist(head,list)
end
end
else
- head = insert_node_before(head,head,copy_node(nsnone))
+ head = insertnodebefore(head,head,copy_node(nsnone))
end
return head, true
end
@@ -199,20 +199,20 @@ local function process(attribute,head,inheritance,default) -- one attribute
if outer then
if default and outer == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= outer then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = outer
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
end
@@ -236,7 +236,7 @@ local function process(attribute,head,inheritance,default) -- one attribute
-- end nested --
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
-- much faster this way than using a check() and nested() function
if check then
@@ -244,11 +244,11 @@ local function process(attribute,head,inheritance,default) -- one attribute
if c then
if default and c == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= c then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = c
end
if leader then
@@ -281,11 +281,11 @@ local function process(attribute,head,inheritance,default) -- one attribute
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
check = false
@@ -326,7 +326,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
if default and outer == inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
else
@@ -334,7 +334,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- local s = nsforced or getattr(stack,nsselector)
if current ~= outer or current_selector ~= s then
local data = nsdata[outer]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or s or nsselector]))
current = outer
current_selector = s
end
@@ -342,11 +342,11 @@ local function selective(attribute,head,inheritance,default) -- two attributes
elseif default and inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
end
@@ -374,7 +374,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- so no redundant color stuff (only here, layers for instance should obey)
check = false
else
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
else
end
@@ -384,7 +384,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
if default and c == inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
else
@@ -392,7 +392,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- local s = nsforced or getattr(stack,nsselector)
if current ~= c or current_selector ~= s then
local data = nsdata[c]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or s or nsselector]))
current = c
current_selector = s
end
@@ -419,11 +419,11 @@ local function selective(attribute,head,inheritance,default) -- two attributes
elseif default and inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
check = false
@@ -470,9 +470,9 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
if a and current ~= a and nslistwise[a] then -- viewerlayer / needs checking, see below
local p = current
current = a
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
list = stacked(attribute,content,current) -- two return values
- head, stack = insert_node_after(head,stack,copy_node(nsnone))
+ head, stack = insertnodeafter(head,stack,copy_node(nsnone))
current = p
else
list = stacked(attribute,content,current)
@@ -485,13 +485,13 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
end
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
if check then
local a = getattr(stack,attribute)
if a then
if current ~= a then
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
depth = depth + 1
current = a
end
@@ -508,7 +508,7 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
elseif default > 0 then
--
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
depth = depth - 1
current = 0
end
@@ -517,7 +517,7 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
stack = getnext(stack)
end
while depth > 0 do
- head = insert_node_after(head,stack,copy_node(nsnone))
+ head = insertnodeafter(head,stack,copy_node(nsnone))
depth = depth - 1
end
return head
@@ -556,12 +556,12 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
if nslistwise then
local a = getattr(current,attribute)
if a and attrib ~= a and nslistwise[a] then -- viewerlayer
- head = insert_node_before(head,current,copy_node(nsdata[a]))
+ head = insertnodebefore(head,current,copy_node(nsdata[a]))
list = stacker(attribute,content,a)
if list ~= content then
setlist(current,list)
end
- head, current = insert_node_after(head,current,copy_node(nsnone))
+ head, current = insertnodeafter(head,current,copy_node(nsnone))
else
list = stacker(attribute,content,attrib)
if list ~= content then
@@ -576,7 +576,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
end
elseif id == rule_code then
- check = has_dimensions(current)
+ check = hasdimensions(current)
end
if check then
@@ -588,7 +588,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
local n = nsstep(a)
if n then
- head = insert_node_before(head,current,n) -- a
+ head = insertnodebefore(head,current,n) -- a
end
attrib = a
if leader then
@@ -617,7 +617,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
if stacked then
local n = nsend()
while n do
- head = insert_node_after(head,previous,n)
+ head = insertnodeafter(head,previous,n)
n = nsend()
end
end
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua
index f3bb6228f..b3a8ccc1e 100644
--- a/tex/context/base/mkiv/node-fnt.lua
+++ b/tex/context/base/mkiv/node-fnt.lua
@@ -60,21 +60,19 @@ local setprev = nuts.setprev
local isglyph = nuts.isglyph -- unchecked
local ischar = nuts.ischar -- checked
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextboundary = nuts.traversers.boundary
local nextdisc = nuts.traversers.disc
local nextchar = nuts.traversers.char
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local disc_code = nodecodes.disc
local boundary_code = nodecodes.boundary
local wordboundary_code = boundarycodes.word
-local protect_glyphs = nuts.protect_glyphs
-local unprotect_glyphs = nuts.unprotect_glyphs
+local protectglyphs = nuts.protectglyphs
+local unprotectglyphs = nuts.unprotectglyphs
local setmetatableindex = table.setmetatableindex
@@ -196,7 +194,7 @@ do
local a, u, b, r
local function protectnone()
- protect_glyphs(firstnone,lastnone)
+ protectglyphs(firstnone,lastnone)
firstnone = nil
end
@@ -392,7 +390,7 @@ do
end
end
end
- flush_node(r)
+ flushnode(r)
end
end
@@ -542,5 +540,5 @@ do
end
-handlers.protectglyphs = protect_glyphs
-handlers.unprotectglyphs = unprotect_glyphs
+handlers.protectglyphs = protectglyphs
+handlers.unprotectglyphs = unprotectglyphs
diff --git a/tex/context/base/mkiv/node-gcm.lua b/tex/context/base/mkiv/node-gcm.lua
index 5b598f6b0..de0018b4c 100644
--- a/tex/context/base/mkiv/node-gcm.lua
+++ b/tex/context/base/mkiv/node-gcm.lua
@@ -8,37 +8,37 @@ if not modules then modules = { } end modules ['node-gmc'] = {
local type, tostring = type, tostring
-local nodes = nodes
-local nodecodes = nodes.nodecodes
-local ligature_code = nodes.glyphcodes.ligature
-local nuts = nodes.nuts
+local nodes = nodes
+local nodecodes = nodes.nodecodes
+local ligature_code = nodes.glyphcodes.ligature
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getsubtype = nuts.getsubtype
-local getprev = nuts.getprev
-local setlink = nuts.setlink
-local nextglyph = nuts.traversers.glyph
-local copy_node = nuts.copy
-local isglyph = nuts.isglyph
+local getnext = nuts.getnext
+local getsubtype = nuts.getsubtype
+local getprev = nuts.getprev
+local setlink = nuts.setlink
+local nextglyph = nuts.traversers.glyph
+local copynode = nuts.copy
+local isglyph = nuts.isglyph
-local report_error = logs.reporter("node-aux:error")
+local report_error = logs.reporter("node-aux:error")
-local get_components = node.direct.getcomponents
-local set_components = node.direct.setcomponents
+local getcomponents = node.direct.getcomponents
+local setcomponents = node.direct.setcomponents
-local function copy_no_components(g,copyinjection)
- local components = get_components(g)
+local function copynocomponents(g,copyinjection)
+ local components = getcomponents(g)
if components then
- set_components(g)
- local n = copy_node(g)
+ setcomponents(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
- set_components(g,components)
+ setcomponents(g,components)
-- maybe also upgrade the subtype but we don't use it anyway
return n
else
- local n = copy_node(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
@@ -46,11 +46,11 @@ local function copy_no_components(g,copyinjection)
end
end
-local function copy_only_glyphs(current)
+local function copyonlyglyphs(current)
local head = nil
local previous = nil
for n in nextglyph, current do
- n = copy_node(n)
+ n = copynode(n)
if head then
setlink(previous,n)
else
@@ -63,14 +63,14 @@ end
-- start is a mark and we need to keep that one
-local function count_components(start,marks)
+local function countcomponents(start,marks)
local char = isglyph(start)
if char then
if getsubtype(start) == ligature_code then
local n = 0
- local components = get_components(start)
+ local components = getcomponents(start)
while components do
- n = n + count_components(components,marks)
+ n = n + countcomponents(components,marks)
components = getnext(components)
end
return n
@@ -81,16 +81,18 @@ local function count_components(start,marks)
return 0
end
-local function flush_components()
+local function flushcomponents()
-- this is a no-op in mkiv / generic
end
-nuts.set_components = set_components
-nuts.get_components = get_components
-nuts.copy_only_glyphs = copy_only_glyphs
-nuts.copy_no_components = copy_no_components
-nuts.count_components = count_components
-nuts.flush_components = flush_components
+nuts.components = {
+ set = setcomponents,
+ get = getcomponents,
+ copyonlyglyphs = copyonlyglyphs,
+ copynocomponents = copynocomponents,
+ count = countcomponents,
+ flush = flushcomponents,
+}
nuts.setcomponents = function() report_error("unsupported: %a","setcomponents") end
nuts.getcomponents = function() report_error("unsupported: %a","getcomponents") end
diff --git a/tex/context/base/mkiv/node-ini.mkiv b/tex/context/base/mkiv/node-ini.mkiv
index 38ec753cd..10998d060 100644
--- a/tex/context/base/mkiv/node-ini.mkiv
+++ b/tex/context/base/mkiv/node-ini.mkiv
@@ -37,6 +37,7 @@
\registerctxluafile{node-scn}{}
\registerctxluafile{node-syn}{}
\registerctxluafile{node-par}{}
+\registerctxluafile{node-bwc}{} % might stay
\newcount\c_node_tracers_show_box % box number
diff --git a/tex/context/base/mkiv/node-ltp.lua b/tex/context/base/mkiv/node-ltp.lua
index ecfd1fb6b..f008422e0 100644
--- a/tex/context/base/mkiv/node-ltp.lua
+++ b/tex/context/base/mkiv/node-ltp.lua
@@ -220,7 +220,7 @@ local getpre = nuts.getpre
local setpre = nuts.setpre
local isglyph = nuts.isglyph
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
local setfield = nuts.setfield
local setlink = nuts.setlink
@@ -240,16 +240,16 @@ local setexpansion = nuts.setexpansion
local find_tail = nuts.tail
local copy_node = nuts.copy
-local flush_node = nuts.flush
-local flush_node_list = nuts.flush_list
+local flushnode = nuts.flush
+local flushnodelist = nuts.flushlist
----- hpack_nodes = nuts.hpack
local xpack_nodes = nuts.hpack
local replace_node = nuts.replace
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local is_zero_glue = nuts.is_zero_glue
-local is_skipable = nuts.protrusion_skippable
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+local iszeroglue = nuts.iszeroglue
+local protrusionskippable = nuts.protrusionskippable
local setattributelist = nuts.setattributelist
local find_node = nuts.find_node
@@ -386,7 +386,7 @@ local function inject_dirs_at_begin_of_line(stack,current)
for i=1,n do
local d = new_direction(stack[i])
setattributelist(d,current)
- h, current = insert_node_after(h,current,d)
+ h, current = insertnodeafter(h,current,d)
end
stack.n = 0
return h
@@ -421,14 +421,14 @@ end
for i=n,1,-1 do
local d = new_direction(stack[i],true)
setattributelist(d,start)
- h, current = insert_node_after(h,current,d)
+ h, current = insertnodeafter(h,current,d)
end
end
stack.n = n
return current
end
-local ignore_math_skip = node.direct.ignore_math_skip or function(current)
+local ignoremathskip = nuts.ignoremathskip or function(current)
local mode = texget("mathskipmode")
if mode == 6 or mode == 7 then
local b = true
@@ -744,7 +744,7 @@ local function find(head) -- do we really want to recurse into an hlist?
else
return head
end
- elseif is_skipable(head) then
+ elseif protrusionskippable(head) then
head = getnext(head)
else
return head
@@ -798,7 +798,7 @@ local function find(head,tail)
else
return tail
end
- elseif is_skipable(tail) then
+ elseif protrusionskippable(tail) then
tail = getprev(tail)
else
return tail
@@ -1010,7 +1010,7 @@ do
end
local function used_skip(s)
- return s and not is_zero_glue(s) and s
+ return s and not iszeroglue(s) and s
end
local function initialize_line_break(head,display)
@@ -1357,7 +1357,7 @@ do
report_parbuilders('unsupported disc at location %a',3)
end
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
pre = nil -- signal
end
if replace then
@@ -1368,13 +1368,13 @@ do
setdisc(lastnode,pre,post,replace)
local pre, post, replace = getdisc(prevlast)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if replace then
- flush_node_list(replace)
+ flushnodelist(replace)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
setdisc(prevlast) -- nil,nil,nil
elseif subtype == firstdisc_code then
@@ -1387,7 +1387,7 @@ do
setpost(lastnode)
end
if replace then
- flush_node_list(replace)
+ flushnodelist(replace)
end
if pre then
setlink(prevlast,pre)
@@ -1414,7 +1414,7 @@ do
lastnode = inject_dirs_at_end_of_line(dirstack,lastnode,getnext(head),current_break.cur_break)
local rightbox = current_break.passive_right_box
if rightbox then
- lastnode = insert_node_after(lastnode,lastnode,copy_node(rightbox))
+ lastnode = insertnodeafter(lastnode,lastnode,copy_node(rightbox))
end
if not lineend then
lineend = lastnode
@@ -1495,8 +1495,8 @@ do
-- so we inherit attributes, lineend is new pseudo head
local k = new_rightmarginkern(copy_node(last_rightmost_char),-w)
setattributelist(k,p)
--- insert_node_after(c,c,k)
- insert_node_after(p,p,k)
+-- insertnodeafter(c,c,k)
+ insertnodeafter(p,p,k)
-- if c == lineend then
-- lineend = getnext(c)
-- end
@@ -1512,7 +1512,7 @@ do
if not glue_break then
local rs = new_rightskip(unpack(rightskip))
setattributelist(rs,lineend)
- start, lineend = insert_node_after(start,lineend,rs)
+ start, lineend = insertnodeafter(start,lineend,rs)
end
local rs = lineend
-- insert leftbox (if needed after parindent)
@@ -1520,9 +1520,9 @@ do
if leftbox then
local first = getnext(start)
if first and current_line == (par.first_line + 1) and getid(first) == hlist_code and not getlist(first) then
- insert_node_after(start,start,copy_node(leftbox))
+ insertnodeafter(start,start,copy_node(leftbox))
else
- start = insert_node_before(start,start,copy_node(leftbox))
+ start = insertnodebefore(start,start,copy_node(leftbox))
end
end
if protrude_chars > 0 then
@@ -1534,7 +1534,7 @@ do
if last_leftmost_char and w ~= 0 then
local k = new_rightmarginkern(copy_node(last_leftmost_char),-w)
setattributelist(k,p)
- start = insert_node_before(start,start,k)
+ start = insertnodebefore(start,start,k)
end
end
end
@@ -1546,7 +1546,7 @@ do
-- so we inherit attributes, start is pseudo head and moves back
local k = new_leftmarginkern(copy_node(last_leftmost_char),-w)
setattributelist(k,p)
- start = insert_node_before(start,start,k)
+ start = insertnodebefore(start,start,k)
end
end
end
@@ -1556,7 +1556,7 @@ do
-- we could check for non zero but we will normalize anyway
ls = new_leftskip(unpack(leftskip))
setattributelist(ls,start)
- start = insert_node_before(start,start,ls)
+ start = insertnodebefore(start,start,ls)
end
if normalize > 0 then
local par = nil
@@ -1570,7 +1570,7 @@ do
indent = n
end
elseif id == par_code then
- if start_of_par(n) then --- maybe subtype check instead
+ if startofpar(n) then --- maybe subtype check instead
par = n
elseif noflocals then
noflocals = noflocals + 1
@@ -1635,11 +1635,11 @@ do
setattributelist(r,start)
if normalize > 3 then
-- makes most sense
- start = insert_node_after(start,ls,l)
- start = insert_node_before(start,rs,r)
+ start = insertnodeafter(start,ls,l)
+ start = insertnodebefore(start,rs,r)
else
- start = insert_node_before(start,ls,l)
- start = insert_node_after(start,rs,r)
+ start = insertnodebefore(start,ls,l)
+ start = insertnodeafter(start,rs,r)
end
cur_width = hsize
cur_indent = 0
@@ -1740,7 +1740,7 @@ do
end
if current ~= head then
setnext(current)
- flush_node_list(getnext(head))
+ flushnodelist(getnext(head))
setlink(head,next)
end
end
@@ -1759,7 +1759,7 @@ par.head = head
report_parbuilders("no local par node")
end
end
- flush_node(h)
+ flushnode(h)
par.head = nil -- needs checking
end
current_line = current_line - 1
@@ -1799,7 +1799,7 @@ par.head = head
if next then
setprev(next)
end
- flush_node(head)
+ flushnode(head)
end
post_line_break(par)
reset_meta(par)
@@ -2600,7 +2600,7 @@ par.head = head
end
elseif id == math_code then
auto_breaking = getsubtype(current) == endmath_code
- if is_zero_glue(current) or ignore_math_skip(current) then
+ if iszeroglue(current) or ignoremathskip(current) then
local v = getnext(current)
if auto_breaking and getid(v) == glue_code then
p_active, n_active = try_break(0, unhyphenated_code, par, first_p, current, checked_expansion)
@@ -3090,7 +3090,7 @@ do
end
natural = natural + wd
elseif id == math_code then
- if is_zero_glue(current) or ignore_math_skip(current) then
+ if iszeroglue(current) or ignoremathskip(current) then
natural = natural + getkern(current)
else
local wd, stretch, shrink, stretch_order, shrink_order = getglue(current)
@@ -3272,7 +3272,7 @@ do
if p and getid(p) == marginkern_code then
found = p
end
- insert_node_before(head,found,g)
+ insertnodebefore(head,found,g)
end
end
end
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index 31f9a16b2..c39c9dd86 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-MET'] = {
+ if not modules then modules = { } end modules ['node-MET'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -10,7 +10,7 @@ if not modules then modules = { } end modules ['node-MET'] = {
-- the regular code is proven stable. No support otherwise.
-- luatex: todo: copylist should return h, t
--- todo: see if using insert_before and insert_after makes sense here
+-- todo: see if using insertbefore and insertafter makes sense here
-- This file is a side effect of the \LUATEX\ speed optimization project of Luigi
-- Scarso and me. As \CONTEXT\ spends over half its time in \LUA, we though that
@@ -65,73 +65,75 @@ end
-- We start with some helpers and provide all relevant basic functions in the
-- node namespace as well.
-nodes = nodes or { }
-local nodes = nodes
-
-local nodecodes = nodes.nodecodes
-
-nodes.tostring = node.tostring or tostring
-nodes.copy = node.copy
-nodes.copy_node = node.copy
-nodes.copy_list = node.copy_list
-nodes.delete = node.delete
-nodes.dimensions = node.dimensions
-nodes.rangedimensions = node.rangedimensions
-nodes.end_of_math = node.end_of_math
-nodes.flush = node.flush_node
-nodes.flush_node = node.flush_node
-nodes.flush_list = node.flush_list
-nodes.free = node.free
-nodes.insert_after = node.insert_after
-nodes.insert_before = node.insert_before
-nodes.hpack = node.hpack
-nodes.new = node.new
-nodes.tail = node.tail
-nodes.traverse = node.traverse
-nodes.traverse_id = node.traverse_id
-nodes.traverse_char = node.traverse_char
-nodes.traverse_glyph = node.traverse_glyph
-nodes.traverse_list = node.traverse_list
-nodes.slide = node.slide
-nodes.vpack = node.vpack
-nodes.fields = node.fields
-nodes.is_node = node.is_node
-nodes.setglue = node.setglue
-nodes.uses_font = node.uses_font
-
-nodes.first_glyph = node.first_glyph
-nodes.has_glyph = node.has_glyph or node.first_glyph
-
-nodes.current_attributes = node.current_attributes or node.current_attr
-nodes.has_field = node.has_field
-nodes.last_node = node.last_node
-nodes.usedlist = node.usedlist
-nodes.protrusion_skippable = node.protrusion_skippable
-nodes.check_discretionaries = node.check_discretionaries
-nodes.write = node.write
-nodes.flatten_discretionaries = node.flatten_discretionaries
-
-nodes.count = node.count
-nodes.length = node.length
-
-nodes.has_attribute = node.has_attribute
-nodes.set_attribute = node.set_attribute
-nodes.find_attribute = node.find_attribute
-nodes.unset_attribute = node.unset_attribute
-
-nodes.protect_glyph = node.protect_glyph
-nodes.protect_glyphs = node.protect_glyphs
-nodes.unprotect_glyph = node.unprotect_glyph
-nodes.unprotect_glyphs = node.unprotect_glyphs
-nodes.kerning = node.kerning
-nodes.ligaturing = node.ligaturing
-nodes.hyphenating = node.hyphenating
-nodes.mlist_to_hlist = node.mlist_to_hlist
-
-nodes.effective_glue = node.effective_glue
-nodes.getglue = node.getglue
-nodes.setglue = node.setglue
-nodes.is_zero_glue = node.is_zero_glue
+nodes = nodes or { }
+local nodes = nodes
+
+local nodecodes = nodes.nodecodes
+
+nodes.tostring = node.tostring or tostring
+nodes.copy = node.copy
+nodes.copynode = node.copy
+nodes.copylist = node.copy_list
+nodes.delete = node.delete
+nodes.dimensions = node.dimensions
+nodes.rangedimensions = node.rangedimensions
+nodes.endofmath = node.end_of_math
+nodes.flush = node.flush_node
+nodes.flushnode = node.flush_node
+nodes.flushlist = node.flush_list
+nodes.free = node.free
+nodes.insertafter = node.insert_after
+nodes.insertbefore = node.insert_before
+nodes.hpack = node.hpack
+nodes.new = node.new
+nodes.tail = node.tail
+nodes.traverse = node.traverse
+nodes.traverseid = node.traverse_id
+nodes.traversechar = node.traverse_char
+nodes.traverseglyph = node.traverse_glyph
+nodes.traverselist = node.traverse_list
+nodes.slide = node.slide
+nodes.vpack = node.vpack
+nodes.fields = node.fields
+nodes.isnode = node.is_node
+nodes.isdirect = node.is_direct
+nodes.isnut = node.is_direct
+nodes.setglue = node.setglue
+nodes.usesfont = node.uses_font
+
+nodes.firstglyph = node.first_glyph
+nodes.hasglyph = node.has_glyph
+
+nodes.currentattributes = node.current_attributes or node.current_attr
+nodes.hasfield = node.has_field
+nodes.last_node = node.last_node
+nodes.usedlist = node.usedlist
+nodes.protrusionskippable = node.protrusion_skippable
+nodes.checkdiscretionaries = node.check_discretionaries
+nodes.write = node.write
+nodes.flattendiscretionaries = node.flatten_discretionaries
+
+nodes.count = node.count
+nodes.length = node.length
+
+nodes.hasattribute = node.has_attribute
+nodes.setattribute = node.set_attribute
+nodes.findattribute = node.find_attribute
+nodes.unsetattribute = node.unset_attribute
+
+nodes.protectglyph = node.protect_glyph
+nodes.protectglyphs = node.protect_glyphs
+nodes.unprotectglyph = node.unprotect_glyph
+nodes.unprotectglyphs = node.unprotect_glyphs
+nodes.kerning = node.kerning
+nodes.ligaturing = node.ligaturing
+nodes.hyphenating = node.hyphenating
+nodes.mlisttohlist = node.mlist_to_hlist
+
+nodes.effectiveglue = node.effective_glue
+nodes.getglue = node.getglue
+nodes.setglue = node.setglue
+nodes.iszeroglue = node.iszeroglue
nodes.tonode = function(n) return n end
nodes.tonut = function(n) return n end
@@ -149,7 +151,7 @@ nodes.getfield = n_getfield
nodes.setfield = n_setfield
nodes.getattr = n_getattr
nodes.setattr = n_setattr
-nodes.takeattr = nodes.unset_attribute
+nodes.takeattr = nodes.unsetattribute
local function n_getid (n) return n_getfield(n,"id") end
local function n_getsubtype(n) return n_getfield(n,"subtype") end
@@ -213,13 +215,13 @@ nodes.setlink = n_setlink
nodes.getbox = node.getbox or tex.getbox
nodes.setbox = node.setbox or tex.setbox
-local n_flush_node = nodes.flush
-local n_copy_node = nodes.copy
-local n_copy_list = nodes.copy_list
-local n_find_tail = nodes.tail
-local n_insert_after = nodes.insert_after
-local n_insert_before = nodes.insert_before
-local n_slide = nodes.slide
+local n_flushnode = nodes.flush
+local n_copynode = nodes.copy
+local n_copylist = nodes.copylist
+local n_findtail = nodes.tail
+local n_insertafter = nodes.insertafter
+local n_insertbefore = nodes.insertbefore
+local n_slide = nodes.slide
local n_remove_node = node.remove -- not yet nodes.remove
@@ -229,7 +231,7 @@ local function remove(head,current,free_too)
if not t then
-- forget about it
elseif free_too then
- n_flush_node(t)
+ n_flushnode(t)
t = nil
else
n_setboth(t)
@@ -266,10 +268,10 @@ function nodes.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- n_flush_node(current)
+ n_flushnode(current)
return head, new
else
- n_flush_node(current)
+ n_flushnode(current)
return new
end
end
@@ -278,14 +280,14 @@ end
function nodes.append(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_after(head,current,(select(i,...)))
+ head, current = n_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nodes.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_before(head,current,(select(i,...)))
+ head, current = n_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -300,7 +302,7 @@ function nodes.linked(...)
else
head = next
end
- last = n_find_tail(next) -- we could skip the last one
+ last = n_findtail(next) -- we could skip the last one
end
end
return head
@@ -391,7 +393,7 @@ metatable.__concat = function(n1,n2) -- todo: accept nut on one end
-- or abort
return n2 -- or n2 * 2
else
- local tail = n_find_tail(n1)
+ local tail = n_findtail(n1)
n_setlink(tail,n2)
return n1
end
@@ -406,19 +408,19 @@ metatable.__mul = function(n,multiplier)
elseif n_getnext(n) then
local head
for i=2,multiplier do
- local h = n_copy_list(n)
+ local h = n_copylist(n)
if head then
- local t = n_find_tail(h)
+ local t = n_findtail(h)
n_setlink(t,head)
end
head = h
end
- local t = n_find_tail(n)
+ local t = n_findtail(n)
n_setlink(t,head)
else
local head
for i=2,multiplier do
- local c = n_copy_node(n)
+ local c = n_copynode(n)
if head then
n_setlink(c,head)
end
@@ -431,10 +433,10 @@ end
metatable.__sub = function(first,second)
if type(second) == "number" then
- local tail = n_find_tail(first)
+ local tail = n_findtail(first)
for i=1,second do
local prev = n_getprev(tail)
- n_flush_node(tail) -- can become flushlist/flushnode
+ n_flushnode(tail) -- can become flushlist/flushnode
if prev then
tail = prev
else
@@ -449,15 +451,15 @@ metatable.__sub = function(first,second)
end
else
-- aaaaa - bbb => aaaabbba
- local firsttail = n_find_tail(first)
+ local firsttail = n_findtail(first)
local prev = n_getprev(firsttail)
if prev then
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(secondtail,firsttail)
n_setlink(prev,second)
return first
else
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(secondtail,first)
return second
end
@@ -469,7 +471,7 @@ metatable.__add = function(first,second)
local head = second
for i=1,first do
local second = n_getnext(head)
- n_flush_node(head) -- can become flushlist/flushnode
+ n_flushnode(head) -- can become flushlist/flushnode
if second then
head = second
else
@@ -486,7 +488,7 @@ metatable.__add = function(first,second)
-- aaaaa + bbb => abbbaaaa
local next = n_getnext(first)
if next then
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(first,second)
n_setlink(secondtail,next)
else
@@ -514,12 +516,12 @@ metatable.__pow = function(n,multiplier)
local head = nil
if n_getnext(n) then
if multiplier == 1 then
- head = n_copy_list(n)
+ head = n_copylist(n)
else
for i=1,multiplier do
- local h = n_copy_list(n)
+ local h = n_copylist(n)
if head then
- local t = n_find_tail(h)
+ local t = n_findtail(h)
n_setlink(t,head)
end
head = h
@@ -527,10 +529,10 @@ metatable.__pow = function(n,multiplier)
end
else
if multiplier == 1 then
- head = n_copy_node(n)
+ head = n_copynode(n)
else
for i=2,multiplier do
- local c = n_copy_node(n)
+ local c = n_copynode(n)
if head then
n_setlink(head,c)
end
diff --git a/tex/context/base/mkiv/node-mig.lua b/tex/context/base/mkiv/node-mig.lua
index 13414c560..064003269 100644
--- a/tex/context/base/mkiv/node-mig.lua
+++ b/tex/context/base/mkiv/node-mig.lua
@@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['node-mig'] = {
license = "see context related readme files"
}
--- todo: insert_after
-
local format = string.format
local trace_migrations = false trackers.register("nodes.migrations", function(v) trace_migrations = v end)
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index 9909194e7..e789fae2b 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-nut'] = {
+ if not modules then modules = { } end modules ['node-nut'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -88,131 +88,106 @@ if not modules then modules = { } end modules ['node-nut'] = {
local type, rawget = type, rawget
-local nodes = nodes
-local direct = node.direct
+local nodes = nodes
+local direct = node.direct
-local fastcopy = table.fastcopy
+local fastcopy = table.fastcopy
-local nodecodes = nodes.nodecodes
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local glyph_code = nodecodes.glyph
+local nodecodes = nodes.nodecodes
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local glyph_code = nodecodes.glyph
-local nuts = nodes.nuts or { }
-nodes.nuts = nuts
+local nuts = nodes.nuts or { }
+nodes.nuts = nuts
-nodes.is_node = direct.is_node or function() return true end
-nodes.is_direct = direct.is_direct or function() return false end
-nodes.is_nut = nodes.is_direct
+nodes.isnode = direct.isnode or function() return true end
+nodes.isdirect = direct.isdirect or function() return false end
+nodes.isnut = nodes.isdirect
-- casters
-local tonode = direct.tonode or function(n) return n end
-local tonut = direct.todirect or function(n) return n end
+local tonode = direct.tonode or function(n) return n end
+local tonut = direct.todirect or function(n) return n end
-nuts.tonode = tonode
-nuts.tonut = tonut
+nuts.tonode = tonode
+nuts.tonut = tonut
-nodes.tonode = tonode
-nodes.tonut = tonut
-
--- -- some tracing:
---
--- local hash = table.setmetatableindex("number")
--- local ga = direct.get_attribute
--- function direct.get_attribute(n,a)
--- hash[a] = hash[a] + 1
--- return ga(n,a)
--- end
--- function nuts.reportattr()
--- inspect(hash)
--- end
-
--- local function track(name)
--- local n = 0
--- local f = direct[name]
--- direct[name] = function(...)
--- n = n + 1
--- if n % 1000 == 0 then
--- print(name,n)
--- end
--- return f(...)
--- end
--- end
--- track("getfield")
+nodes.tonode = tonode
+nodes.tonut = tonut
-- helpers
local nuts = nodes.nuts
-nuts.check_discretionaries = direct.check_discretionaries
+nuts.checkdiscretionaries = direct.check_discretionaries
nuts.copy = direct.copy
-nuts.copy_node = direct.copy
-nuts.copy_only = direct.copy_only or direct.copy
-nuts.copy_list = direct.copy_list
+nuts.copynode = direct.copy
+nuts.copyonly = direct.copy_only or direct.copy
+nuts.copylist = direct.copy_list
nuts.count = direct.count
-nuts.current_attr = direct.current_attr
+nuts.currentattribute = direct.current_attr
+nuts.currentattr = direct.current_attr
nuts.delete = direct.delete
nuts.dimensions = direct.dimensions
-nuts.end_of_math = direct.end_of_math
-nuts.find_attribute = direct.find_attribute
-nuts.first_glyph = direct.first_glyph
-nuts.flatten_discretionaries = direct.flatten_discretionaries
+nuts.endofmath = direct.end_of_math
+nuts.findattribute = direct.find_attribute
+nuts.firstglyph = direct.first_glyph
+nuts.flattendiscretionaries = direct.flatten_discretionaries
nuts.flush = direct.flush_node
-nuts.flush_list = direct.flush_list
-nuts.flush_node = direct.flush_node
+nuts.flushlist = direct.flush_list
+nuts.flushnode = direct.flush_node
nuts.free = direct.free
-nuts.get_synctex_fields = direct.get_synctex_fields
-nuts.has_attribute = direct.has_attribute
-nuts.has_field = direct.has_field
-nuts.has_glyph = direct.has_glyph or direct.first_glyph
+nuts.getsynctexfields = direct.get_synctex_fields
+nuts.hasattribute = direct.has_attribute
+nuts.hasfield = direct.has_field
+nuts.hasglyph = direct.has_glyph or direct.first_glyph
nuts.hpack = direct.hpack
-nuts.insert_after = direct.insert_after
-nuts.insert_before = direct.insert_before
-nuts.is_direct = direct.is_direct
-nuts.is_node = direct.is_node
-nuts.is_nut = direct.is_direct
+nuts.insertafter = direct.insert_after
+nuts.insertbefore = direct.insert_before
+nuts.isdirect = direct.is_direct
+nuts.isnode = direct.is_node
+nuts.isnut = direct.is_direct
nuts.kerning = direct.kerning
nuts.hyphenating = direct.hyphenating
-nuts.last_node = direct.last_node
+nuts.lastnode = direct.last_node
nuts.length = direct.length
nuts.ligaturing = direct.ligaturing
nuts.new = direct.new
-nuts.protect_glyph = direct.protect_glyph
-nuts.protect_glyphs = direct.protect_glyphs
-nuts.flush_components = direct.flush_components
-nuts.protrusion_skippable = direct.protrusion_skippable
+nuts.protectglyph = direct.protect_glyph
+nuts.protectglyphs = direct.protect_glyphs
+nuts.protrusionskippable = direct.protrusion_skippable
nuts.rangedimensions = direct.rangedimensions
-nuts.set_attribute = direct.set_attribute
-nuts.set_synctex_fields = direct.set_synctex_fields
+nuts.setattribute = direct.set_attribute
+nuts.setsynctexfields = direct.set_synctex_fields
nuts.slide = direct.slide
nuts.tail = direct.tail
nuts.tostring = direct.tostring
nuts.traverse = direct.traverse
-nuts.traverse_char = direct.traverse_char
-nuts.traverse_glyph = direct.traverse_glyph
-nuts.traverse_id = direct.traverse_id
-nuts.traverse_list = direct.traverse_list
-nuts.unprotect_glyph = direct.unprotect_glyph
-nuts.unprotect_glyphs = direct.unprotect_glyphs
-nuts.unset_attribute = direct.unset_attribute
-nuts.unset_attribute = direct.unset_attribute
+nuts.traversechar = direct.traverse_char
+nuts.traverseglyph = direct.traverse_glyph
+nuts.traverseid = direct.traverse_id
+nuts.traverselist = direct.traverse_list
+nuts.unprotectglyph = direct.unprotect_glyph
+nuts.unprotectglyphs = direct.unprotect_glyphs
+nuts.unsetattribute = direct.unset_attribute
+nuts.unsetattribute = direct.unset_attribute
nuts.usedlist = direct.usedlist
-nuts.uses_font = direct.uses_font
+nuts.usesfont = direct.uses_font
nuts.vpack = direct.vpack
nuts.write = direct.write
-nuts.mlist_to_hlist = direct.mlist_to_hlist
-nuts.has_dimensions = direct.has_dimensions
-nuts.start_of_par = direct.start_of_par
+nuts.mlisttohlist = direct.mlist_to_hlist
+nuts.hasdimensions = direct.has_dimensions
+nuts.startofpar = direct.start_of_par
nuts.migrate = direct.migrate
-if not nuts.mlist_to_hlist then
+if not nuts.mlisttohlist then
- local n_mlist_to_hlist = node.mlist_to_hlist
+ local n_mlisttohlist = node.mlist_to_hlist
- function nuts.mlist_to_hlist(head,...)
+ function nuts.mlisttohlist(head,...)
if head then
- local head = n_mlist_to_hlist(tonode(head),...)
+ local head = n_mlisttohlist(tonode(head),...)
if head then
return tonut(head)
end
@@ -221,11 +196,11 @@ if not nuts.mlist_to_hlist then
end
-if not nuts.has_dimensions then
+if not nuts.hasdimensions then
local getwhd = direct.getwhd
- function nuts.has_dimensions(n)
+ function nuts.hasdimensions(n)
local wd, ht, dp = getwhd(n)
return wd ~= 0 or (ht + dp) ~= 0
end
@@ -246,16 +221,20 @@ nuts.getid = direct.getid
nuts.getprev = direct.getprev
nuts.setprev = direct.setprev
-local get_attribute = direct.get_attribute
-local set_attribute = direct.set_attribute
-local unset_attribute = direct.unset_attribute
+local getattribute = direct.get_attribute
+local setattribute = direct.set_attribute
+local unsetattribute = direct.unset_attribute
+
+nuts.getattr = getattribute
+nuts.setattr = setattribute
+nuts.takeattr = unsetattribute -- ?
-nuts.getattr = get_attribute
-nuts.setattr = set_attribute
-nuts.takeattr = unset_attribute -- ?
+nuts.getattribute = getattribute
+nuts.setattribute = setattribute
+nuts.unsetattribute = unsetattribute -- ?
-nuts.is_zero_glue = direct.is_zero_glue
-nuts.effective_glue = direct.effective_glue
+nuts.iszeroglue = direct.is_zero_glue
+nuts.effectiveglue = direct.effective_glue
nuts.getglue = direct.getglue
nuts.setglue = direct.setglue
@@ -302,8 +281,8 @@ nuts.gettotal = direct.gettotal
nuts.getorientation = direct.getorientation or function() end
nuts.setorientation = direct.setorientation or function() end
-nuts.getglyphdata = direct.getglyphdata or get_attribute
-nuts.setglyphdata = direct.setglyphdata or function(n,d) set_attribute(n,0,d) end
+nuts.getglyphdata = direct.getglyphdata or getattribute
+nuts.setglyphdata = direct.setglyphdata or function(n,d) setattribute(n,0,d) end
nuts.getruledata = direct.getglyphdata and getdata or function(n) return getfield(n,"transform") end
nuts.setruledata = direct.setglyphdata and setdata or function(n,d) return setfield(n,"transform",d) end
@@ -381,20 +360,16 @@ nuts.setbox = direct.setbox
nuts.ischar = direct.is_char
nuts.isglyph = direct.is_glyph
-----.is_char = nuts.ischar
-----.is_glyph = nuts.isglyph
-
local d_remove_node = direct.remove
-local d_flush_node = direct.flush_node
+local d_flushnode = direct.flush_node
local d_getnext = direct.getnext
local d_getprev = direct.getprev
local d_getid = direct.getid
local d_getlist = direct.getlist
local d_find_tail = direct.tail
-local d_insert_after = direct.insert_after
-local d_insert_before = direct.insert_before
+local d_insertafter = direct.insert_after
+local d_insertbefore = direct.insert_before
local d_slide = direct.slide
------ d_copy_node = direct.copy
local d_traverse = direct.traverse
local d_setlink = direct.setlink
local d_setboth = direct.setboth
@@ -404,7 +379,7 @@ local remove = function(head,current,free_too)
if current then
local h, c = d_remove_node(head,current)
if free_too then
- d_flush_node(current)
+ d_flushnode(current)
return h, c
else
d_setboth(current)
@@ -416,7 +391,7 @@ end
-- for now
-if not nuts.start_of_par then
+if not nuts.startofpar then
local parcodes = nodes.parcodes
local hmodepar_code = parcodes.vmode_par
@@ -424,7 +399,7 @@ if not nuts.start_of_par then
local getsubtype = nuts.getsubtype
- function nuts.start_of_par(n)
+ function nuts.startofpar(n)
local s = getsubtype(n)
return s == hmodepar_code or s == vmodepar_code
end
@@ -507,10 +482,10 @@ function nuts.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- d_flush_node(current)
+ d_flushnode(current)
return head, new
else
- d_flush_node(current)
+ d_flushnode(current)
return new
end
end
@@ -542,14 +517,14 @@ end
function nuts.append(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_after(head,current,(select(i,...)))
+ head, current = d_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nuts.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_before(head,current,(select(i,...)))
+ head, current = d_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -604,43 +579,7 @@ function nodes.vianodes(f) return function(n,...) return tonut (f(tonode(n),...)
nuts.vianuts = nodes.vianuts
nuts.vianodes = nodes.vianodes
--- function nodes.insert_before(h,c,n)
--- if c then
--- if c == h then
--- n_setfield(n,"next",h)
--- n_setfield(n,"prev",nil)
--- n_setfield(h,"prev",n)
--- else
--- local cp = n_getprev(c)
--- n_setfield(n,"next",c)
--- n_setfield(n,"prev",cp)
--- if cp then
--- n_setfield(cp,"next",n)
--- end
--- n_setfield(c,"prev",n)
--- return h, n
--- end
--- end
--- return n, n
--- end
-
--- function nodes.insert_after(h,c,n)
--- if c then
--- local cn = n_getnext(c)
--- if cn then
--- n_setfield(n,"next",cn)
--- n_setfield(cn,"prev",n)
--- else
--- n_setfield(n,"next",nil)
--- end
--- n_setfield(c,"next",n)
--- n_setfield(n,"prev",c)
--- return h, n
--- end
--- return n, n
--- end
-
-function nodes.insert_list_after(h,c,n)
+function nodes.insertlistafter(h,c,n)
local t = n_tail(n)
if c then
local cn = n_getnext(c)
@@ -658,41 +597,7 @@ function nodes.insert_list_after(h,c,n)
return n, t
end
--- function nuts.insert_before(h,c,n)
--- if c then
--- if c == h then
--- d_setnext(n,h)
--- d_setprev(n)
--- d_setprev(h,n)
--- else
--- local cp = d_getprev(c)
--- d_setnext(n,c)
--- d_setprev(n,cp)
--- if cp then
--- d_setnext(cp,n)
--- end
--- d_setprev(c,n)
--- return h, n
--- end
--- end
--- return n, n
--- end
-
--- function nuts.insert_after(h,c,n)
--- if c then
--- local cn = d_getnext(c)
--- if cn then
--- d_setlink(n,cn)
--- else
--- d_setnext(n,nil)
--- end
--- d_setlink(c,n)
--- return h, n
--- end
--- return n, n
--- end
-
-function nuts.insert_list_after(h,c,n)
+function nuts.insertlistafter(h,c,n)
local t = d_tail(n)
if c then
local cn = d_getnext(c)
diff --git a/tex/context/base/mkiv/node-ppt.lua b/tex/context/base/mkiv/node-ppt.lua
index 485e742b6..35dc07d55 100644
--- a/tex/context/base/mkiv/node-ppt.lua
+++ b/tex/context/base/mkiv/node-ppt.lua
@@ -77,7 +77,7 @@ local function register(where,data,...)
end
end
-local writenode = node.write
+local writenode = nodes.write
local flushnode = context.nodes.flush
function commands.deferredproperty(...)
diff --git a/tex/context/base/mkiv/node-pro.lua b/tex/context/base/mkiv/node-pro.lua
index 4d748af89..6613555f8 100644
--- a/tex/context/base/mkiv/node-pro.lua
+++ b/tex/context/base/mkiv/node-pro.lua
@@ -69,7 +69,7 @@ processors.enabled = true -- this will become a proper state (like trackers)
do
- local has_glyph = nodes.has_glyph
+ local hasglyph = nodes.hasglyph
local count_nodes = nodes.countall
local texget = tex.get
@@ -77,7 +77,7 @@ do
local tracer = processors.tracer
local function pre_linebreak_filter(head,groupcode)
- local found = force_processors or has_glyph(head)
+ local found = force_processors or hasglyph(head)
if found then
if trace_callbacks then
local before = count_nodes(head,true)
@@ -95,7 +95,7 @@ do
end
local function hpack_filter(head,groupcode,size,packtype,direction,attributes)
- local found = force_processors or has_glyph(head)
+ local found = force_processors or hasglyph(head)
if found then
--
-- yes or no or maybe an option
@@ -148,7 +148,7 @@ do
end
do
- -- Beware, these are packaged boxes so no first_glyph test needed. Maybe some day I'll add a hash
+ -- Beware, these are packaged boxes so no firstglyph test needed. Maybe some day I'll add a hash
-- with valid groupcodes. Watch out, much can pass twice, for instance vadjust passes two times,
local actions = tasks.actions("finalizers") -- head, where
diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua
index 098ed50c2..2cade31de 100644
--- a/tex/context/base/mkiv/node-ref.lua
+++ b/tex/context/base/mkiv/node-ref.lua
@@ -78,7 +78,8 @@ local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
local traverse = nuts.traverse
local find_node_tail = nuts.tail
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -107,7 +108,7 @@ local new_rule = nodepool.rule
local new_kern = nodepool.kern
local new_hlist = nodepool.hlist
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local tosequence = nodes.tosequence
@@ -135,7 +136,7 @@ local function vlist_dimensions(start,stop) -- also needs the stretch and so
local v = vpack_list(start)
local w, h, d = getwhd(v)
setlist(v) -- not needed
- flush_node(v)
+ flushnode(v)
if temp then
setnext(stop,temp)
end
@@ -421,7 +422,7 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
local direction, pop = getdirection(current)
txtdir = not pop and direction -- we might need a stack
elseif id == par_code then
- if start_of_par(current) then
+ if startofpar(current) then
pardir = getdirection(current)
end
elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left?
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua
index 478a46906..684a8cc77 100644
--- a/tex/context/base/mkiv/node-res.lua
+++ b/tex/context/base/mkiv/node-res.lua
@@ -99,7 +99,7 @@ local setdata = nuts.setdata
local setruledata = nuts.setruledata
local setvalue = nuts.setvalue
-local copy_nut = nuts.copy_only or nuts.copy
+local copy_nut = nuts.copy
local new_nut = nuts.new
local flush_nut = nuts.flush
@@ -617,19 +617,19 @@ lua.registerfinalizer(cleanup, "cleanup reserved nodes")
do
- local glyph = tonode(glyph)
- local traverse_id = nodes.traverse_id
+ local glyph = tonode(glyph)
+ local traverseid = nodes.traverseid
- local traversers = table.setmetatableindex(function(t,k)
- local v = traverse_id(type(k) == "number" and k or nodecodes[k],glyph)
+ local traversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph)
t[k] = v
return v
end)
- traversers.node = nodes.traverse (glyph)
- traversers.char = nodes.traverse_char (glyph)
- if nodes.traverse_glyph then traversers.glyph = nodes.traverse_glyph(glyph) end
- if nodes.traverse_list then traversers.list = nodes.traverse_list (glyph) end
+ traversers.node = nodes.traverse (glyph)
+ traversers.char = nodes.traversechar (glyph)
+ if nodes.traverseglyph then traversers.glyph = nodes.traverseglyph(glyph) end
+ if nodes.traverselist then traversers.list = nodes.traverselist (glyph) end
nodes.traversers = traversers
@@ -637,20 +637,20 @@ end
do
- local glyph = glyph
- local traverse_id = nuts.traverse_id
+ local glyph = glyph
+ local traverseid = nuts.traverseid
- local traversers = table.setmetatableindex(function(t,k)
- local v = traverse_id(type(k) == "number" and k or nodecodes[k],glyph)
+ local traversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph)
t[k] = v
return v
end)
- traversers.node = nuts.traverse (glyph)
- traversers.char = nuts.traverse_char (glyph)
- if nuts.traverse_glyph then traversers.glyph = nuts.traverse_glyph (glyph) end
- if nuts.traverse_list then traversers.list = nuts.traverse_list (glyph) end
- if nuts.traverse_content then traversers.content = nuts.traverse_content(glyph) end
+ traversers.node = nuts.traverse (glyph)
+ traversers.char = nuts.traversechar (glyph)
+ if nuts.traverseglyph then traversers.glyph = nuts.traverseglyph (glyph) end
+ if nuts.traverselist then traversers.list = nuts.traverselist (glyph) end
+ if nuts.traversecontent then traversers.content = nuts.traversecontent(glyph) end
nuts.traversers = traversers
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index f60fb2406..7ef58e970 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -57,15 +57,15 @@ local getruledata = nuts.getruledata
local isglyph = nuts.isglyph
-local flushlist = nuts.flush_list
-local effective_glue = nuts.effective_glue
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local flushlist = nuts.flushlist
+local effectiveglue = nuts.effectiveglue
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local find_tail = nuts.tail
local setglue = nuts.setglue
local getrangedimensions = nuts.rangedimensions
local hpack_nodes = nuts.hpack
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local nexthlist = nuts.traversers.hlist
@@ -317,7 +317,7 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
setattr(r,a_viewerlayer,layer)
end
if empty then
- head = insert_node_before(head,f,r)
+ head = insertnodebefore(head,f,r)
setlink(r,getnext(l))
setprev(f)
setnext(l)
@@ -325,12 +325,12 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
else
local k = new_kern(-wd)
if foreground then
- insert_node_after(head,l,k)
- insert_node_after(head,k,r)
+ insertnodeafter(head,l,k)
+ insertnodeafter(head,k,r)
l = r
else
- head = insert_node_before(head,f,r)
- insert_node_after(head,r,k)
+ head = insertnodebefore(head,f,r)
+ insertnodeafter(head,r,k)
end
end
if trace_ruled then
@@ -356,7 +356,7 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
else
local tx = d.text
if tx then
- local l = copy_list(tx)
+ local l = copylist(tx)
if d["repeat"] == v_yes then
l = new_leader(wd,l)
setattrlist(l,tx)
@@ -603,7 +603,7 @@ function linefillers.handler(head)
if head then
local indentation = iskip and getwidth(iskip) or 0
local leftfixed = lskip and getwidth(lskip) or 0
- local lefttotal = lskip and effective_glue(lskip,current) or 0
+ local lefttotal = lskip and effectiveglue(lskip,current) or 0
local width = lefttotal - (leftlocal and leftfixed or 0) + indentation - distance
if width > threshold then
if iskip then
@@ -612,13 +612,13 @@ function linefillers.handler(head)
if lskip then
setglue(lskip,leftlocal and getwidth(lskip) or nil)
if distance > 0 then
- insert_node_after(list,lskip,new_kern(distance))
+ insertnodeafter(list,lskip,new_kern(distance))
end
- insert_node_after(list,lskip,linefiller(current,data,width,"left"))
+ insertnodeafter(list,lskip,linefiller(current,data,width,"left"))
else
- insert_node_before(list,head,linefiller(current,data,width,"left"))
+ insertnodebefore(list,head,linefiller(current,data,width,"left"))
if distance > 0 then
- insert_node_before(list,head,new_kern(distance))
+ insertnodebefore(list,head,new_kern(distance))
end
end
end
@@ -642,9 +642,9 @@ function linefillers.handler(head)
end
if tail then
local rightfixed = rskip and getwidth(rskip) or 0
- local righttotal = rskip and effective_glue(rskip,current) or 0
+ local righttotal = rskip and effectiveglue(rskip,current) or 0
local parfixed = pskip and getwidth(pskip) or 0
- local partotal = pskip and effective_glue(pskip,current) or 0
+ local partotal = pskip and effectiveglue(pskip,current) or 0
local width = righttotal - (rightlocal and rightfixed or 0) + partotal - distance
if width > threshold then
if pskip then
@@ -653,13 +653,13 @@ function linefillers.handler(head)
if rskip then
setglue(rskip,rightlocal and getwidth(rskip) or nil)
if distance > 0 then
- insert_node_before(list,rskip,new_kern(distance))
+ insertnodebefore(list,rskip,new_kern(distance))
end
- insert_node_before(list,rskip,linefiller(current,data,width,"right"))
+ insertnodebefore(list,rskip,linefiller(current,data,width,"right"))
else
- insert_node_after(list,tail,linefiller(current,data,width,"right"))
+ insertnodeafter(list,tail,linefiller(current,data,width,"right"))
if distance > 0 then
- insert_node_after(list,tail,new_kern(distance))
+ insertnodeafter(list,tail,new_kern(distance))
end
end
end
diff --git a/tex/context/base/mkiv/node-scn.lua b/tex/context/base/mkiv/node-scn.lua
index 3c1dd2d88..55f39a74b 100644
--- a/tex/context/base/mkiv/node-scn.lua
+++ b/tex/context/base/mkiv/node-scn.lua
@@ -21,8 +21,6 @@ local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
local setlist = nuts.setlist
-local end_of_math = nuts.end_of_math
-
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local kerncodes = nodes.kerncodes
diff --git a/tex/context/base/mkiv/node-ser.lua b/tex/context/base/mkiv/node-ser.lua
index 25a6dd6c3..0f4d13bb6 100644
--- a/tex/context/base/mkiv/node-ser.lua
+++ b/tex/context/base/mkiv/node-ser.lua
@@ -17,14 +17,11 @@ local allocate = utilities.storage.allocate
local context = context
local nodes = nodes
-local node = node
-
-local is_node = nodes.is_node
+local isnode = nodes.isnode
local nodecodes = nodes.nodecodes
local subtcodes = nodes.codes
local getfields = nodes.fields
-
local tonode = nodes.tonode
local tonut = nodes.tonut
@@ -130,7 +127,7 @@ end
nodes.astable = astable
-setinspector("node",function(v) if is_node(v) then printtable(astable(v),tostring(v)) return true end end)
+setinspector("node",function(v) if isnode(v) then printtable(astable(v),tostring(v)) return true end end)
-- under construction:
diff --git a/tex/context/base/mkiv/node-shp.lua b/tex/context/base/mkiv/node-shp.lua
index 58dc94495..b867f564a 100644
--- a/tex/context/base/mkiv/node-shp.lua
+++ b/tex/context/base/mkiv/node-shp.lua
@@ -121,7 +121,7 @@ local removables = {
--
-- handlers.cleanuppage = cleanup_redundant -- nut
-handlers.cleanuppage = nuts.flatten_discretionaries
+handlers.cleanuppage = nuts.flattendiscretionaries
local function cleanup_flushed(head) -- rough
local start = head
diff --git a/tex/context/base/mkiv/node-syn.lua b/tex/context/base/mkiv/node-syn.lua
index d9c653abb..d2eec6714 100644
--- a/tex/context/base/mkiv/node-syn.lua
+++ b/tex/context/base/mkiv/node-syn.lua
@@ -159,8 +159,8 @@ local fontkern_code = kerncodes.fontkern
local cancel_code = nodes.dircodes.cancel
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local nodepool = nuts.pool
local new_latelua = nodepool.latelua
@@ -170,7 +170,7 @@ local new_kern = nodepool.kern
local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
-local getsynctexfields = nuts.getsynctexfields or nuts.get_synctex_fields
+local getsynctexfields = nuts.getsynctexfields
local forcesynctextag = tex.forcesynctextag or tex.force_synctex_tag
local forcesynctexline = tex.forcesynctexline or tex.force_synctex_line
local getsynctexline = tex.getsynctexline or tex.get_synctex_line
@@ -391,27 +391,27 @@ end
-- end
--
-- local function b_vlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_vlist,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_vlist,t,l,w,h,d) end))
-- end
--
-- local function b_hlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_hlist,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_hlist,t,l,w,h,d) end))
-- end
--
-- local function e_vlist(head,current)
--- return insert_after(head,current,new_latelua(noaction(s_vlist)))
+-- return insertafter(head,current,new_latelua(noaction(s_vlist)))
-- end
--
-- local function e_hlist(head,current)
--- return insert_after(head,current,new_latelua(noaction(s_hlist)))
+-- return insertafter(head,current,new_latelua(noaction(s_hlist)))
-- end
--
-- local function x_vlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_vlist_1,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_vlist_1,t,l,w,h,d) end))
-- end
--
-- local function x_hlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_hlist_1,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_hlist_1,t,l,w,h,d) end))
-- end
--
-- generic
@@ -466,7 +466,7 @@ local x_hlist do
x_hlist = function(head,current,t,l,w,h,d)
if filehandle then
- return insert_before(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+ return insertbefore(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
else
return head
end
@@ -502,8 +502,8 @@ local function inject(head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
@@ -569,8 +569,8 @@ local function inject(parent,head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
diff --git a/tex/context/base/mkiv/node-tra.lua b/tex/context/base/mkiv/node-tra.lua
index 83c072c19..d3d35dae0 100644
--- a/tex/context/base/mkiv/node-tra.lua
+++ b/tex/context/base/mkiv/node-tra.lua
@@ -50,8 +50,6 @@ local getglue = nuts.getglue
local isglyph = nuts.isglyph
local getdirection = nuts.getdirection
local getwidth = nuts.getwidth
-
-local flush_list = nuts.flush_list
local count_nodes = nuts.countall
local used_nodes = nuts.usedlist
@@ -83,7 +81,7 @@ local whatsit_code = nodecodes.whatsit
local dimenfactors = number.dimenfactors
local formatters = string.formatters
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
-- this will be reorganized:
@@ -154,7 +152,7 @@ local function tosequence(start,stop,compact)
elseif id == dir_code then
local d, p = getdirection(start)
n = n + 1 ; t[n] = "[<" .. (p and "-" or "+") .. d .. ">]" -- todo l2r etc
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
n = n + 1 ; t[n] = "[<" .. getdirection(start) .. ">]" -- todo l2r etc
elseif compact then
n = n + 1 ; t[n] = "[]"
diff --git a/tex/context/base/mkiv/node-typ.lua b/tex/context/base/mkiv/node-typ.lua
index 2f00c9413..f1eceb8f3 100644
--- a/tex/context/base/mkiv/node-typ.lua
+++ b/tex/context/base/mkiv/node-typ.lua
@@ -32,13 +32,10 @@ local new_glue = nodepool.glue
local utfvalues = utf.values
-local currentfont = font.current -- mabe nicer is fonts .current
-local currentattributes = node.current_attributes -- mabe nicer is attributes.current
-
+local currentfont = font.current
+local currentattributes = nodes.currentattributes
local fontparameters = fonts.hashes.parameters
-if not currentattributes then currentattributes = node.current_attr end -- CONTEXTLMTXMODE == 0
-
-- when attrid == true then take from glyph or current else use the given value
local function tonodes(str,fontid,spacing,templateglyph,attrid) -- quick and dirty
@@ -133,9 +130,9 @@ typesetters.hpack = typesetters.tohpack -- obsolete
typesetters.hbox = typesetters.tohbox -- obsolete
typesetters.vpack = typesetters.tovpack -- obsolete
--- node.write(nodes.typesetters.tohpack("Hello World!"))
--- node.write(nodes.typesetters.tohbox ("Hello World!"))
--- node.write(nodes.typesetters.tohpack("Hello World!",1,100*1024*10))
--- node.write(nodes.typesetters.tohbox ("Hello World!",1,100*1024*10))
+-- context(nodes.typesetters.tohpack("Hello World!"))
+-- context(nodes.typesetters.tohbox ("Hello World!"))
+-- context(nodes.typesetters.tohpack("Hello World!",1,100*1024*10))
+-- context(nodes.typesetters.tohbox ("Hello World!",1,100*1024*10))
string.tonodes = function(...) return tonode(tonodes(...)) end -- quite convenient
diff --git a/tex/context/base/mkiv/pack-rul.lua b/tex/context/base/mkiv/pack-rul.lua
index 8e410f0cf..98117867c 100644
--- a/tex/context/base/mkiv/pack-rul.lua
+++ b/tex/context/base/mkiv/pack-rul.lua
@@ -57,7 +57,7 @@ local getboxglue = nuts.getboxglue
local hpack = nuts.hpack
local getdimensions = nuts.dimensions
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local traversers = nuts.traversers
local nexthlist = traversers.hlist
@@ -131,7 +131,7 @@ local function doreshapeframedbox(n)
local set, order, sign = getboxglue(p)
setboxglue(h,set,order,sign)
setlist(p)
- flush_node(p)
+ flushnode(p)
elseif checkformath and subtype == equationlist_code then
-- display formulas use a shift
if nofnonzero == 1 then
@@ -165,7 +165,7 @@ local function doreshapeframedbox(n)
texsetdimen("global","framedaveragewidth",averagewidth)
end
-local function doanalyzeframedbox(n) -- traverse_list
+local function doanalyzeframedbox(n)
local box = getbox(n)
local noflines = 0
local firstheight = nil
diff --git a/tex/context/base/mkiv/page-cst.lua b/tex/context/base/mkiv/page-cst.lua
index a6315ff05..5106f1fef 100644
--- a/tex/context/base/mkiv/page-cst.lua
+++ b/tex/context/base/mkiv/page-cst.lua
@@ -37,8 +37,7 @@ local tonode = nuts.tonode
local tonut = nuts.tonut
local vpack = nuts.vpack
-local flushlist = nuts.flush_list
------ removenode = nuts.remove
+local flushlist = nuts.flushlist
local setlink = nuts.setlink
local setlist = nuts.setlist
@@ -62,7 +61,7 @@ local takebox = nuts.takebox
local takelist = nuts.takelist
local splitbox = nuts.splitbox
local getattribute = nuts.getattribute
-local copylist = nuts.copy_list
+local copylist = nuts.copylist
local getbox = nuts.getbox
local getcount = tex.getcount
diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua
index 924e01b2a..bcabc0d6b 100644
--- a/tex/context/base/mkiv/page-ini.lua
+++ b/tex/context/base/mkiv/page-ini.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['page-ini'] = {
license = "see context related readme files"
}
+-- Some day I need to make this more efficient.
+
local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
local match = string.match
local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys
@@ -13,7 +15,12 @@ local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array,
local texgetcount = tex.getcount
+local tonut = nodes.tonut
+local nextlist = nodes.nuts.traversers.list
+local texlists = tex.lists
+
local context = context
+local ctx_doif = commands.doif
local ctx_doifelse = commands.doifelse
local implement = interfaces.implement
@@ -23,16 +30,22 @@ local last = 0
local pages = structures.pages
local autolist = { }
local report = logs.reporter("pages","mark")
+local active = false
local trace = false trackers.register("pages.mark",function(v) trace = v end)
-function pages.mark(name,list)
+function pages.mark(name,list,settings)
+ active = true
+ --
local realpage = texgetcount("realpageno")
+ if type(settings) == "string" then
+ settings = settings_to_hash(settings)
+ end
if not list or list == "" then
if trace then
report("marking current page %i as %a",realpage,name)
end
- data[realpage][name] = true
+ data[realpage][name] = settings or true
return
end
if type(list) == "string" then
@@ -51,7 +64,7 @@ function pages.mark(name,list)
report("marking page %i upto %i as %a",f,t,name)
end
for page=f,t do
- data[page][name] = true
+ data[page][name] = settings or true
end
end
page = false
@@ -74,7 +87,7 @@ function pages.mark(name,list)
if trace then
report("marking page %i as %a",page,name)
end
- data[page][name] = true
+ data[page][name] = settings or true
end
end
end
@@ -83,30 +96,51 @@ function pages.mark(name,list)
if trace then
report("marking current page %i as %a",realpage,name)
end
- data[realpage][name] = true
+ data[realpage][name] = settings or true
end
end
local tobemarked = { }
function pages.markedlist(realpage)
- if realpage then
+ if active and realpage then
local m = rawget(tobemarked,realpage) or rawget(data,realpage)
return m and next(m) and sortedkeys(m)
end
end
local function marked(name)
- local realpage = texgetcount("realpageno")
- for i=last,realpage-1 do
- local di = data[i]
- if di then
- tobemarked[i] = di
- rawset(data,i,nil)
+ if active then
+ local realpage = texgetcount("realpageno")
+ if last ~= 0 then
+ for i=last,realpage-1 do
+ -- print(last)
+ local di = data[i]
+ if di then
+ tobemarked[i] = di
+ rawset(data,i,nil)
+ end
+ end
+ last = 0 -- needs checking
+ end
+ local pagedata = rawget(data,realpage)
+ return pagedata and pagedata[name] and true or false
+ else
+ return false
+ end
+end
+
+local function markedparameter(name,key)
+ if active then
+ local pagedata = rawget(data,texgetcount("realpageno"))
+ if pagedata then
+ pagedata = pagedata[name]
+ if pagedata then
+ pagedata = pagedata[key]
+ end
end
+ return pagedata
end
- local pagedata = rawget(data,realpage)
- return pagedata and pagedata[name] and true or false
end
local function toranges(marked)
@@ -124,12 +158,14 @@ local function toranges(marked)
last = page
end
list[#list+1] = { first, last }
+ --
+ active = true
end
return list
end
local function allmarked(list)
- if list then
+ if active and list then
local collected = pages.collected
if collected then
if type(list) == "string" then
@@ -175,26 +211,77 @@ pages.allmarked = allmarked
-- An alternative is to use an attribute and identify the state by parsing the node
-- list but that's a bit overkill for a hardly used feature like this.
-luatex.registerpageactions(function()
+-- Page actions are bound to a real page. When we set one, we need to bind to the
+-- current page unless we just flushed. So we also need to check the current page.
+
+-- \page ... \start : sync realpage
+-- \page \start : sync realpage
+-- \page \stop : reset synced because no content yet
+-- \page ... \stop : keep sync
+
+local function autopageaction()
+ if active then
+ local nofauto = #autolist
+ if nofauto > 0 then
+ local realpage = texgetcount("realpageno")
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ local settings = entry[2]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if not list[name] then
+ if trace then
+ report("automatically marking page %i as %a",realpage,name)
+ end
+ list[name] = settings or true
+ end
+ end
+ end
+ end
+ end
+end
+
+local function startmarked(name,settings)
+ active = true
+ --
+ insert(autolist, { settings_to_array(name), settings_to_hash(settings) })
+ autopageaction(true)
+end
+
+local function stopmarked()
local nofauto = #autolist
if nofauto > 0 then
- local realpage = texgetcount("realpageno")
- for i=1,nofauto do
- local names = autolist[i]
- for j=1,#names do
- local name = names[j]
- data[realpage][name] = true
- if trace then
- report("automatically marking page %i as %a",realpage,name)
+ if not texlists.pagehead then
+ local realpage = texgetcount("realpageno")
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if list[name] then
+ if trace then
+ report("automatically unmarking page %i as %a",realpage,name)
+ end
+ list[name] = nil
+ end
end
end
end
+ remove(autolist)
end
-end)
+end
+
+implement {
+ name = "checkmarkedpages",
+ actions = autopageaction,
+}
implement {
name = "markpage",
- arguments = "2 strings",
+ arguments = "3 strings",
actions = pages.mark
}
@@ -205,6 +292,23 @@ implement {
}
implement {
+ name = "doifmarkedpage",
+ arguments = "string",
+ actions = { marked, ctx_doif }
+}
+
+implement {
+ name = "markedpageparameter",
+ arguments = "strings",
+ actions = function(name,key)
+ local value = markedparameter(name,key)
+ if value then
+ context(value)
+ end
+ end
+}
+
+implement {
name = "markedpages",
arguments = "string",
actions = function(name)
@@ -217,20 +321,13 @@ implement {
implement {
name = "startmarkpages",
- arguments = "string",
- actions = function(name)
- insert(autolist,settings_to_array(name))
- end
+ arguments = "2 strings",
+ actions = startmarked,
}
implement {
- name = "stopmarkpages",
- arguments = "string",
- actions = function(name)
- if #autolist > 0 then
- remove(autolist)
- end
- end
+ name = "stopmarkpages",
+ actions = stopmarked,
}
local tonut = nodes.tonut
diff --git a/tex/context/base/mkiv/page-ini.mkiv b/tex/context/base/mkiv/page-ini.mkiv
index e56c3ac04..0c444ffc2 100644
--- a/tex/context/base/mkiv/page-ini.mkiv
+++ b/tex/context/base/mkiv/page-ini.mkiv
@@ -333,10 +333,10 @@
\installcorenamespace{markedpage}
\unexpanded\def\markpage
- {\dodoubleempty\page_mark}
+ {\dotripleempty\page_mark}
-\def\page_mark[#1][#2]%
- {\clf_markpage{#1}{#2}}
+\def\page_mark[#1][#2][#3]%
+ {\clf_markpage{#1}{#2}{#3}}
\def\markedpages[#1]% expandable
{\clf_markedpages{#1}}
@@ -344,12 +344,28 @@
\unexpanded\def\doifelsemarkedpage#1%
{\clf_doifelsemarkedpage{#1}}
-\unexpanded\def\startmarkpages[#1]%
- {\clf_startmarkpages{#1}}
+\unexpanded\def\doifmarkedpage#1%
+ {\clf_doifmarkedpage{#1}}
+
+\unexpanded\def\startmarkpages
+ {\dodoubleempty\page_start_marked}
+
+\def\page_start_marked[#1][#2]%
+ {\clf_startmarkpages{#1}{#2}}
\unexpanded\def\stopmarkpages
{\clf_stopmarkpages}
+\unexpanded\def\checkmarkedpages
+ {\clf_checkmarkedpages}
+
+\def\markedpageparameter#1#2%
+ {\clf_markedpageparameter{#1}{#2}}
+
+\appendtoks
+ \checkmarkedpages
+\to \everyaftershipout
+
%D Experimental:
\newconstant\c_page_force_strut_depth_trace_mode
diff --git a/tex/context/base/mkiv/page-mix.lua b/tex/context/base/mkiv/page-mix.lua
index c1f93b4bb..443f25e56 100644
--- a/tex/context/base/mkiv/page-mix.lua
+++ b/tex/context/base/mkiv/page-mix.lua
@@ -61,7 +61,7 @@ local getid = nuts.getid
local getlist = nuts.getlist
local getsubtype = nuts.getsubtype
local getbox = nuts.getbox
-local getattribute = nuts.getattribute
+local getattr = nuts.getattr
local getwhd = nuts.getwhd
local getkern = nuts.getkern
local getpenalty = nuts.getpenalty
@@ -589,7 +589,7 @@ local function preparesplit(specification) -- a rather large function
if penalty == 0 then
unlock(2,penalty)
elseif penalty == forcedbreak then
- local needed = getattribute(current,a_checkedbreak)
+ local needed = getattr(current,a_checkedbreak)
local proceed = not needed or needed == 0
if not proceed then
local available = target - height
diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv
index e38ad7406..2bca9cbf5 100644
--- a/tex/context/base/mkiv/page-mix.mkiv
+++ b/tex/context/base/mkiv/page-mix.mkiv
@@ -31,10 +31,6 @@
% offsets (inner ones, so we change the hsize ... needed with backgrounds
% when no content we currently loose the page
-% luatex buglet:
-%
-% \ctxlua{tex.setbox("global",0,node.hpack(nodes.pool.glyph("a",font.current())))}\box0
-
\registerctxluafile{page-mix}{}
\unprotect
diff --git a/tex/context/base/mkiv/page-str.lua b/tex/context/base/mkiv/page-str.lua
index 73f1782d0..e136a38b4 100644
--- a/tex/context/base/mkiv/page-str.lua
+++ b/tex/context/base/mkiv/page-str.lua
@@ -24,8 +24,8 @@ local nuts = nodes.nuts
local tonut = nodes.tonut
local slide_node_list = nuts.slide
local write_node = nuts.write
-local flush_node = nuts.flush
-local copy_node_list = nuts.copy_list
+local flushnode = nuts.flush
+local copy_node_list = nuts.copylist
local vpack_node_list = nuts.vpack
local getbox = nuts.getbox
@@ -146,7 +146,7 @@ function streams.flush(name,copy) -- problem: we need to migrate afterwards
if di then
write_node(getlist(di)) -- list, will be option
setlist(di)
- flush_node(di)
+ flushnode(di)
end
end
end
@@ -237,7 +237,7 @@ function streams.synchronize(list) -- this is an experiment !
end
dana[m] = vpack_node_list(getlist(vbox))
setlist(vbox)
- flush_node(vbox)
+ flushnode(vbox)
if trace_flushing then
report_streams("slot %s:%s with delta (%p,%p) is compensated by %s lines",m,i,delta_height,delta_depth,n)
end
diff --git a/tex/context/base/mkiv/scrn-hlp.lua b/tex/context/base/mkiv/scrn-hlp.lua
index 8f6f6f746..a11ad48d2 100644
--- a/tex/context/base/mkiv/scrn-hlp.lua
+++ b/tex/context/base/mkiv/scrn-hlp.lua
@@ -18,8 +18,8 @@ local formatters = string.formatters
local a_help = attributes.private("help")
-local copy_node_list = node.copy_list
-local hpack_node_list = node.hpack
+local copy_node_list = nodes.copylist
+local hpack_node_list = nodes.hpack
local register_list = nodes.pool.register
diff --git a/tex/context/base/mkiv/scrp-cjk.lua b/tex/context/base/mkiv/scrp-cjk.lua
index 9e6e24f4d..541ea9f81 100644
--- a/tex/context/base/mkiv/scrp-cjk.lua
+++ b/tex/context/base/mkiv/scrp-cjk.lua
@@ -17,54 +17,54 @@ if not modules then modules = { } end modules ['scrp-cjk'] = {
-- endofline turned into spaces (would not make sense either because otherwise a
-- wanted space at the end of a line would have to be a hard coded ones.
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local copy_node = nuts.copy
-local remove_node = nuts.remove
-local nextglyph = nuts.traversers.glyph
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+local copy_node = nuts.copy
+local remove_node = nuts.remove
+local nextglyph = nuts.traversers.glyph
-local getnext = nuts.getnext
-local getprev = nuts.getprev
-local getfont = nuts.getfont
-local getchar = nuts.getchar
-local getid = nuts.getid
-local getsubtype = nuts.getsubtype
-local getwidth = nuts.getwidth
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getwidth = nuts.getwidth
-local setchar = nuts.setchar
+local setchar = nuts.setchar
-local nodepool = nuts.pool
-local new_glue = nodepool.glue
-local new_kern = nodepool.kern
-local new_penalty = nodepool.penalty
+local nodepool = nuts.pool
+local new_glue = nodepool.glue
+local new_kern = nodepool.kern
+local new_penalty = nodepool.penalty
-local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
+local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
-local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
-local userskip_code = gluecodes.userskip
-local spaceskip_code = gluecodes.spaceskip
-local xspaceskip_code = gluecodes.xspaceskip
+local userskip_code = gluecodes.userskip
+local spaceskip_code = gluecodes.spaceskip
+local xspaceskip_code = gluecodes.xspaceskip
-local hash = scripts.hash
+local hash = scripts.hash
-local getscriptstatus = scripts.getstatus
-local getscriptdata = scripts.getdata
-local scriptcolors = scripts.colors
+local getscriptstatus = scripts.getstatus
+local getscriptdata = scripts.getdata
+local scriptcolors = scripts.colors
-local fonthashes = fonts.hashes
-local quaddata = fonthashes.quads
-local spacedata = fonthashes.spaces
+local fonthashes = fonts.hashes
+local quaddata = fonthashes.quads
+local spacedata = fonthashes.spaces
-local decomposed = characters.hangul.decomposed
+local decomposed = characters.hangul.decomposed
-local trace_details = false trackers.register("scripts.details", function(v) trace_details = v end)
+local trace_details = false trackers.register("scripts.details", function(v) trace_details = v end)
-local report_details = logs.reporter("scripts","detail")
+local report_details = logs.reporter("scripts","detail")
-- raggedleft is controlled by leftskip and we might end up with a situation where
-- the intercharacter spacing interferes with this; the solution is to patch the
@@ -133,206 +133,206 @@ local function nobreak(head,current)
if trace_details then
trace_detail(current,"break")
end
- insert_node_before(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_penalty(10000))
end
local function stretch_break(head,current)
if trace_details then
trace_detail(current,"stretch break")
end
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function shrink_break(head,current)
if trace_details then
trace_detail(current,"shrink break")
end
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"no break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function korean_break(head,current)
if trace_details then
trace_detail(current,"korean break")
end
- insert_node_before(head,current,new_penalty(inter_char_hangul_penalty))
+ insertnodebefore(head,current,new_penalty(inter_char_hangul_penalty))
end
local function nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_shrink_nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak shrink nobreak stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_autoshrink_nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink nobreak stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_shrink_break_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_autoshrink_break_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_shrink_break_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function japanese_between_full_close_open(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese between full close open")
end
- insert_node_before(head,current,new_kern(-half_char_width))
- insert_node_before(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
- insert_node_before(head,current,new_kern(-half_char_width))
+ insertnodebefore(head,current,new_kern(-half_char_width))
+ insertnodebefore(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_kern(-half_char_width))
end
local function japanese_between_full_close_full_close(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese between full close full close")
end
- insert_node_before(head,current,new_kern(-half_char_width))
- -- insert_node_before(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_kern(-half_char_width))
+ -- insertnodebefore(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
end
local function japanese_before_full_width_punct(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese before full width punct")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
- insert_node_before(head,current,new_kern(-quarter_char_width))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
+ insertnodebefore(head,current,new_kern(-quarter_char_width))
end
local function japanese_after_full_width_punct(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese after full width punct")
end
- insert_node_before(head,current,new_kern(-quarter_char_width))
- insert_node_before(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
+ insertnodebefore(head,current,new_kern(-quarter_char_width))
+ insertnodebefore(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
end
local function nobreak_autoshrink_break_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_autoshrink_break_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_shrink_break_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_stretch_break_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch break shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_break_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch break autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
-- Korean: hangul
@@ -535,11 +535,11 @@ function scripts.decomposehangul(head)
setchar(current,lead_consonant)
local m = copy_node(current)
setchar(m,medial_vowel)
- head, current = insert_node_after(head,current,m)
+ head, current = insertnodeafter(head,current,m)
if tail_consonant then
local t = copy_node(current)
setchar(t,tail_consonant)
- head, current = insert_node_after(head,current,t)
+ head, current = insertnodeafter(head,current,t)
end
done = true
end
@@ -961,7 +961,7 @@ local function process(head,first,last)
end
previous = current
-- elseif id == math_code then
- -- upcoming = getnext(end_of_math(current))
+ -- upcoming = getnext(endofmath(current))
-- previous = "start"
else -- glue
local p = getprev(first)
diff --git a/tex/context/base/mkiv/scrp-ini.lua b/tex/context/base/mkiv/scrp-ini.lua
index ab6fca4db..0fafd9854 100644
--- a/tex/context/base/mkiv/scrp-ini.lua
+++ b/tex/context/base/mkiv/scrp-ini.lua
@@ -23,68 +23,68 @@ local report_preprocessing = logs.reporter("scripts","preprocessing")
local report_splitting = logs.reporter("scripts","splitting")
-local attributes = attributes
-local nodes = nodes
-local context = context
+local attributes = attributes
+local nodes = nodes
+local context = context
-local nodecodes = nodes.nodecodes
+local nodecodes = nodes.nodecodes
-local implement = interfaces.implement
+local implement = interfaces.implement
-local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
-local emwidths = fonts.hashes.emwidths
-local exheights = fonts.hashes.exheights
+local emwidths = fonts.hashes.emwidths
+local exheights = fonts.hashes.exheights
-local a_script = attributes.private('script')
+local a_script = attributes.private('script')
-local fontdata = fonts.hashes.identifiers
-local allocate = utilities.storage.allocate
-local setnodecolor = nodes.tracers.colors.set
+local fontdata = fonts.hashes.identifiers
+local allocate = utilities.storage.allocate
+local setnodecolor = nodes.tracers.colors.set
-local enableaction = nodes.tasks.enableaction
-local disableaction = nodes.tasks.disableaction
+local enableaction = nodes.tasks.enableaction
+local disableaction = nodes.tasks.disableaction
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getchar = nuts.getchar
-local getfont = nuts.getfont
-local getid = nuts.getid
-local getglyphdata = nuts.getglyphdata
-local setglyphdata = nuts.setglyphdata
+local getnext = nuts.getnext
+local getchar = nuts.getchar
+local getfont = nuts.getfont
+local getid = nuts.getid
+local getglyphdata = nuts.getglyphdata
+local setglyphdata = nuts.setglyphdata
-local isglyph = nuts.isglyph
+local isglyph = nuts.isglyph
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
-local first_glyph = nuts.first_glyph
+local firstglyph = nuts.firstglyph
-local nextglyph = nuts.traversers.glyph
-local nextchar = nuts.traversers.char
+local nextglyph = nuts.traversers.glyph
+local nextchar = nuts.traversers.char
-local nodepool = nuts.pool
+local nodepool = nuts.pool
-local new_glue = nodepool.glue
-local new_rule = nodepool.rule
-local new_penalty = nodepool.penalty
+local new_glue = nodepool.glue
+local new_rule = nodepool.rule
+local new_penalty = nodepool.penalty
-scripts = scripts or { }
-local scripts = scripts
+scripts = scripts or { }
+local scripts = scripts
-scripts.hash = scripts.hash or { }
-local hash = scripts.hash
+scripts.hash = scripts.hash or { }
+local hash = scripts.hash
-local handlers = allocate()
-scripts.handlers = handlers
+local handlers = allocate()
+scripts.handlers = handlers
-local injectors = allocate()
-scripts.injectors = handlers
+local injectors = allocate()
+scripts.injectors = handlers
-local splitters = allocate()
-scripts.splitters = splitters
+local splitters = allocate()
+scripts.splitters = splitters
-- we need to fake it in luatex
@@ -511,7 +511,7 @@ local function traced_process(head,first,last,process,a)
end
function scripts.injectors.handler(head)
- local start = first_glyph(head) -- we already have glyphs here (subtype 1)
+ local start = firstglyph(head) -- we already have glyphs here (subtype 1)
if not start then
return head
else
@@ -791,7 +791,7 @@ end
local tree, attr, proc
-function splitters.handler(head) -- todo: also first_glyph test
+function splitters.handler(head) -- todo: also firstglyph test
local current = head
while current do
if getid(current) == glyph_code then
@@ -848,9 +848,9 @@ end
local function marker(head,current,font,color) -- could become: nodes.tracers.marker
local ex = exheights[font]
local em = emwidths [font]
- head, current = insert_node_after(head,current,new_penalty(10000))
- head, current = insert_node_after(head,current,new_glue(-0.05*em))
- head, current = insert_node_after(head,current,new_rule(0.05*em,1.5*ex,0.5*ex))
+ head, current = insertnodeafter(head,current,new_penalty(10000))
+ head, current = insertnodeafter(head,current,new_glue(-0.05*em))
+ head, current = insertnodeafter(head,current,new_rule(0.05*em,1.5*ex,0.5*ex))
setnodecolor(current,color)
return head, current
end
@@ -871,7 +871,7 @@ function splitters.insertafter(handler,head,first,last,detail)
if ignore then
return head, last
else
- return insert_node_after(head,last,new_glue(0,last_s))
+ return insertnodeafter(head,last,new_glue(0,last_s))
end
end
@@ -1046,30 +1046,30 @@ do
scripts.inserters = {
space_before = function(head,current)
- return insert_node_before(head,current,space_glue(current))
+ return insertnodebefore(head,current,space_glue(current))
end,
space_after = function(head,current)
- return insert_node_after(head,current,space_glue(current))
+ return insertnodeafter(head,current,space_glue(current))
end,
zerowidthspace_before = function(head,current)
- return insert_node_before(head,current,new_glue(0))
+ return insertnodebefore(head,current,new_glue(0))
end,
zerowidthspace_after = function(head,current)
- return insert_node_after(head,current,new_glue(0))
+ return insertnodeafter(head,current,new_glue(0))
end,
nobreakspace_before = function(head,current)
local g = space_glue(current)
local p = new_penalty(10000)
- head, current = insert_node_before(head,current,p)
- return insert_node_before(head,current,g)
+ head, current = insertnodebefore(head,current,p)
+ return insertnodebefore(head,current,g)
end,
nobreakspace_after = function(head,current)
local g = space_glue(current)
local p = new_penalty(10000)
- head, current = insert_node_after(head,current,g)
- return insert_node_after(head,current,p)
+ head, current = insertnodeafter(head,current,g)
+ return insertnodeafter(head,current,p)
end,
}
diff --git a/tex/context/base/mkiv/spac-ali.lua b/tex/context/base/mkiv/spac-ali.lua
index 2e2650f3b..448b0162b 100644
--- a/tex/context/base/mkiv/spac-ali.lua
+++ b/tex/context/base/mkiv/spac-ali.lua
@@ -68,7 +68,7 @@ local nofrealigned = 0
-- raggedright 0 0 fil
-- raggedcenter 0 + 0 + -
-local function handler(head,leftpage,realpageno) -- traverse_list
+local function handler(head,leftpage,realpageno) -- traverselist
local current = head
while current do
local id = getid(current)
diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua
index 7ec3e3cc4..233552460 100644
--- a/tex/context/base/mkiv/spac-chr.lua
+++ b/tex/context/base/mkiv/spac-chr.lua
@@ -42,11 +42,9 @@ local isglyph = nuts.isglyph
local setcolor = nodes.tracers.colors.set
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglyph = nuts.traversers.glyph
@@ -95,7 +93,7 @@ local function inject_quad_space(unicode,head,current,fraction)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_char_space(unicode,head,current,parent)
@@ -105,7 +103,7 @@ local function inject_char_space(unicode,head,current,parent)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_nobreak_space(unicode,head,current,space,spacestretch,spaceshrink)
@@ -114,17 +112,17 @@ local function inject_nobreak_space(unicode,head,current,space,spacestretch,spac
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode) -- bombs
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,penalty)
if trace_nbsp then
local rule = new_rule(space)
local kern = new_kern(-space)
local penalty = new_penalty(10000)
setcolor(rule,"orange")
- head, current = insert_node_after(head,current,rule)
- head, current = insert_node_after(head,current,kern)
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,rule)
+ head, current = insertnodeafter(head,current,kern)
+ head, current = insertnodeafter(head,current,penalty)
end
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function nbsp(head,current)
@@ -148,7 +146,7 @@ end
function characters.replacenbspaces(head)
local wipe = false
- for current, char, font in nextglyph, head do -- can be anytime so no traverse_char
+ for current, char, font in nextglyph, head do -- can be anytime so no traversechar
if char == 0x00A0 then
if wipe then
head = remove_node(h,current,true)
@@ -192,7 +190,7 @@ local methods = {
head, current = remove_node(head,current,true)
if not is_punctuation[char] then
local p = fontparameters[font]
- head, current = insert_node_before(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
+ head, current = insertnodebefore(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
end
end
end
@@ -226,7 +224,7 @@ local methods = {
end,
[0x00AD] = function(head,current) -- softhyphen
- return insert_node_after(head,current,languages.explicithyphen(current))
+ return insertnodeafter(head,current,languages.explicithyphen(current))
end,
[0x2000] = function(head,current) -- enquad
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index efa1dd967..5ab8196c8 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -148,14 +148,15 @@ local setdepth = nuts.setdepth
local getdepth = nuts.getdepth
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local flushnode = nuts.flushnode
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local remove_node = nuts.remove
local count_nodes = nuts.countall
local hpack_node = nuts.hpack
local vpack_node = nuts.vpack
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nexthlist = nuts.traversers.hlist
@@ -293,7 +294,7 @@ end
local function validvbox(parentid,list)
if parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not next then
return nil
@@ -329,7 +330,7 @@ local function already_done(parentid,list,a_snapmethod) -- todo: done when only
-- problem: any snapped vbox ends up in a line
if list and parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not list then
return false
@@ -1021,14 +1022,14 @@ do
if width == 0 then
-- do nothing
elseif where == "after" then
- head, current = insert_node_after(head,current,new_rule(w,h,d))
- head, current = insert_node_after(head,current,new_kern(width))
- head, current = insert_node_after(head,current,new_rule(w,h,d))
+ head, current = insertnodeafter(head,current,new_rule(w,h,d))
+ head, current = insertnodeafter(head,current,new_kern(width))
+ head, current = insertnodeafter(head,current,new_rule(w,h,d))
else
local c = current
- head, current = insert_node_before(head,current,new_rule(w,h,d))
- head, current = insert_node_before(head,current,new_kern(width))
- head, current = insert_node_before(head,current,new_rule(w,h,d))
+ head, current = insertnodebefore(head,current,new_rule(w,h,d))
+ head, current = insertnodebefore(head,current,new_kern(width))
+ head, current = insertnodebefore(head,current,new_rule(w,h,d))
current = c
end
if trace then
@@ -1203,10 +1204,10 @@ do
texsetdimen("global","d_spac_overlay",-delta) -- for tracing
-- we should adapt pagetotal ! (need a hook for that) .. now we have the wrong pagebreak
local k = new_kern(-delta)
- head = insert_node_before(head,n,k)
+ head = insertnodebefore(head,n,k)
if n_ht > p_ht then
local k = new_kern(n_ht-p_ht)
- head = insert_node_before(head,p,k)
+ head = insertnodebefore(head,p,k)
end
if trace_vspacing then
report_vspacing("overlaying, prev height: %p, prev depth: %p, next height: %p, skips: %p, move up: %p",p_ht,p_dp,n_ht,skips,delta)
@@ -1375,13 +1376,13 @@ do
if penalty_data >= 10000 then -- or whatever threshold?
local prev = getprev(current)
if getid(prev) == glue_code then -- maybe go back more, or maybe even push back before any glue
- -- tricky case: spacing/grid-007.tex: glue penalty glue
- head = insert_node_before(head,prev,p)
+ -- tricky case: spacing/grid-007.tex: glue penalty glue
+ head = insertnodebefore(head,prev,p)
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
-- if penalty_data > special_penalty_min and penalty_data < special_penalty_max then
local props = properties[p]
@@ -1400,22 +1401,22 @@ do
trace_done("flushed due to forced " .. why,glue_data)
end
head = forced_skip(head,current,getwidth(glue_data,width),"before",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
else
local width, stretch, shrink = getglue(glue_data)
if width ~= 0 then
if trace then
trace_done("flushed due to non zero " .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
elseif stretch ~= 0 or shrink ~= 0 then
if trace then
trace_done("flushed due to stretch/shrink in" .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
else
-- report_vspacing("needs checking (%s): %p",gluecodes[getsubtype(glue_data)],w)
- flush_node(glue_data)
+ flushnode(glue_data)
end
end
end
@@ -1545,7 +1546,7 @@ do
if trace then
trace_done("flush",glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
if trace then
trace_natural("natural",current)
end
@@ -1634,7 +1635,7 @@ do
trace_skip("force",sc,so,sp,current)
end
glue_order = so
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif glue_order == so then
-- is now exclusive, maybe support goback as combi, else why a set
@@ -1645,7 +1646,7 @@ do
if trace then
trace_skip("largest",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
else
if trace then
@@ -1657,7 +1658,7 @@ do
if trace then
trace_skip("goback",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == force then
-- last one counts, some day we can provide an accumulator and largest etc
@@ -1665,13 +1666,13 @@ do
if trace then
trace_skip("force",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == penalty then
if trace then
trace_skip("penalty",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
head, current = remove_node(head,current,true)
elseif sc == add then
@@ -1881,7 +1882,7 @@ do
end
if force_glue then
head, tail = forced_skip(head,tail,getwidth(glue_data),"after",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
elseif tail then
setlink(tail,glue_data)
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index ae7b876b7..461037595 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index e5e48e356..cd95f9e07 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/supp-box.lua b/tex/context/base/mkiv/supp-box.lua
index 4914b6818..4b9322ba7 100644
--- a/tex/context/base/mkiv/supp-box.lua
+++ b/tex/context/base/mkiv/supp-box.lua
@@ -7,8 +7,6 @@ if not modules then modules = { } end modules ['supp-box'] = {
license = "see context related readme files"
}
--- this is preliminary code, use insert_before etc
-
local report_hyphenation = logs.reporter("languages","hyphenation")
local tonumber, next, type = tonumber, next, type
@@ -69,15 +67,15 @@ local setshift = nuts.setshift
local setsplit = nuts.setsplit
local setattrlist = nuts.setattrlist
-local flush_node = nuts.flush_node
-local flush_list = nuts.flush_list
+local flushnode = nuts.flushnode
+local flushlist = nuts.flushlist
local copy_node = nuts.copy
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local find_tail = nuts.tail
local getdimensions = nuts.dimensions
local hpack = nuts.hpack
local vpack = nuts.vpack
-local traverse_id = nuts.traverse_id
+local traverseid = nuts.traverseid
local traverse = nuts.traverse
local free = nuts.free
local findtail = nuts.tail
@@ -118,7 +116,7 @@ local function hyphenatedlist(head,usecolor)
setlistcolor(post,"darkyellow")
end
if replace then
- flush_list(replace)
+ flushlist(replace)
end
setdisc(current)
if pre then
@@ -152,9 +150,9 @@ implement {
-- for n in nextdisc, tonut(head) do
-- local hyphen = getfield(n,"pre")
-- if hyphen then
--- flush_list(hyphen)
+-- flushlist(hyphen)
-- end
--- setfield(n,"pre",copy_list(pre))
+-- setfield(n,"pre",copylist(pre))
-- end
-- end
--
@@ -200,7 +198,7 @@ local function applytowords(current,doaction,noaction,nested)
local id = getid(current)
if id == glue_code then
if start then
- doaction(tonode(copy_list(start,current)))
+ doaction(tonode(copylist(start,current)))
start = nil
end
noaction(tonode(copy_node(current)))
@@ -214,7 +212,7 @@ local function applytowords(current,doaction,noaction,nested)
current = getnext(current)
end
if start then
- doaction(tonode(copy_list(start)))
+ doaction(tonode(copylist(start)))
end
end
@@ -348,7 +346,7 @@ implement {
else
tail = prev
end
- flush_node(temp)
+ flushnode(temp)
end
-- done
setnext(tail)
@@ -430,7 +428,7 @@ local function setboxtonaturalwd(n)
local old = takebox(n)
local new = hpack(getlist(old))
setlist(old,nil)
- flush_node(old)
+ flushnode(old)
setbox(n,new)
end
@@ -482,20 +480,20 @@ end
do
- local nuts = nodes.nuts
- local tonode = nuts.tonode
- local takebox = nuts.takebox
- local flush_list = nuts.flush_list
- local copy_list = nuts.copy_list
- local getwhd = nuts.getwhd
- local setbox = nuts.setbox
- local new_hlist = nuts.pool.hlist
-
- local boxes = { }
- nodes.boxes = boxes
- local cache = table.setmetatableindex("table")
- local report = logs.reporter("boxes","cache")
- local trace = false
+ local nuts = nodes.nuts
+ local tonode = nuts.tonode
+ local takebox = nuts.takebox
+ local flushlist = nuts.flushlist
+ local copylist = nuts.copylist
+ local getwhd = nuts.getwhd
+ local setbox = nuts.setbox
+ local new_hlist = nuts.pool.hlist
+
+ local boxes = { }
+ nodes.boxes = boxes
+ local cache = table.setmetatableindex("table")
+ local report = logs.reporter("boxes","cache")
+ local trace = false
trackers.register("nodes.boxes",function(v) trace = v end)
@@ -528,7 +526,7 @@ do
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -545,13 +543,13 @@ do
local c = cache[category]
local b = takebox(box)
if b then
- flush_list(b)
+ flushlist(b)
end
local b = c[name]
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -577,7 +575,7 @@ do
if name and name ~= "" then
local b = c[name]
if b then
- flush_list(b)
+ flushlist(b)
c[name] = false
end
if trace then
@@ -586,7 +584,7 @@ do
else
for k, b in next, c do
if b then
- flush_list(b)
+ flushlist(b)
end
end
cache[category] = { }
@@ -697,7 +695,7 @@ local function stripglue(list)
if first and first ~= list then
-- we have discardables
setsplit(getprev(first),first)
- flush_list(list)
+ flushlist(list)
list = first
done = true
end
@@ -714,7 +712,7 @@ local function stripglue(list)
end
if last ~= tail then
-- we have discardables
- flush_list(getnext(last))
+ flushlist(getnext(last))
setnext(last)
done = true
end
@@ -767,7 +765,7 @@ local function limitate(t) -- don't pack the result !
else
maxleft = maxleft - swidth
end
- for n in traverse_id(glue_code,list) do
+ for n in traverseid(glue_code,list) do
local width = getdimensions(list,n)
if width > maxleft then
if not last then
@@ -779,7 +777,7 @@ local function limitate(t) -- don't pack the result !
end
end
if last and maxright > 0 then
- for n in traverse_id(glue_code,last) do
+ for n in traverseid(glue_code,last) do
local width = getdimensions(n)
if width < maxright then
first = n
@@ -808,7 +806,7 @@ local function limitate(t) -- don't pack the result !
end
setlink(last,sentinel)
setprev(rest)
- flush_list(rest)
+ flushlist(rest)
end
end
end
diff --git a/tex/context/base/mkiv/syst-lua.lua b/tex/context/base/mkiv/syst-lua.lua
index 085f75eca..1bd20214a 100644
--- a/tex/context/base/mkiv/syst-lua.lua
+++ b/tex/context/base/mkiv/syst-lua.lua
@@ -17,18 +17,15 @@ local xcomplex = xcomplex or { }
local cmd = tokens.commands
-local scan_next = token.scan_next or token.get_next
-local scan_cmdchr = token.scan_cmdchr_expanded
+local scannext = token.scan_next or token.get_next
-local get_command = token.get_command
-local get_mode = token.get_mode
-local get_index = token.get_index
-local get_csname = token.get_csname
-local get_macro = token.get_macro
-
-local put_next = token.put_next
-
-local scan_token = token.scan_token or token.get_token
+local getcommand = token.get_command
+local getmode = token.get_mode
+local getindex = token.get_index
+local getcsname = token.get_csname
+local getmacro = token.get_macro
+local putnext = token.put_next
+local scantoken = token.scan_token or token.get_token
local getdimen = tex.getdimen
local getglue = tex.getglue
@@ -209,12 +206,12 @@ do
local w = 0
local r = 1
while true do
- local t = scan_next()
- local n = get_command(t)
+ local t = scannext()
+ local n = getcommand(t)
local c = cmd[n]
-- todo, helper: returns number
if c == "letter" then
- w = w + 1 ; word[w] = utfchar(get_mode(t))
+ w = w + 1 ; word[w] = utfchar(getmode(t))
else
if w > 0 then
local s = concat(word,"",1,w)
@@ -233,23 +230,23 @@ do
w = 0
end
if c == "other_char" then
- r = r + 1 ; result[r] = utfchar(get_mode(t))
+ r = r + 1 ; result[r] = utfchar(getmode(t))
elseif c == "spacer" then
-- r = r + 1 ; result[r] = " "
elseif c == "relax" then
break
elseif c == "assign_int" then
- r = r + 1 ; result[r] = getcount(get_index(t))
+ r = r + 1 ; result[r] = getcount(getindex(t))
elseif c == "assign_dimen" then
- r = r + 1 ; result[r] = getdimen(get_index(t))
+ r = r + 1 ; result[r] = getdimen(getindex(t))
elseif c == "assign_glue" then
- r = r + 1 ; result[r] = getglue(get_index(t))
+ r = r + 1 ; result[r] = getglue(getindex(t))
elseif c == "assign_toks" then
- r = r + 1 ; result[r] = gettoks(get_index(t))
+ r = r + 1 ; result[r] = gettoks(getindex(t))
elseif c == "char_given" or c == "math_given" or c == "xmath_given" then
- r = r + 1 ; result[r] = get_mode(t)
+ r = r + 1 ; result[r] = getmode(t)
elseif c == "last_item" then
- local n = get_csname(t)
+ local n = getcsname(t)
if n then
local s = gettex(n)
if s then
@@ -261,9 +258,9 @@ do
unexpected(c)
end
elseif c == "call" then
- local n = get_csname(t)
+ local n = getcsname(t)
if n then
- local s = get_macro(n)
+ local s = getmacro(n)
if s then
r = r + 1 ; result[r] = s
else
@@ -273,8 +270,8 @@ do
unexpected(c)
end
elseif c == "the" or c == "convert" or c == "lua_expandable_call" then
- put_next(t)
- scan_token() -- expands
+ putnext(t)
+ scantoken() -- expands
else
unexpected(c)
end
diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua
index c9dd1e4e5..32770141b 100644
--- a/tex/context/base/mkiv/tabl-xtb.lua
+++ b/tex/context/base/mkiv/tabl-xtb.lua
@@ -73,9 +73,9 @@ local setlink = nuts.setlink
local setdirection = nuts.setdirection
local setshift = nuts.setshift
-local copy_node_list = nuts.copy_list
-local hpack_node_list = nuts.hpack
-local flush_node_list = nuts.flush_list
+local copynodelist = nuts.copylist
+local hpacknodelist = nuts.hpack
+local flushnodelist = nuts.flushlist
local takebox = nuts.takebox
local nodepool = nuts.pool
@@ -273,7 +273,7 @@ function xtables.set_reflow_width()
local tb = getbox("b_tabl_x")
local drc = row[c]
--
- drc.list = true -- we don't need to keep the content around as we're in trial mode (no: copy_node_list(tb))
+ drc.list = true -- we don't need to keep the content around as we're in trial mode (no: copynodelist(tb))
--
local width, height, depth = getwhd(tb)
--
@@ -561,7 +561,7 @@ function xtables.reflow_width()
for c=1,nofcolumns do
local drc = row[c]
if drc.list then
- -- flush_node_list(drc.list)
+ -- flushnodelist(drc.list)
drc.list = false
end
end
@@ -853,7 +853,7 @@ function xtables.construct()
if list then
local w, h, d = getwhd(list)
setshift(list,h+d)
- -- list = hpack_node_list(list) -- is somehow needed
+ -- list = hpacknodelist(list) -- is somehow needed
-- setwhd(list,0,0,0)
-- faster:
local h = new_hlist(list)
@@ -900,9 +900,9 @@ function xtables.construct()
end
nofr = nofr + 1
local rp = rowproperties[r]
- -- we have a direction issue here but hpack_node_list(list,0,"exactly") cannot be used
+ -- we have a direction issue here but hpacknodelist(list,0,"exactly") cannot be used
-- due to the fact that we need the width
- local hbox = hpack_node_list(list)
+ local hbox = hpacknodelist(list)
setdirection(hbox,lefttoright_code)
result[nofr] = {
hbox,
@@ -949,7 +949,7 @@ end
local function inject(row,copy,package)
local list = row[1]
if copy then
- row[1] = copy_node_list(list)
+ row[1] = copynodelist(list)
end
if package then
ctx_beginvbox()
@@ -1186,7 +1186,7 @@ end
function xtables.cleanup()
for mode, result in next, data.results do
for _, r in next, result do
- flush_node_list(r[1])
+ flushnodelist(r[1])
end
end
diff --git a/tex/context/base/mkiv/task-ini.lua b/tex/context/base/mkiv/task-ini.lua
index 4e94648e3..3697a4086 100644
--- a/tex/context/base/mkiv/task-ini.lua
+++ b/tex/context/base/mkiv/task-ini.lua
@@ -115,7 +115,7 @@ appendaction("math", "normalizers", "noads.handlers.italics",
appendaction("math", "normalizers", "noads.handlers.kernpairs", nil, "nonut", "disabled" )
appendaction("math", "normalizers", "noads.handlers.classes", nil, "nonut", "disabled" )
-appendaction("math", "builders", "builders.kernel.mlist_to_hlist", nil, "nut", "enabled" ) -- mandate
+appendaction("math", "builders", "builders.kernel.mlisttohlist", nil, "nut", "enabled" ) -- mandate
appendaction("math", "builders", "typesetters.directions.processmath", nil, "nut", "disabled" )
appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
appendaction("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua
index 7120b47c3..96bf7d7b9 100644
--- a/tex/context/base/mkiv/toks-ini.lua
+++ b/tex/context/base/mkiv/toks-ini.lua
@@ -22,49 +22,49 @@ local commands = token.commands()
tokens.commands = utilities.storage.allocate(table.swapped(commands,commands))
tokens.values = { }
-local scan_toks = token.scan_toks
-local scan_string = token.scan_string
-local scan_argument = token.scan_argument
-local scan_delimited = token.scan_delimited
-local scan_tokenlist = token.scan_tokenlist or scan_string
-local scan_integer = token.scan_integer or token.scan_int
-local scan_cardinal = token.scan_cardinal
-local scan_code = token.scan_code
-local scan_token_code = token.scan_token_code
-local scan_dimen = token.scan_dimen
-local scan_glue = token.scan_glue
-local scan_skip = token.scan_skip
-local scan_keyword = token.scan_keyword
-local scan_keyword_cs = token.scan_keyword_cs or scan_keyword
-local scan_token = token.scan_token
-local scan_box = token.scan_box
-local scan_word = token.scan_word
-local scan_letters = token.scan_letters or scan_word -- lmtx
-local scan_key = token.scan_key
-local scan_value = token.scan_value
-local scan_char = token.scan_char
-local scan_number = token.scan_number -- not defined
-local scan_csname = token.scan_csname
-local scan_real = token.scan_real
-local scan_float = token.scan_float
-local scan_luanumber = token.scan_luanumber or scan_float -- only lmtx
-local scan_luainteger = token.scan_luainteger or scan_integer -- only lmtx
-local scan_luacardinal = token.scan_luacardinal or scan_cardinal -- only lmtx
-
-local set_macro = token.set_macro
-local set_char = token.set_char
-local set_lua = token.set_lua
-
-local create_token = token.create
-local new_token = token.new
-local is_defined = token.is_defined
-local is_token = token.is_token
-
-tokens.new = new_token
-tokens.create = create_token
-tokens.istoken = is_token
-tokens.isdefined = is_defined
-tokens.defined = is_defined
+local scantoks = token.scan_toks
+local scanstring = token.scan_string
+local scanargument = token.scan_argument
+local scandelimited = token.scan_delimited
+local scantokenlist = token.scan_tokenlist or scanstring
+local scaninteger = token.scan_integer or token.scan_int
+local scancardinal = token.scan_cardinal
+local scancode = token.scan_code
+local scantokencode = token.scan_token_code
+local scandimen = token.scan_dimen
+local scanglue = token.scan_glue
+local scanskip = token.scan_skip
+local scankeyword = token.scan_keyword
+local scankeywordcs = token.scan_keyword_cs or scankeyword
+local scantoken = token.scan_token
+local scanbox = token.scan_box
+local scanword = token.scan_word
+local scanletters = token.scan_letters or scanword -- lmtx
+local scankey = token.scan_key
+local scanvalue = token.scan_value
+local scanchar = token.scan_char
+local scannumber = token.scan_number -- not defined
+local scancsname = token.scan_csname
+local scanreal = token.scan_real
+local scanfloat = token.scan_float
+local scanluanumber = token.scan_luanumber or scanfloat -- only lmtx
+local scanluainteger = token.scan_luainteger or scaninteger -- only lmtx
+local scanluacardinal = token.scan_luacardinal or scancardinal -- only lmtx
+
+local setmacro = token.set_macro
+local setchar = token.set_char
+local setlua = token.set_lua
+
+local createtoken = token.create
+local newtoken = token.new
+local isdefined = token.is_defined
+local istoken = token.is_token
+
+tokens.new = newtoken
+tokens.create = createtoken
+tokens.istoken = istoken
+tokens.isdefined = isdefined
+tokens.defined = isdefined
local bits = {
escape = 0x00000001, -- 2^00
@@ -98,10 +98,10 @@ tokens.bits = bits
-- words are space or \relax terminated and the trailing space is gobbled; a word
-- can contain any non-space letter/other (see archive for implementation in lua)
-if not scan_number then
+if not scannumber then
- scan_number = function(base)
- local s = scan_word()
+ scannumber = function(base)
+ local s = scanword()
if not s then
return nil
elseif base then
@@ -113,8 +113,8 @@ if not scan_number then
end
-local function scan_boolean()
- local kw = scan_word()
+local function scanboolean()
+ local kw = scanword()
if kw == "true" then
return true
elseif kw == "false" then
@@ -124,64 +124,64 @@ local function scan_boolean()
end
end
-local function scan_verbatim()
- return scan_argument(false)
+local function scanverbatim()
+ return scanargument(false)
end
-if not scan_box then
+if not scanbox then
- local scan_list = token.scan_list
- local put_next = token.put_next
+ local scanlist = token.scan_list
+ local putnext = token.put_next
- scan_box = function(s)
+ scanbox = function(s)
if s == "hbox" or s == "vbox" or s == "vtop" then
- put_next(create_token(s))
+ putnext(createtoken(s))
end
- return scan_list()
+ return scanlist()
end
- token.scan_box = scan_box
+ token.scanbox = scanbox
end
tokens.scanners = { -- these expand
- token = scan_token,
- toks = scan_toks,
- tokens = scan_toks,
- box = scan_box,
- hbox = function() return scan_box("hbox") end,
- vbox = function() return scan_box("vbox") end,
- vtop = function() return scan_box("vtop") end,
- dimen = scan_dimen,
- dimension = scan_dimen,
- glue = scan_glue,
- gluevalues = function() return scan_glue(false,false,true) end,
- gluespec = scan_skip,
- integer = scan_integer,
- cardinal = scan_cardinal,
- real = scan_real,
- float = scan_float,
- luanumber = scan_luanumber,
- luainteger = scan_luainteger,
- luacardinal = scan_luacardinal,
- count = scan_integer,
- string = scan_string,
- argument = scan_argument,
- delimited = scan_delimited,
- tokenlist = scan_tokenlist,
- verbatim = scan_verbatim, -- detokenize
- code = scan_code,
- tokencode = scan_token_code,
- word = scan_word,
- letters = scan_letters,
- key = scan_key,
- value = scan_value,
- char = scan_char,
- number = scan_number,
- boolean = scan_boolean,
- keyword = scan_keyword,
- keywordcs = scan_keyword_cs,
- csname = scan_csname,
+ token = scantoken,
+ toks = scantoks,
+ tokens = scantoks,
+ box = scanbox,
+ hbox = function() return scanbox("hbox") end,
+ vbox = function() return scanbox("vbox") end,
+ vtop = function() return scanbox("vtop") end,
+ dimen = scandimen,
+ dimension = scandimen,
+ glue = scanglue,
+ gluevalues = function() return scanglue(false,false,true) end,
+ gluespec = scanskip,
+ integer = scaninteger,
+ cardinal = scancardinal,
+ real = scanreal,
+ float = scanfloat,
+ luanumber = scanluanumber,
+ luainteger = scanluainteger,
+ luacardinal = scanluacardinal,
+ count = scaninteger,
+ string = scanstring,
+ argument = scanargument,
+ delimited = scandelimited,
+ tokenlist = scantokenlist,
+ verbatim = scanverbatim, -- detokenize
+ code = scancode,
+ tokencode = scantokencode,
+ word = scanword,
+ letters = scanletters,
+ key = scankey,
+ value = scanvalue,
+ char = scanchar,
+ number = scannumber,
+ boolean = scanboolean,
+ keyword = scankeyword,
+ keywordcs = scankeywordcs,
+ csname = scancsname,
next = token.scan_next,
nextexpanded = token.scan_next_expanded,
@@ -214,9 +214,9 @@ tokens.getters = { -- these don't expand
}
tokens.setters = {
- macro = set_macro,
- char = set_char,
- lua = set_lua,
+ macro = setmacro,
+ char = setchar,
+ lua = setlua,
count = tex.setcount,
dimen = tex.setdimen,
skip = tex.setglue,
@@ -226,7 +226,7 @@ tokens.setters = {
box = tex.setbox,
}
-token.accessors = {
+tokens.accessors = {
command = token.get_command,
cmd = token.get_command,
cmdname = token.get_cmdname,
@@ -243,33 +243,12 @@ token.accessors = {
range = token.get_range,
}
--- static int run_scan_token(lua_State * L)
--- {
--- saved_tex_scanner texstate;
--- save_tex_scanner(texstate);
--- get_x_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- unsave_tex_scanner(texstate);
--- return 1;
--- }
---
--- static int run_get_future(lua_State * L)
--- {
--- /* saved_tex_scanner texstate; */
--- /* save_tex_scanner(texstate); */
--- get_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- back_input();
--- /* unsave_tex_scanner(texstate); */
--- return 1;
--- }
-
if setinspector then
local simple = { letter = "letter", other_char = "other" }
local astable = function(t)
- if t and is_token(t) then
+ if t and istoken(t) then
local cmdname = t.cmdname
local simple = simple[cmdname]
if simple then
@@ -304,10 +283,10 @@ if setinspector then
end
tokens.cache = table.setmetatableindex(function(t,k)
- if not is_defined(k) then
- set_macro(k,"","global")
+ if not isdefined(k) then
+ setmacro(k,"","global")
end
- local v = create_token(k)
+ local v = createtoken(k)
t[k] = v
return v
end)
diff --git a/tex/context/base/mkiv/trac-jus.lua b/tex/context/base/mkiv/trac-jus.lua
index aec1844ec..5f53b4c99 100644
--- a/tex/context/base/mkiv/trac-jus.lua
+++ b/tex/context/base/mkiv/trac-jus.lua
@@ -28,7 +28,7 @@ local findtail = nuts.tail
local nexthlist = nuts.traversers.hlist
local getdimensions = nuts.dimensions
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local tracedrule = nodes.tracers.pool.nuts.rule
@@ -100,7 +100,7 @@ function checkers.handler(head)
setlist(current,rule)
elseif alignstate == 2 then
local lrule = new_hlist(tracedrule(-delta/2,naturalheight,naturaldepth,"trace:dy"))
- local rrule = copy_list(lrule)
+ local rrule = copylist(lrule)
setlink(lrule,list)
setlink(findtail(list),new_kern(delta/2),rrule)
setlist(current,lrule)
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index fb5ef98d9..3bfbd1c76 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -70,14 +70,14 @@ local isglyph = nuts.isglyph
local hpack_nodes = nuts.hpack
local vpack_nodes = nuts.vpack
-local copy_list = nuts.copy_list
-local copy_node = nuts.copy_node
-local flush_node_list = nuts.flush_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copylist = nuts.copylist
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local apply_to_nodes = nuts.apply
local find_tail = nuts.tail
-local effectiveglue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
+local flushnodelist = nuts.flushlist
local hpack_string = nuts.typesetters.tohpack
@@ -500,7 +500,7 @@ local fontkern, italickern, marginkern, mathlistkern do
setattr(info,a_layer,layer)
f_cache[kern] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
@@ -548,7 +548,7 @@ local glyphexpansion do
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
return head, current
@@ -584,7 +584,7 @@ local kernexpansion do
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
return head, current
@@ -621,7 +621,7 @@ local whatsit do
setattr(info,a_layer,l_whatsit)
w_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -694,7 +694,7 @@ local user do
setattr(info,a_layer,l_user)
u_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -733,7 +733,7 @@ local math do
setattr(info,a_layer,l_math)
m_cache[tag][skip] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -791,7 +791,7 @@ local ruledbox do
end
-- we need to trigger the right mode (else sometimes no whatits)
local info = setlink(
- this and copy_list(this) or nil,
+ this and copylist(this) or nil,
(dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule {
width = wd,
height = ht,
@@ -812,7 +812,7 @@ local ruledbox do
elseif trace_origin then
local size = 2*size
local origin = o_cache[size]
- origin = copy_list(origin)
+ origin = copylist(origin)
if getid(parent) == vlist_code then
setshift(origin,-shift)
info = setlink(current,new_kern(-size),origin,new_kern(-size-dp),info)
@@ -832,7 +832,7 @@ local ruledbox do
elseif trace_origin then
local size = 2*size
local origin = o_cache[size]
- origin = copy_list(origin)
+ origin = copylist(origin)
if getid(parent) == vlist_code then
info = setlink(current,new_kern(-wd-size-shift),origin,new_kern(-size+shift),info)
else
@@ -1012,11 +1012,11 @@ local ruledglue do
end
(vertical and g_cache_v or g_cache_h)[amount] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1032,8 +1032,8 @@ local ruledglue do
-- info = sometext(amount,l_glue,c_space)
-- g_cache_h[amount] = info
-- end
- -- info = copy_list(info)
- -- head, current = insert_node_before(head,current,info)
+ -- info = copylist(info)
+ -- head, current = insertnodebefore(head,current,info)
-- return head, getnext(current)
-- else
-- return head, current
@@ -1061,8 +1061,8 @@ local ruledglue do
g_cache_x[width] = info
end
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
else
return head, current
@@ -1091,11 +1091,11 @@ local ruledkern do
end
cache[kern] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1119,8 +1119,8 @@ local ruleditalic do
end
i_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1144,8 +1144,8 @@ local ruledmarginkern do
end
m_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1169,8 +1169,8 @@ local ruledmathlistkern do
end
l_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1192,7 +1192,7 @@ local ruleddiscretionary do
d = new_hlist(kern)
d_cache[true] = d
end
- insert_node_after(head,current,copy_list(d))
+ insertnodeafter(head,current,copylist(d))
return head, current
end
@@ -1223,13 +1223,13 @@ local ruledpenalty do
end
(vertical and p_cache_v or p_cache_h)[penalty] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
elseif raisepenalties then
setshift(info,-65536*4)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1503,7 +1503,7 @@ do
local function cleanup()
for tag, cache in next, caches do
for k, v in next, cache do
- flush_node_list(v)
+ flushnodelist(v)
end
end
cleanup = function()
diff --git a/tex/context/base/mkiv/typo-bld.lua b/tex/context/base/mkiv/typo-bld.lua
index 305032772..36371aa10 100644
--- a/tex/context/base/mkiv/typo-bld.lua
+++ b/tex/context/base/mkiv/typo-bld.lua
@@ -46,7 +46,7 @@ local nodeidstostring = nodes.idstostring
local nodepool = nodes.pool
local new_baselineskip = nodepool.baselineskip
local new_lineskip = nodepool.lineskip
-local insert_node_before = nodes.insert_before
+local insertnodebefore = nodes.insertbefore
local hpack_node = nodes.hpack
local nuts = nodes.nuts
@@ -157,9 +157,9 @@ function parbuilders.constructors.methods.oneline(head,followed_by_display)
t.prevdepth = h.depth
t.prevgraf = 1
if d < texget("lineskiplimit") then
- return insert_node_before(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
+ return insertnodebefore(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
else
- return insert_node_before(h,h,new_baselineskip(d))
+ return insertnodebefore(h,h,new_baselineskip(d))
end
end
diff --git a/tex/context/base/mkiv/typo-brk.lua b/tex/context/base/mkiv/typo-brk.lua
index 89eb7e52d..68d9f2f54 100644
--- a/tex/context/base/mkiv/typo-brk.lua
+++ b/tex/context/base/mkiv/typo-brk.lua
@@ -46,13 +46,13 @@ local setprev = nuts.setprev
local setboth = nuts.setboth
local setsubtype = nuts.setsubtype
-local copy_node = nuts.copy_node
-local copy_node_list = nuts.copy_list
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copy_node = nuts.copy
+local copy_node_list = nuts.copylist
+local flushnode = nuts.flushnode
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local tonodes = nuts.tonodes
@@ -116,15 +116,15 @@ local function insert_break(head,start,stop,before,after,kern)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_before(head,start,p)
- insert_node_before(head,start,g)
+ insertnodebefore(head,start,p)
+ insertnodebefore(head,start,g)
end
local p = new_penalty(after)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_after(head,stop,g)
- insert_node_after(head,stop,p)
+ insertnodeafter(head,stop,g)
+ insertnodeafter(head,stop,p)
end
methods[1] = function(head,start,stop,settings,kern)
@@ -170,7 +170,7 @@ methods[2] = function(head,start) -- ( => (-
local hyphen = copy_node(post)
setchar(hyphen,languages.prehyphenchar(getlanguage(post)))
setlink(post,hyphen)
- head, start = insert_node_before(head,start,new_disc(nil,post,replace))
+ head, start = insertnodebefore(head,start,new_disc(nil,post,replace))
setattrlist(start,replace)
insert_break(head,start,start,10000,10000)
end
@@ -186,7 +186,7 @@ methods[3] = function(head,start) -- ) => -)
local hyphen = copy_node(pre)
setchar(hyphen,languages.prehyphenchar(getlanguage(pre)))
setlink(hyphen,pre)
- head, start = insert_node_before(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
+ head, start = insertnodebefore(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
setattrlist(start,tmp)
insert_break(head,start,start,10000,10000)
end
@@ -198,7 +198,7 @@ methods[4] = function(head,start) -- - => - - -
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
setattrlist(start,tmp)
setdisc(start,copy_node(tmp),copy_node(tmp),tmp)
insert_break(head,start,start,10000,10000)
@@ -211,7 +211,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
local attr = getattrlist(tmp)
local font = getfont(tmp)
local left = settings.left
@@ -228,7 +228,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
end
setdisc(start,left,right,middle)
setattrlist(start,attr)
- flush_node(tmp)
+ flushnode(tmp)
insert_break(head,start,start,10000,10000)
end
return head, start
@@ -302,7 +302,7 @@ function breakpoints.handler(head)
end
elseif id == math_code then
attr = nil
- current = end_of_math(current)
+ current = endofmath(current)
if current then
current = getnext(current)
end
diff --git a/tex/context/base/mkiv/typo-cap.lua b/tex/context/base/mkiv/typo-cap.lua
index 3d0d6055a..b6338ce40 100644
--- a/tex/context/base/mkiv/typo-cap.lua
+++ b/tex/context/base/mkiv/typo-cap.lua
@@ -36,9 +36,9 @@ local setchar = nuts.setchar
local setfont = nuts.setfont
local copy_node = nuts.copy
-local end_of_math = nuts.end_of_math
-local insert_after = nuts.insert_after
-local find_attribute = nuts.find_attribute
+local endofmath = nuts.endofmath
+local insertafter = nuts.insertafter
+local findattribute = nuts.findattribute
local nextglyph = nuts.traversers.glyph
@@ -132,7 +132,7 @@ local function replacer(start,codes)
else
local g = copy_node(start)
setchar(g,chr)
- insert_after(start,start,g)
+ insertafter(start,start,g)
end
end
elseif ifc[dc] then
@@ -237,7 +237,7 @@ local function mixed(start,attr,lastfont,n,count,where,first)
if fp ~= fc then
local k = fonts.getkern(fontdata[fp],getchar(p),c)
if k ~= 0 then
- insert_after(p,p,newkern(k))
+ insertafter(p,p,newkern(k))
end
end
else
@@ -410,7 +410,7 @@ function cases.handler(head) -- not real fast but also not used on much data
count = count + 1
end
elseif id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
count = 0
elseif prev_id == kern_code and getsubtype(prev) == fontkern_code then
-- still inside a word ...normally kerns are added later
@@ -427,7 +427,7 @@ function cases.handler(head) -- not real fast but also not used on much data
end
-- function cases.handler(head) -- not real fast but also not used on much data
--- local attr, start = find_attribute(head,a_cases)
+-- local attr, start = findattribute(head,a_cases)
-- if not start then
-- return head, false
-- end
@@ -520,7 +520,7 @@ end
-- count = count + 1
-- end
-- elseif id == math_code then
--- start = end_of_math(start)
+-- start = endofmath(start)
-- count = 0
-- elseif prev_id == kern_code and getsubtype(prev) == fontkern_code then
-- -- still inside a word ...normally kerns are added later
@@ -536,7 +536,7 @@ end
-- end
-- end
-- if start then
--- attr, start = find_attribute(start,a_cases)
+-- attr, start = findattribute(start,a_cases)
-- end
-- end
-- return head
diff --git a/tex/context/base/mkiv/typo-chr.lua b/tex/context/base/mkiv/typo-chr.lua
index bb3883b33..c9ba0c7b9 100644
--- a/tex/context/base/mkiv/typo-chr.lua
+++ b/tex/context/base/mkiv/typo-chr.lua
@@ -99,8 +99,8 @@ local wordboundary_code = boundarycodes.word
local texgetnest = tex.getnest -- to be used
local texsetcount = tex.setcount
-local flush_node = nodes.flush_node
-local flush_list = nodes.flush_list
+local flushnode = nodes.flushnode
+local flushlist = nodes.flushlist
local settexattribute = tex.setattribute
local punctuation = characters.is_punctuation
@@ -140,7 +140,7 @@ local actions = {
remove = function(specification)
local n = pickup()
if n then
- flush_node(n)
+ flushnode(n)
end
end,
push = function(specification)
@@ -175,7 +175,7 @@ local function pickup(head,tail,str)
while true do
local prev = first.prev
if prev and prev[a_marked] == attr then
- if prev.id == par_code then -- and start_of_par(prev)
+ if prev.id == par_code then -- and startofpar(prev)
break
else
first = prev
@@ -212,7 +212,7 @@ local actions = {
list.tail = prev
prev.next = nil
end
- flush_list(first)
+ flushlist(first)
end
end
end,
diff --git a/tex/context/base/mkiv/typo-dha.lua b/tex/context/base/mkiv/typo-dha.lua
index ac72ae394..176ed7867 100644
--- a/tex/context/base/mkiv/typo-dha.lua
+++ b/tex/context/base/mkiv/typo-dha.lua
@@ -62,11 +62,12 @@ local setprop = nuts.setprop
local setstate = nuts.setstate
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
@@ -160,7 +161,7 @@ local function process(start)
local id = getid(current)
local next = getnext(current)
if id == math_code then
- current = getnext(end_of_math(next))
+ current = getnext(endofmath(next))
elseif getprop(current,"direction") then
-- this handles unhbox etc
current = next
@@ -332,7 +333,7 @@ local function process(start)
end
textdir = autodir
setprop(current,"direction",true)
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
local direction = getdirection(current)
if direction == righttoleft_code then
autodir = -1
@@ -376,13 +377,13 @@ local function process(start)
local id = getid(current)
if id == math_code then
-- todo: this might be tricky nesting
- current = getnext(end_of_math(getnext(current)))
+ current = getnext(endofmath(getnext(current)))
else
local cp = getprop(current,"direction")
if cp == "n" then
local swap = state == "r"
if swap then
- head = insert_node_before(head,current,startdir(lefttoright_code))
+ head = insertnodebefore(head,current,startdir(lefttoright_code))
end
setprop(current,"direction",true)
while true do
@@ -395,14 +396,14 @@ local function process(start)
end
end
if swap then
- head, current = insert_node_after(head,current,stopdir(lefttoright_code))
+ head, current = insertnodeafter(head,current,stopdir(lefttoright_code))
end
elseif cp == "l" then
if state ~= "l" then
if state == "r" then
- head = insert_node_before(head,last or current,stopdir(righttoleft_code))
+ head = insertnodebefore(head,last or current,stopdir(righttoleft_code))
end
- head = insert_node_before(head,current,startdir(lefttoright_code))
+ head = insertnodebefore(head,current,startdir(lefttoright_code))
state = "l"
done = true
end
@@ -410,9 +411,9 @@ local function process(start)
elseif cp == "r" then
if state ~= "r" then
if state == "l" then
- head = insert_node_before(head,last or current,stopdir(lefttoright_code))
+ head = insertnodebefore(head,last or current,stopdir(lefttoright_code))
end
- head = insert_node_before(head,current,startdir(righttoleft_code))
+ head = insertnodebefore(head,current,startdir(righttoleft_code))
state = "r"
done = true
end
@@ -425,9 +426,9 @@ local function process(start)
end
else
if state == "r" then
- head = insert_node_before(head,current,stopdir(righttoleft_code))
+ head = insertnodebefore(head,current,stopdir(righttoleft_code))
elseif state == "l" then
- head = insert_node_before(head,current,stopdir(lefttoright_code))
+ head = insertnodebefore(head,current,stopdir(lefttoright_code))
end
state = false
last = false
@@ -441,9 +442,9 @@ local function process(start)
local sd = (state == "r" and stopdir(righttoleft_code)) or (state == "l" and stopdir(lefttoright_code))
if sd then
if id == glue_code and getsubtype(current) == parfillskip_code then
- head = insert_node_before(head,current,sd)
+ head = insertnodebefore(head,current,sd)
else
- head = insert_node_after(head,current,sd)
+ head = insertnodeafter(head,current,sd)
end
end
break
diff --git a/tex/context/base/mkiv/typo-dig.lua b/tex/context/base/mkiv/typo-dig.lua
index a9294a38d..bbc9311c4 100644
--- a/tex/context/base/mkiv/typo-dig.lua
+++ b/tex/context/base/mkiv/typo-dig.lua
@@ -33,10 +33,9 @@ local setlink = nuts.setlink
local setnext = nuts.setnext
local setprev = nuts.setprev
-local hpack_node = nuts.hpack
-local traverse_id = nuts.traverse_id
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local hpacknode = nuts.hpack
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
@@ -73,16 +72,16 @@ local a_digits = attributes.private("digits")
function nodes.aligned(head,start,stop,width,how)
if how == "flushright" or how == "middle" then
- head, start = insert_node_before(head,start,new_glue(0,65536,65536))
+ head, start = insertnodebefore(head,start,new_glue(0,65536,65536))
end
if how == "flushleft" or how == "middle" then
- head, stop = insert_node_after(head,stop,new_glue(0,65536,65536))
+ head, stop = insertnodeafter(head,stop,new_glue(0,65536,65536))
end
local prv = getprev(start)
local nxt = getnext(stop)
setprev(start)
setnext(stop)
- local packed = hpack_node(start,width,"exactly") -- no directional mess here, just lr
+ local packed = hpacknode(start,width,"exactly") -- no directional mess here, just lr
if prv then
setlink(prv,packed)
end
diff --git a/tex/context/base/mkiv/typo-drp.lua b/tex/context/base/mkiv/typo-drp.lua
index ddc6d68ae..d56ba3da7 100644
--- a/tex/context/base/mkiv/typo-drp.lua
+++ b/tex/context/base/mkiv/typo-drp.lua
@@ -59,10 +59,11 @@ local nodecodes = nodes.nodecodes
local nodepool = nuts.pool
local new_kern = nodepool.kern
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local remove_node = nuts.remove
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nextglyph = nuts.traversers.glyph
@@ -325,7 +326,7 @@ actions[v_default] = function(head,setting)
texset("hangindent",hangindent)
end
if indent then
- insert_after(first,first,new_kern(-parindent))
+ insertafter(first,first,new_kern(-parindent))
end
end
return head
@@ -334,7 +335,7 @@ end
-- we can count ... when all done, we can disable ...
function initials.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_initial)
if settings then
disableaction("processors","typesetters.initials.handler")
diff --git a/tex/context/base/mkiv/typo-dua.lua b/tex/context/base/mkiv/typo-dua.lua
index 5e1d4c109..dd7515a37 100644
--- a/tex/context/base/mkiv/typo-dua.lua
+++ b/tex/context/base/mkiv/typo-dua.lua
@@ -83,9 +83,10 @@ local setdirection = nuts.setdirection
----- setattrlist = nuts.setattrlist
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -337,7 +338,7 @@ local function get_baselevel(head,list,size,direction)
-- This is an adapted version:
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -765,16 +766,16 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
begindir = nil
end
end
@@ -782,7 +783,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
end
local skip = entry.skip
if skip and skip > 0 then
@@ -795,7 +796,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
end
if not entry.remove then
current = getnext(current)
diff --git a/tex/context/base/mkiv/typo-dub.lua b/tex/context/base/mkiv/typo-dub.lua
index 88b3361da..dc45a2785 100644
--- a/tex/context/base/mkiv/typo-dub.lua
+++ b/tex/context/base/mkiv/typo-dub.lua
@@ -71,9 +71,10 @@ local setdirection = nuts.setdirection
local setattrlist = nuts.setattrlist
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -398,7 +399,7 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -898,16 +899,16 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
begindir = nil
end
end
@@ -915,7 +916,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
end
local skip = entry.skip
if skip and skip > 0 then
@@ -928,7 +929,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
end
if not entry.remove then
current = getnext(current)
diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua
index 6e4f27de2..614defeb6 100644
--- a/tex/context/base/mkiv/typo-duc.lua
+++ b/tex/context/base/mkiv/typo-duc.lua
@@ -76,9 +76,10 @@ local setattrlist = nuts.setattrlist
local properties = nodes.properties.data
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -416,7 +417,7 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -959,18 +960,18 @@ local function apply_to_list(list,size,head,pardir)
c = p
end
-- there is always a par nodes so head will stay
- head = insert_node_before(head,c,new_direction(enddir,true))
+ head = insertnodebefore(head,c,new_direction(enddir,true))
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
- head, current = insert_node_after(head,current,new_direction(begindir))
+ head, current = insertnodeafter(head,current,new_direction(begindir))
begindir = nil
end
end
if begindir then
- head = insert_node_before(head,current,new_direction(begindir))
+ head = insertnodebefore(head,current,new_direction(begindir))
end
local skip = entry.skip
if skip and skip > 0 then
@@ -985,7 +986,7 @@ local function apply_to_list(list,size,head,pardir)
end
end
if enddir then
- head, current = insert_node_after(head,current,new_direction(enddir,true))
+ head, current = insertnodeafter(head,current,new_direction(enddir,true))
end
if not entry.remove then
current = getnext(current)
diff --git a/tex/context/base/mkiv/typo-fkr.lua b/tex/context/base/mkiv/typo-fkr.lua
index 1fd08526c..628818b6a 100644
--- a/tex/context/base/mkiv/typo-fkr.lua
+++ b/tex/context/base/mkiv/typo-fkr.lua
@@ -18,7 +18,7 @@ local glyph_code = nodecodes.glyph
local fontdata = fonts.hashes.identifiers
local getkernpair = fonts.handlers.otf.getkern
-local insert_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
local new_kern = nuts.pool.fontkern
local enableaction = nodes.tasks.enableaction
@@ -56,7 +56,7 @@ function typesetters.fontkerns.handler(head)
kern = (kern1 + kern2)/2 -- mixed
end
if kern ~= 0 then
- head, current = insert_before(head,current,new_kern(kern))
+ head, current = insertbefore(head,current,new_kern(kern))
end
lastdata = data
else
@@ -68,7 +68,7 @@ function typesetters.fontkerns.handler(head)
end
local kern = getkernpair(lastdata,lastchar,char)
if kern ~= 0 then
- head, current = insert_before(head,current,new_kern(kern))
+ head, current = insertbefore(head,current,new_kern(kern))
end
end
lastchar = char
diff --git a/tex/context/base/mkiv/typo-fln.lua b/tex/context/base/mkiv/typo-fln.lua
index 3941e65ef..0ee77fe87 100644
--- a/tex/context/base/mkiv/typo-fln.lua
+++ b/tex/context/base/mkiv/typo-fln.lua
@@ -63,15 +63,15 @@ local spaceskip_code = nodes.gluecodes.spaceskip
local nextglyph = nuts.traversers.glyph
local nextdisc = nuts.traversers.disc
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local copy_node_list = nuts.copy_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local copy_node_list = nuts.copylist
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
local getdimensions = nuts.dimensions
local hpack_node_list = nuts.hpack
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local newpenalty = nodepool.penalty
@@ -182,7 +182,7 @@ actions[v_line] = function(head,setting)
-- temp = typesetters.kerns.handler(temp) -- maybe when enabled
-- temp = typesetters.cases.handler(temp) -- maybe when enabled
local width = getdimensions(temp)
- flush_node_list(temp)
+ flushnodelist(temp)
return width
end
@@ -230,7 +230,7 @@ actions[v_line] = function(head,setting)
end
end
- flush_node_list(temp)
+ flushnodelist(temp)
local start = head
local n = 0
@@ -296,11 +296,11 @@ actions[v_line] = function(head,setting)
end
end
setdisc(disc,pre,post,replace)
- flush_node(disc)
+ flushnode(disc)
elseif id == glue_code then
n = n + 1
if linebreak ~= n then
- head = insert_node_before(head,start,newpenalty(10000)) -- nobreak
+ head = insertnodebefore(head,start,newpenalty(10000)) -- nobreak
end
end
local next = getnext(start)
@@ -308,11 +308,11 @@ actions[v_line] = function(head,setting)
if start ~= head then
local where = id == glue_code and getprev(start) or start
if trace_firstlines then
- head, where = insert_node_after(head,where,newpenalty(10000)) -- nobreak
- head, where = insert_node_after(head,where,newkern(-65536))
- head, where = insert_node_after(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
+ head, where = insertnodeafter(head,where,newpenalty(10000)) -- nobreak
+ head, where = insertnodeafter(head,where,newkern(-65536))
+ head, where = insertnodeafter(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
end
- head, where = insert_node_after(head,where,newpenalty(-10000)) -- break
+ head, where = insertnodeafter(head,where,newpenalty(-10000)) -- break
end
start = next
break
@@ -372,7 +372,7 @@ end
actions[v_default] = actions[v_line]
function firstlines.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_firstline)
if settings then
disableaction("processors","typesetters.firstlines.handler")
diff --git a/tex/context/base/mkiv/typo-itc.lua b/tex/context/base/mkiv/typo-itc.lua
index c3a583fe4..0cf847846 100644
--- a/tex/context/base/mkiv/typo-itc.lua
+++ b/tex/context/base/mkiv/typo-itc.lua
@@ -44,9 +44,9 @@ local setkern = nuts.setkern
local getkern = nuts.getkern
local getheight = nuts.getheight
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local texgetattribute = tex.getattribute
local texsetattribute = tex.setattribute
@@ -182,7 +182,7 @@ local enablemath = false
local enabletext = false
local function domath(head,current)
- current = end_of_math(current)
+ current = endofmath(current)
local next = getnext(current)
if next then
local char, id = isglyph(next)
@@ -251,7 +251,7 @@ local function domath(head,current)
if trace_italics then
report_italics("%s italic %p between math %C and non punctuation %C","adding",a,getchar(glyph),char)
end
- insert_node_after(head,glyph,correction_kern(a,glyph))
+ insertnodeafter(head,glyph,correction_kern(a,glyph))
end
end
end
@@ -309,7 +309,7 @@ local function texthandler(head)
if font ~= lastfont then
if previtalic ~= 0 then
if okay(data,current,font,prevchar,previtalic,char,"glyph") then
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
end
elseif previnserted and data then
if trace_italics then
@@ -320,7 +320,7 @@ local function texthandler(head)
--
if replaceitalic ~= 0 then
if okay(data,replace,font,replacechar,replaceitalic,char,"replace") then
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
replaceitalic = 0
elseif replaceinserted and data then
@@ -332,7 +332,7 @@ local function texthandler(head)
--
if postitalic ~= 0 then
if okay(data,post,font,postchar,postitalic,char,"post") then
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
postitalic = 0
elseif postinserted and data then
@@ -484,7 +484,7 @@ local function texthandler(head)
end
previnserted = correction_glue(previtalic,current) -- maybe just add ? else problem with penalties
previtalic = 0
- insert_node_after(prevhead,prev,previnserted)
+ insertnodeafter(prevhead,prev,previnserted)
else
if replaceitalic ~= 0 then
if trace_italics then
@@ -492,7 +492,7 @@ local function texthandler(head)
end
replaceinserted = correction_kern(replaceitalic,current) -- needs to be a kern
replaceitalic = 0
- insert_node_after(replacehead,replace,replaceinserted)
+ insertnodeafter(replacehead,replace,replaceinserted)
end
if postitalic ~= 0 then
if trace_italics then
@@ -500,7 +500,7 @@ local function texthandler(head)
end
postinserted = correction_kern(postitalic,current) -- needs to be a kern
postitalic = 0
- insert_node_after(posthead,post,postinserted)
+ insertnodeafter(posthead,post,postinserted)
end
end
elseif id == math_code then
@@ -514,14 +514,14 @@ local function texthandler(head)
if mathokay then
current = domath(head,current)
else
- current = end_of_math(current)
+ current = endofmath(current)
end
else
if previtalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",previtalic,"glyph",prevchar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -533,7 +533,7 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",replaceitalic,"replace",replacechar)
end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -545,7 +545,7 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",postitalic,"post",postchar)
end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -562,19 +562,19 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",previtalic,"glyph",prevchar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
else
if replaceitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",replaceitalic,"replace",replacechar)
end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
if postitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",postitalic,"post",postchar)
end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
end
end
diff --git a/tex/context/base/mkiv/typo-krn.lua b/tex/context/base/mkiv/typo-krn.lua
index 489375e9b..58d6c091c 100644
--- a/tex/context/base/mkiv/typo-krn.lua
+++ b/tex/context/base/mkiv/typo-krn.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['typo-krn'] = {
+ if not modules then modules = { } end modules ['typo-krn'] = {
version = 1.001,
comment = "companion to typo-krn.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -24,10 +24,9 @@ local nodepool = nuts.pool
-- check what is used
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local endofmath = nuts.endofmath
local copy_node = nuts.copy
local getnext = nuts.getnext
@@ -129,7 +128,7 @@ local factors = kerns.factors
-- make sure it runs after all others
-- there will be a width adaptor field in nodes so this will change
-- todo: interchar kerns / disc nodes / can be made faster
--- todo: use insert_before etc
+-- todo: use insertbefore etc
local gluefactor = 4 -- assumes quad = .5 enspace
@@ -331,7 +330,7 @@ local function process_list(head,keeptogether,krn,font,okay)
-- if kerns then
-- print("it happens indeed, basemode kerns not yet injected")
-- end
- insert_node_before(head,start,new_kern((kerns and kerns[char] or 0) + kern))
+ insertnodebefore(head,start,new_kern((kerns and kerns[char] or 0) + kern))
okay = true
end
end
@@ -412,7 +411,7 @@ function kerns.handler(head)
setattr(n,a_kerns,attr) -- we took away the attr
end
setchar(n,unicode[i])
- insert_node_after(head,s,n)
+ insertnodeafter(head,s,n)
s = n
end
end
@@ -444,10 +443,10 @@ function kerns.handler(head)
local data = chardata[font][prevchar]
local kerns = data and data.kerns
local kern = (kerns and kerns[char] or 0) + quaddata[font]*krn
- insert_node_before(head,start,kern_injector(fillup,kern))
+ insertnodebefore(head,start,kern_injector(fillup,kern))
end
else
- insert_node_before(head,start,kern_injector(fillup,quaddata[font]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[font]*krn))
end
end
prev = start
@@ -557,16 +556,16 @@ function kerns.handler(head)
-- special case
local b, f = closest_bound(start,getprev)
if b then
- insert_node_before(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[f]*krn))
end
local b, f = closest_bound(start,getnext)
if b then
- insert_node_after(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodeafter(head,start,kern_injector(fillup,quaddata[f]*krn))
end
end
bound = false
elseif id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
bound = false
end
if start then
diff --git a/tex/context/base/mkiv/typo-lin.lua b/tex/context/base/mkiv/typo-lin.lua
index 84d622e1e..40247c457 100644
--- a/tex/context/base/mkiv/typo-lin.lua
+++ b/tex/context/base/mkiv/typo-lin.lua
@@ -74,8 +74,8 @@ local tonut = nodes.tonut
local tonode = nodes.tonode
local nexthlist = nuts.traversers.hlist
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local find_tail = nuts.tail
local rehpack = nuts.rehpack
----- remove_node = nuts.remove
@@ -99,7 +99,7 @@ local setwidth = nuts.setwidth
local setprop = nuts.setprop
local getprop = nuts.rawprop -- getprop
-local effectiveglue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local nodepool = nuts.pool
local new_kern = nodepool.kern
@@ -147,9 +147,9 @@ local function finalize(prop,key) -- delayed calculations
end
local kern1 = new_kern(delta)
local kern2 = new_kern(-delta)
- head = insert_before(head,head,kern1)
- head = insert_before(head,head,pack)
- head = insert_before(head,head,kern2)
+ head = insertbefore(head,head,kern1)
+ head = insertbefore(head,head,pack)
+ head = insertbefore(head,head,kern2)
setlist(line,head)
local where = {
pack = pack,
@@ -207,11 +207,11 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
if addskips then
if rightskip and not leftskip then
leftskip = new_leftskip(lskip)
- head = insert_before(head,head,leftskip)
+ head = insertbefore(head,head,leftskip)
end
if leftskip and not rightskip then
rightskip = new_rightskip(0)
- head, tail = insert_after(head,tail,rightskip)
+ head, tail = insertafter(head,tail,rightskip)
end
end
if head ~= oldhead then
@@ -267,7 +267,7 @@ function paragraphs.normalize(head,islocal)
current = getnext(current)
end
if current then
- head, current = insert_before(head,current,new_glue(l_width,l_stretch,l_shrink))
+ head, current = insertbefore(head,current,new_glue(l_width,l_stretch,l_shrink))
if head == current then
setlist(last,head)
end
@@ -303,10 +303,10 @@ local function addtoline(n,list,option)
if trace_anchors and not line.traced then
line.traced = true
local rule = new_rule(2*65536,2*65536,1*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list)
local rule = new_rule(2*65536,6*65536,-3*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list,"internal")
else
line.traced = true
@@ -329,14 +329,14 @@ local function addtoline(n,list,option)
-- optimize now .. we can also decide to put each blob in a hlist
local kern = new_kern(delta)
if tail then
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
else
head, tail = kern, kern
setlist(where.pack,head)
end
- head, tail = insert_after(head,tail,blob)
+ head, tail = insertafter(head,tail,blob)
local kern = new_kern(-delta)
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
--
where.head = head
where.tail = tail
@@ -366,7 +366,7 @@ local function addanchortoline(n,anchor)
end
if where.tail then
local head = where.head
- insert_before(head,head,anchor)
+ insertbefore(head,head,anchor)
else
where.tail = anchor
end
diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua
index 7e69162a9..f8c135fa7 100644
--- a/tex/context/base/mkiv/typo-mar.lua
+++ b/tex/context/base/mkiv/typo-mar.lua
@@ -61,9 +61,9 @@ local v_line = variables.line
local nuts = nodes.nuts
local tonode = nuts.tonode
-local hpack_nodes = nuts.hpack
-local traverse_id = nuts.traverse_id
-local flush_node_list = nuts.flush_list
+local hpacknodes = nuts.hpack
+local traverseid = nuts.traverseid
+local flushnodelist = nuts.flushlist
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -251,7 +251,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
else
@@ -259,7 +259,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
end
@@ -492,9 +492,9 @@ local function markovershoot(current) -- todo: alleen als offset > line
v_anchors = v_anchors + 1
cache[v_anchors] = fastcopy(stacked)
local anchor = setanchor(v_anchors)
- -- local list = hpack_nodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
+ -- local list = hpacknodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
-- local list = setlink(anchor,getlist(current)) -- why not this ... better play safe
- local list = hpack_nodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
+ local list = hpacknodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
if trace_marginstack then
report_margindata("marking anchor %a",v_anchors)
end
@@ -790,7 +790,7 @@ local function flushed(scope,parent) -- current is hlist
if done then
local a = getattr(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism
if false then
- local l = hpack_nodes(head,getwidth(parent),"exactly")
+ local l = hpacknodes(head,getwidth(parent),"exactly")
setlist(parent,l)
if a then
setattr(l,a_linenumber,a)
@@ -905,7 +905,7 @@ end
local function finalhandler(head)
if nofdelayed > 0 then
local current = head
- while current and nofdelayed > 0 do -- traverse_list
+ while current and nofdelayed > 0 do
local id = getid(current)
if id == hlist_code then -- only lines?
local a = getprop(current,"margindata")
diff --git a/tex/context/base/mkiv/typo-pag.lua b/tex/context/base/mkiv/typo-pag.lua
index ea4b1574c..b6a27f167 100644
--- a/tex/context/base/mkiv/typo-pag.lua
+++ b/tex/context/base/mkiv/typo-pag.lua
@@ -39,7 +39,7 @@ local setpenalty = nuts.setpenalty
local getwidth = nuts.getwidth
local getdepth = nuts.getdepth
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local new_penalty = nuts.pool.penalty
local trace_keeptogether = false
@@ -129,7 +129,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -144,7 +144,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -158,7 +158,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
diff --git a/tex/context/base/mkiv/typo-pnc.lua b/tex/context/base/mkiv/typo-pnc.lua
index 732970884..79ca4f577 100644
--- a/tex/context/base/mkiv/typo-pnc.lua
+++ b/tex/context/base/mkiv/typo-pnc.lua
@@ -21,7 +21,7 @@ local glue_code = nodecodes.glue
local spaceskip_code = gluecodes.spaceskip
local new_kern = nuts.pool.kern
-local insert_after = nuts.insert_after
+local insertafter = nuts.insertafter
local nextglyph = nuts.traversers.glyph
@@ -89,7 +89,7 @@ function periodkerns.handler(head)
if factor ~= 0 then
fontspace = parameters[getfont(current)].space -- can be sped up
inserted = factor * fontspace
- insert_after(head,current,new_kern(inserted))
+ insertafter(head,current,new_kern(inserted))
if trace then
report("inserting space at %C . [%p] %C .",pchar,inserted,nchar)
end
diff --git a/tex/context/base/mkiv/typo-rep.lua b/tex/context/base/mkiv/typo-rep.lua
index 2538a014d..a116a3f5d 100644
--- a/tex/context/base/mkiv/typo-rep.lua
+++ b/tex/context/base/mkiv/typo-rep.lua
@@ -38,6 +38,7 @@ local chardata = characters.data
local collected = false
local a_stripping = attributes.private("stripping")
+
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
diff --git a/tex/context/base/mkiv/typo-rub.lua b/tex/context/base/mkiv/typo-rub.lua
index 6c6ab9a33..14acfdbd7 100644
--- a/tex/context/base/mkiv/typo-rub.lua
+++ b/tex/context/base/mkiv/typo-rub.lua
@@ -49,7 +49,6 @@ local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
local hpack = nuts.hpack
-local insert_after = nuts.insert_after
local takebox = nuts.takebox
local nexthlist = nuts.traversers.hlist
@@ -368,7 +367,7 @@ local function whatever(current)
end
end
-attach = function(head) -- traverse_list
+attach = function(head)
for current in nexthlist, head do
whatever(current)
end
diff --git a/tex/context/base/mkiv/typo-spa.lua b/tex/context/base/mkiv/typo-spa.lua
index 78fc22964..db05963eb 100644
--- a/tex/context/base/mkiv/typo-spa.lua
+++ b/tex/context/base/mkiv/typo-spa.lua
@@ -29,10 +29,10 @@ local getprev = nuts.getprev
local takeattr = nuts.takeattr
local isglyph = nuts.isglyph
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodepool = nuts.pool
local new_penalty = nodepool.penalty
@@ -116,8 +116,8 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space before %C (left)",char)
end
- insert_node_before(head,start,new_penalty(10000))
- insert_node_before(head,start,new_glue(left*quad))
+ insertnodebefore(head,start,new_penalty(10000))
+ insertnodebefore(head,start,new_glue(left*quad))
end
end
local next = getnext(start)
@@ -152,15 +152,15 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space after %C (right)",char)
end
- insert_node_after(head,start,new_glue(right*quad))
- insert_node_after(head,start,new_penalty(10000))
+ insertnodeafter(head,start,new_glue(right*quad))
+ insertnodeafter(head,start,new_penalty(10000))
end
end
end
end
end
elseif id == math_code then
- start = end_of_math(start) -- weird, can return nil .. no math end?
+ start = endofmath(start) -- weird, can return nil .. no math end?
end
if start then
start = getnext(start)
diff --git a/tex/context/base/mkiv/typo-sus.lua b/tex/context/base/mkiv/typo-sus.lua
index bb5b03912..993f4c798 100644
--- a/tex/context/base/mkiv/typo-sus.lua
+++ b/tex/context/base/mkiv/typo-sus.lua
@@ -57,9 +57,9 @@ local setattr = nuts.setattr
local setlist = nuts.setlist
local setcolor = nodes.tracers.colors.set
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local endofmath = nuts.endofmath
local nodepool = nuts.pool
@@ -123,22 +123,22 @@ local function mark(head,current,id,color)
local width = getwidth(current)
local rule = new_rule(width)
local kern = new_kern(-width)
- head = insert_before(head,current,rule)
- head = insert_before(head,current,kern)
+ head = insertbefore(head,current,rule)
+ head = insertbefore(head,current,kern)
setcolor(rule,color)
-- elseif id == kern_code then
-- local width = getkern(current)
-- local rule = new_rule(width)
-- local kern = new_kern(-width)
- -- head = insert_before(head,current,rule)
- -- head = insert_before(head,current,kern)
+ -- head = insertbefore(head,current,rule)
+ -- head = insertbefore(head,current,kern)
-- setcolor(rule,color)
else
local width, height, depth = getwhd(current)
local extra = fonts.hashes.xheights[getfont(current)] / 2
local rule = new_rule(width,height+extra,depth+extra)
local hlist = new_hlist(rule)
- head = insert_before(head,current,hlist)
+ head = insertbefore(head,current,hlist)
setcolor(rule,color)
setcolor(current,"white")
end
@@ -226,7 +226,7 @@ function typesetters.marksuspects(head)
end
current = getnext(current)
elseif id == math_code then
- current = getnext(end_of_math(current))
+ current = getnext(endofmath(current))
elseif id == glue_code then
local a = getattr(current,a_characters)
if a then
@@ -270,7 +270,7 @@ local function showsuspects(head)
head, current = mark(head,current,id,colors[a])
end
elseif id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
elseif id == hlist_code or id == vlist_code then
local list = getlist(current)
if list then
diff --git a/tex/context/base/mkiv/typo-tal.lua b/tex/context/base/mkiv/typo-tal.lua
index db605a491..b827b8ef9 100644
--- a/tex/context/base/mkiv/typo-tal.lua
+++ b/tex/context/base/mkiv/typo-tal.lua
@@ -47,8 +47,8 @@ local isglyph = nuts.isglyph
local setattr = nuts.setattr
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local nextglyph = nuts.traversers.glyph
local getdimensions = nuts.dimensions
@@ -376,46 +376,46 @@ function characteralign.handler(head,where)
local new_kern = trace_split and traced_kern or new_kern
if b_start then
if before < maxbefore then
- head = insert_node_before(head,b_start,new_kern(maxbefore-before))
+ head = insertnodebefore(head,b_start,new_kern(maxbefore-before))
end
if not c then
-- print("[before]")
if dataset.hasseparator then
local width = fontcharacters[getfont(b_start)][separator].width
- insert_node_after(head,b_stop,new_kern(maxafter+width))
+ insertnodeafter(head,b_stop,new_kern(maxafter+width))
end
elseif a_start then
-- print("[before] [separator] [after]")
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
else
-- print("[before] [separator]")
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
elseif a_start then
if c then
-- print("[separator] [after]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
else
-- print("[after]")
local width = fontcharacters[getfont(b_stop)][separator].width
- head = insert_node_before(head,a_start,new_kern(maxbefore+width))
+ head = insertnodebefore(head,a_start,new_kern(maxbefore+width))
end
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
elseif c then
-- print("[separator]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
return head
diff --git a/tex/context/base/mkiv/typo-wrp.lua b/tex/context/base/mkiv/typo-wrp.lua
index f2ca43b56..4ba3c3aff 100644
--- a/tex/context/base/mkiv/typo-wrp.lua
+++ b/tex/context/base/mkiv/typo-wrp.lua
@@ -53,6 +53,8 @@ local report = logs.reporter("paragraphs","wrappers")
-- If needed we can extend this checker for other cases but then we will also
-- use attributes.
+-- we can actually do better in lmtx
+
local function remove_dangling_crlf(head,tail)
if head and tail and getid(tail) == glue_code and getsubtype(tail) == parfillskip_code then
tail = getprev(tail)
diff --git a/tex/context/base/mkiv/typo-wrp.mkiv b/tex/context/base/mkiv/typo-wrp.mkiv
index 4e9ecf2e1..3a3bb4faf 100644
--- a/tex/context/base/mkiv/typo-wrp.mkiv
+++ b/tex/context/base/mkiv/typo-wrp.mkiv
@@ -49,7 +49,7 @@
\ignorespaces}
\unexpanded\def\spac_crlf_placeholder
- {\strut}
+ {\wordboundary\strut} % or \endstrut
\unexpanded\def\spac_crlf_placeholder_show
{\wordboundary