summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-fin.lua
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/node-fin.lua
parent4396699cb99f42f6378ed7229788bbceb898851a (diff)
downloadcontext-330909ad62342ff873dc758b909968c66d0252a4.tar.gz
2021-05-15 22:44:00
Diffstat (limited to 'tex/context/base/mkiv/node-fin.lua')
-rw-r--r--tex/context/base/mkiv/node-fin.lua164
1 files changed, 82 insertions, 82 deletions
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