summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/meta-nod.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/meta-nod.lua')
-rw-r--r--tex/context/base/mkiv/meta-nod.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/meta-nod.lua b/tex/context/base/mkiv/meta-nod.lua
new file mode 100644
index 000000000..119c276e2
--- /dev/null
+++ b/tex/context/base/mkiv/meta-nod.lua
@@ -0,0 +1,29 @@
+if not modules then modules = { } end modules ['meta-nod'] = {
+ version = 1.001,
+ comment = "companion to meta-nod.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local references = { }
+
+metapost.nodes = {
+
+ initialize = function()
+ references = { }
+ end,
+
+ register = function(s,r)
+ references[s] = r
+ end,
+
+ resolve = function(s)
+ context(references[s] or ("\\number " .. (tonumber(s) or 0)))
+ end,
+
+ reset = function()
+ references = { }
+ end,
+
+}