summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-rul.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-21 02:52:16 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-21 02:52:16 +0200
commita36f9abf1e0fd7de609dd1840d75bea56ec9e926 (patch)
treeb14349d1a44df698533aa324f6c17d2922bb4b59 /tex/context/base/mkiv/node-rul.lua
parentaf172a8db5f7583d0117635edde17eba5619d883 (diff)
downloadcontext-a36f9abf1e0fd7de609dd1840d75bea56ec9e926.tar.gz
2016-05-20 18:46:00
Diffstat (limited to 'tex/context/base/mkiv/node-rul.lua')
-rw-r--r--tex/context/base/mkiv/node-rul.lua78
1 files changed, 42 insertions, 36 deletions
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index a1ac67657..033539062 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -13,34 +13,36 @@ if not modules then modules = { } end modules ['node-rul'] = {
local attributes, nodes, node = attributes, nodes, node
-local nuts = nodes.nuts
-local tonode = nuts.tonode
-local tonut = nuts.tonut
-
-local getfield = nuts.getfield
-local setfield = nuts.setfield
-local setnext = nuts.setnext
-local setprev = nuts.setprev
-local setlink = nuts.setlink
-local getnext = nuts.getnext
-local getprev = nuts.getprev
-local getid = nuts.getid
-local getattr = nuts.getattr
-local setattr = nuts.setattr
-local getfont = nuts.getfont
-local getsubtype = nuts.getsubtype
-local getlist = nuts.getlist
-local setlist = nuts.setlist
-
-local nodecodes = nodes.nodecodes
-local tasks = nodes.tasks
-
-local properties = nodes.properties
-local attribs = node.current_attr
-
-local glyph_code = nodecodes.glyph
-local disc_code = nodecodes.disc
-local rule_code = nodecodes.rule
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
+
+local getfield = nuts.getfield
+local setfield = nuts.setfield
+local setnext = nuts.setnext
+local setprev = nuts.setprev
+local setlink = nuts.setlink
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getattr = nuts.getattr
+local setattr = nuts.setattr
+local getfont = nuts.getfont
+local getsubtype = nuts.getsubtype
+local getlist = nuts.getlist
+local setlist = nuts.setlist
+
+local nodecodes = nodes.nodecodes
+local tasks = nodes.tasks
+
+local properties = nodes.properties
+local attribs = node.current_attr
+
+local glyph_code = nodecodes.glyph
+local disc_code = nodecodes.disc
+local rule_code = nodecodes.rule
+local boundary_code = nodecodes.boundary
+local dir_code = nodecodes.dir
function nodes.striprange(first,last) -- todo: dir
if first and last then -- just to be sure
@@ -49,7 +51,7 @@ function nodes.striprange(first,last) -- todo: dir
end
while first and first ~= last do
local id = getid(first)
- if id == glyph_code or id == disc_code then -- or id == rule_code
+ if id == glyph_code or id == disc_code or id == dir_code or id == boundary_code then -- or id == rule_code
break
else
first = getnext(first)
@@ -62,7 +64,7 @@ function nodes.striprange(first,last) -- todo: dir
end
while last and last ~= first do
local id = getid(last)
- if id == glyph_code or id == disc_code then -- or id == rule_code
+ if id == glyph_code or id == disc_code or id == dir_code or id == boundary_code then -- or id == rule_code
break
else
local prev = getprev(last) -- luatex < 0.70 has italic correction kern not prev'd
@@ -123,6 +125,7 @@ local kern_code = nodecodes.kern
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local rule_code = nodecodes.rule
+local boundary_code = nodecodes.boundary
local dir_code = nodecodes.dir
local userskip_code = skipcodes.userskip
@@ -137,7 +140,6 @@ local nodepool = nuts.pool
local new_rule = nodepool.rule
local new_userrule = nodepool.userrule
local new_kern = nodepool.kern
-local new_glue = nodepool.glue
-- we can use this one elsewhere too
--
@@ -198,7 +200,7 @@ local function processwords(attribute,data,flush,head,parent) -- we have hlistdi
end
f, l, a = nil, nil, nil
end
- elseif id == disc_code then
+ elseif id == disc_code or id == boundary_code then
if f then
l = n
end
@@ -215,8 +217,12 @@ local function processwords(attribute,data,flush,head,parent) -- we have hlistdi
if list then
setlist(n,(processwords(attribute,data,flush,list,n))) -- watch ()
end
- elseif checkdir and id == dir_code then -- only changes in dir, we assume proper boundaries
- if f and a then
+-- elseif checkdir and id == dir_code then -- only changes in dir, we assume proper boundaries
+-- if f and a then
+-- l = n
+-- end
+ elseif id == dir_code then -- only changes in dir, we assume proper boundaries
+ if f then
l = n
end
elseif f then
@@ -467,10 +473,10 @@ local function flush_shifted(head,first,last,data,level,parent,strip) -- not tha
head = list
end
if prev then
- setlink(prev,list)
+ setlink(prev,list)
end
if next then
- setlink(next,list)
+ setlink(list,next)
end
local raise = data.dy * dimenfactor(data.unit,fontdata[getfont(first)])
setfield(list,"shift",raise)