summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt')
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt47
1 files changed, 20 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
index 84dd0696d6c..88ade876ed7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
@@ -29,12 +29,12 @@ local getprev = nuts.getprev
local getattr = nuts.getattr
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 unset_attributes = nuts.unset_attributes
-local find_attribute = nuts.find_attribute
+local endofmath = nuts.endofmath
+local unsetattributes = nuts.unsetattributes
+local findattribute = nuts.findattribute
local nodepool = nuts.pool
local new_penalty = nodepool.penalty
@@ -72,7 +72,7 @@ end
-- todo cache lastattr
function spacings.handler(head)
- local _, start = find_attribute(head, a_spacings)
+ local _, start = findattribute(head, a_spacings)
if start then
local done = false
-- head is always begin of par (whatsit), so we have at least two prev nodes
@@ -96,10 +96,8 @@ function spacings.handler(head)
local ok = false
local prevprev = getprev(prev)
if alternative == 1 then
- local somespace = somespace(prev,true)
- if somespace then
- local somepenalty = somepenalty(prevprev,10000)
- if somepenalty then
+ if somespace(prev,true) then
+ if somepenalty(prevprev,10000) then
if trace_spacing then
report_spacing("removing penalty and space before %C (left)",char)
end
@@ -120,8 +118,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)
@@ -129,24 +127,19 @@ function spacings.handler(head)
local ok = false
local nextnext = getnext(next)
if alternative == 1 then
- local somepenalty = somepenalty(next,10000)
- if somepenalty then
- local somespace = somespace(nextnext,true)
- if somespace then
+ if somepenalty(next,10000) then
+ if somespace(nextnext,true) then
if trace_spacing then
report_spacing("removing penalty and space after %C right",char)
end
head = remove_node(head,next,true)
head = remove_node(head,nextnext,true)
end
- else
- local somespace = somespace(next,true)
- if somespace then
- if trace_spacing then
- report_spacing("removing space after %C (right)", char)
- end
- head = remove_node(head,next,true)
+ elseif somespace(next,true) then
+ if trace_spacing then
+ report_spacing("removing space after %C (right)", char)
end
+ head = remove_node(head,next,true)
end
ok = true
else
@@ -156,8 +149,8 @@ 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
@@ -165,14 +158,14 @@ function spacings.handler(head)
done = true
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)
end
end
if done then
- -- unset_attributes(a_spacings,head)
+ -- unsetattributes(a_spacings,head)
end
end
return head