summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/spac-ver.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/spac-ver.lmt')
-rw-r--r--tex/context/base/mkxl/spac-ver.lmt61
1 files changed, 31 insertions, 30 deletions
diff --git a/tex/context/base/mkxl/spac-ver.lmt b/tex/context/base/mkxl/spac-ver.lmt
index 3e606552a..76d1ce9db 100644
--- a/tex/context/base/mkxl/spac-ver.lmt
+++ b/tex/context/base/mkxl/spac-ver.lmt
@@ -149,12 +149,13 @@ local getdepth = nuts.getdepth
local setnext = nuts.setnext
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
+local flushnode = nuts.flushnode
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 write_node = nuts.write
@@ -289,7 +290,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
@@ -323,7 +324,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
@@ -765,7 +766,7 @@ do
end
end
- local expandmacro = token.expand_macro
+ local expandmacro = token.expandmacro -- todo
-- local runlocal = tex.runlocal
-- local setmacro = tokens.setters.macro
-- local settoks = tex.settoks
@@ -1018,8 +1019,8 @@ end
do
- local insert_node_after = nuts.insert_after
- local insert_node_before = nuts.insert_before
+ local insertnodeafter = nuts.insertafter
+ local insertnodebefore = nuts.insertbefore
local abovedisplayskip_code = gluecodes.abovedisplayskip
local belowdisplayskip_code = gluecodes.belowdisplayskip
@@ -1116,14 +1117,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
@@ -1304,10 +1305,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)
@@ -1477,12 +1478,12 @@ do
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)
+ 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]
@@ -1501,22 +1502,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
@@ -1647,7 +1648,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
@@ -1737,7 +1738,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
@@ -1748,7 +1749,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
@@ -1760,7 +1761,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
@@ -1768,13 +1769,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
@@ -1855,7 +1856,7 @@ do
elseif glue_data then
local w = getwidth(current)
if w ~= 0 and w > getwidth(glue_data) then
-flush_node(glue_data)
+ flushnode(glue_data)
glue_data = current
if trace then
trace_natural("taking parskip",current)
@@ -1985,7 +1986,7 @@ flush_node(glue_data)
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)