summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/node-tsk.lmt
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-11-05 13:35:55 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-11-05 13:35:55 +0100
commitce22f093d2d9af63927792e2a821e81a49a2ca10 (patch)
tree6957d03f5c5723a60e62716250c8e2d0e772c9d0 /tex/context/base/mkxl/node-tsk.lmt
parentca2f0f64dbb46140d36db84ac6e1b6079a386cfa (diff)
downloadcontext-ce22f093d2d9af63927792e2a821e81a49a2ca10.tar.gz
2021-11-05 12:35:00
Diffstat (limited to 'tex/context/base/mkxl/node-tsk.lmt')
-rw-r--r--tex/context/base/mkxl/node-tsk.lmt77
1 files changed, 71 insertions, 6 deletions
diff --git a/tex/context/base/mkxl/node-tsk.lmt b/tex/context/base/mkxl/node-tsk.lmt
index dfa1e9475..ca18c9c3b 100644
--- a/tex/context/base/mkxl/node-tsk.lmt
+++ b/tex/context/base/mkxl/node-tsk.lmt
@@ -710,6 +710,7 @@ nonut = [[
]],
}
+
}
tasks.new {
@@ -762,6 +763,8 @@ nonut = [[
}
+-- these operate on the content on a line, so no injections
+
tasks.new {
name = "contributers",
processor = nodeprocessor,
@@ -784,31 +787,93 @@ local tonode = nodes.nuts.tonode
%localize%
+-- we operate exclusively on nuts (no index yet)
+
+return function(head,where,tail)
+ local nuthead = tonut(head)
+ local nuttail = tonut(tail)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),where,tonode(nuttail))))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,where,nuttail)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),where,tonode(nuttail))
+]],
+
+nonut = [[
+ %action%(nuthead,where,nuttail)
+]],
+
+ }
+
+}
+
+ tasks.new {
+ name = "adjusters",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+local nodetail = nodes.nuts.tail
+
+%localize%
+
-- we operate exclusively on nuts
-return function(nuthead,groupcode,nutline)
+return function(head,where,tail,index)
+ local nuthead = tonut(head)
+ local nuttail = tonut(tail)
+
%actions%
- return nuthead
+ return tonode(nuthead)
end
]],
step = [[
- nuthead = tonut((%action%(tonode(nuthead),groupcode,line)))
+ nuthead = tonut((%action%(tonode(nuthead),where,tonode(nuttail),index)))
+ nuttail = nodetail(nuthead)
]],
nut = [[
- nuthead = %action%(nuthead,groupcode,nutline)
+ nuthead = %action%(nuthead,where,nuttail,index)
+ nuttail = nodetail(nuthead)
]],
nohead = [[
- %action%(tonode(nuthead),groupcode,line)
+ %action%(tonode(nuthead),where,tonode(nuttail),index)
+ nuttail = nodetail(nuthead)
]],
nonut = [[
- %action%(nuthead,groupcode,nutline)
+ %action%(nuthead,where,nuttail,index)
+ nuttail = nodetail(nuthead)
]],
}
+
}
-- -- math -- --