summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-res.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-06-04 17:42:38 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-06-04 17:42:38 +0200
commit32f8047624c2fa49c3031a66edb5a039a813f276 (patch)
treed568ec496e3b4c95adc37ce435b0161a3f40c581 /tex/context/base/mkiv/node-res.lua
parent3ab20dbdfa095edd8c6bc00b8e3bdccd78900257 (diff)
downloadcontext-32f8047624c2fa49c3031a66edb5a039a813f276.tar.gz
2017-06-04 17:01:00
Diffstat (limited to 'tex/context/base/mkiv/node-res.lua')
-rw-r--r--tex/context/base/mkiv/node-res.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua
index 8b7ec1a62..858408bd9 100644
--- a/tex/context/base/mkiv/node-res.lua
+++ b/tex/context/base/mkiv/node-res.lua
@@ -26,6 +26,7 @@ local skipcodes = nodes.skipcodes
local kerncodes = nodes.kerncodes
local rulecodes = nodes.rulecodes
local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
local boundarycodes = nodes.boundarycodes
local usercodes = nodes.usercodes
@@ -86,6 +87,8 @@ local setpenalty = nuts.setpenalty
local setdir = nuts.setdir
local setshift = nuts.setshift
local setwidth = nuts.setwidth
+local setsubtype = nuts.setsubtype
+local setleader = nuts.setleader
local copy_nut = nuts.copy
local new_nut = nuts.new
@@ -183,6 +186,8 @@ local noad = register_nut(new_nut("noad"))
local boundary = register_nut(new_nut("boundary",boundarycodes.user))
local wordboundary = register_nut(new_nut("boundary",boundarycodes.word))
+local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,gluecodes.cleaders) setglue(cleader,0,65536,0,2,0)
+
-- the dir field needs to be set otherwise crash:
local rule = register_nut(new_nut("rule")) setdir(rule, "TLT")
@@ -362,6 +367,18 @@ function nutpool.userrule(width,height,depth,dir) -- w/h/d == nil will let them
return n
end
+function nutpool.leader(width,list)
+ local n = copy_nut(cleader)
+ if width then
+ setwidth(n,width)
+ end
+ if list then
+ setleader(n,list)
+ end
+ return n
+end
+
+
function nutpool.latelua(code)
local n = copy_nut(latelua)
setfield(n,"string",code)