summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-fin.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-05-24 17:32:43 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-05-24 17:32:43 +0200
commite52e58ff4a7007ca774905727391e5f78135f98d (patch)
tree55357f7bcd2825670a21f79b7f3c3fa9a1404e8f /tex/context/base/mkiv/node-fin.lua
parent6a68bb9d4e7e8454b031143b9cd14edf3702a68d (diff)
downloadcontext-e52e58ff4a7007ca774905727391e5f78135f98d.tar.gz
2018-05-24 15:56:00
Diffstat (limited to 'tex/context/base/mkiv/node-fin.lua')
-rw-r--r--tex/context/base/mkiv/node-fin.lua83
1 files changed, 83 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua
index f7e2c7904..3139263ab 100644
--- a/tex/context/base/mkiv/node-fin.lua
+++ b/tex/context/base/mkiv/node-fin.lua
@@ -725,6 +725,89 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
return head
end
+-- local nextid = nodes.nuts.traversers.id
+--
+-- local function stacker(attribute,head,default) -- no triggering, no inheritance, but list-wise
+--
+-- -- nsbegin()
+-- local stacked = false
+--
+-- local current = head
+-- local previous = head
+-- local attrib = default or unsetvalue
+-- local check = false
+-- local leader = false
+--
+-- local id = getid(current)
+-- while current do
+-- if id == glyph_code then
+-- check = true
+-- elseif id == glue_code then
+-- leader = getleader(current)
+-- if leader then
+-- check = true
+-- end
+-- elseif id == hlist_code or id == vlist_code then
+-- local content = getlist(current)
+-- if content then
+-- local list
+-- 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]))
+-- list = stacker(attribute,content,a)
+-- head, current = insert_node_after(head,current,copy_node(nsnone))
+-- else
+-- list = stacker(attribute,content,attrib)
+-- end
+-- else
+-- list = stacker(attribute,content,default)
+-- end
+-- if list ~= content then
+-- setlist(current,list)
+-- end
+-- end
+-- elseif id == rule_code then
+-- check = getwidth(current) ~= 0
+-- end
+--
+-- if check then
+-- local a = getattr(current,attribute) or unsetvalue
+-- if a ~= attrib then
+-- if not stacked then
+-- stacked = true
+-- nsbegin()
+-- end
+-- local n = nsstep(a)
+-- if n then
+-- head = insert_node_before(head,current,tonut(n)) -- a
+-- end
+-- attrib = a
+-- if leader then
+-- -- tricky as a leader has to be a list so we cannot inject before
+-- local list = stacker(attribute,leader,attrib)
+-- leader = false
+-- end
+-- end
+-- check = false
+-- end
+--
+-- previous = current
+--
+-- current, id = nextid(current,current)
+-- end
+--
+-- if stacked then
+-- local n = nsend()
+-- while n do
+-- head = insert_node_after(head,previous,tonut(n))
+-- n = nsend()
+-- end
+-- end
+--
+-- return head
+-- end
+
states.stacker = function(namespace,attribute,head,default)
local head = stacker(attribute,head,default)
nsreset()