summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv31
1 files changed, 24 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv
index 5c7b3d503dd..9f966349c15 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-nod.mkiv
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\registerctxluafile{meta-nod}{}
+
\unprotect
\defineMPinstance
@@ -105,6 +107,11 @@
\let\stopnodes\relax
+%D Hm, we started out simple but it now quickly becomes the usual mess of
+%D \TEX, \METAPOST\ and \LUA. Hard to understand.
+
+\newcount\c_meta_nodes_n
+
\unexpanded\def\startnodes
{\dosingleempty\meta_nodes_start}
@@ -116,10 +123,12 @@
\edef\p_meta_option{\metanodesparameter\c!option}%
\edef\p_meta_alternative{\metanodesparameter\c!alternative}%
\the\t_every_meta_nodes
+ \c_meta_nodes_n\zerocount
\t_meta_nodes\emptytoks
#2\removeunwantedspaces
% for alan, will be commented:
\writestatus{metanodes}{\detokenize\expandafter{\the\t_meta_nodes}}%
+ \clf_grph_nodes_initialize
\startMPcode
mfun_node_init(%
\the\dimexpr\metanodesparameter\c!dx\relax,%
@@ -129,11 +138,9 @@
\the\t_meta_nodes ;
mfun_node_flush ;
\stopMPcode
+ \clf_grph_nodes_reset
\egroup}
-% \unexpanded\def\grph_nodes_node[#1,#2]#3%
-% {\etoksapp\t_meta_nodes{mfun_node_make(\number#1,\number#2,"\metanodesparameter\c!command{#3}");}}
-
\unexpanded\def\grph_nodes_node
{\dodoubleempty\grph_nodes_node_two}
@@ -146,13 +153,20 @@
\setupcurrentmetanodes[#3]%
\fi
\edef\p_label{#4}%
+ \edef\p_reference{\metanodesparameter\c!reference}%
+ \ifx\p_reference\empty\else
+ \clf_grph_nodes_register{\p_reference}\c_meta_nodes_n\relax
+ \fi
\normalexpanded{\endgroup\noexpand\etoksapp\t_meta_nodes{%
mfun_node_make(\number#1,\number#2%
- \ifx\p_label\empty \else
+ \ifx\p_label\empty
+ ,""%
+ \else
,"\metanodesparameter\c!command{\p_label}"%
\fi
);%
- }}}
+ }}%
+ \advance\c_meta_nodes_n\plusone}
\appendtoks
\let\placenode\grph_nodes_node
@@ -199,8 +213,11 @@
\space
mfun_nodes_fromto\begincsname\??metanodesposition\metanodesparameter\c!position\endcsname(%
\metanodesparameter\c!offset,%
- \number#1,\number#2%
- \ifx\p_label\empty \else
+ % \number#1,\number#2%
+ \clf_grph_nodes_resolve{#1},\clf_grph_nodes_resolve{#2}%
+ \ifx\p_label\empty
+ ,""%
+ \else
,"\ifx\p_command\empty\p_label\else\p_command{\p_label}\fi"%
\fi
)%