summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl')
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl68
1 files changed, 68 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
new file mode 100644
index 00000000000..4563014ecfc
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
@@ -0,0 +1,68 @@
+%D \module
+%D [ file=toks-aux,
+%D version=2018.11.29,
+%D title=\CONTEXT\ Token Support,
+%D subtitle=Helpers,
+%D author=Wolfgang Schuster,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Token Support / Helpers}
+
+\unprotect
+
+%D The older \type {\scantokens} overload has been replace by a more modern one (in
+%D \LMTX):
+%D
+%D \starttyping
+%D \protected\def\whatever#1[#2](#3)\relax{oeps #1 and #2 and #3 done ## error}
+%D \scratchtoks{foo \framed{\red 123}456}
+%D
+%D \showluatokens{123\what}
+%D \showluatokens\whatever
+%D \showluatokens\framed
+%D
+%D \showluatokens\scratchtoks
+%D \showluatokens\everypar
+%D \stoptyping
+
+\registerctxluafile{toks-aux}{autosuffix}
+
+\installcorenamespace {tokenlist}
+
+\permanent\protected\def\definetokenlist[#1]%
+ {\ifcsname\??tokenlist#1\endcsname
+ \global\lastnamedcs\emptytoks
+ \else
+ \expandafter\newtoks\csname\??tokenlist#1\endcsname
+ \fi}
+
+\permanent\protected\def\starttokenlist[#1]#2\stoptokenlist
+ {\ifcsname\??tokenlist#1\endcsname \else
+ \expandafter\newtoks\csname\??tokenlist#1\endcsname
+ \fi
+ \toksapp\lastnamedcs{#2}}
+
+\aliased\let\stoptokenlist\relax
+
+\permanent\def\gettokenlist[#1]%
+ {\ifcsname\??tokenlist#1\endcsname
+ \the\lastnamedcs
+ \fi}
+
+\permanent\protected\def\settokenlist[#1]#2%
+ {\ifcsname\??tokenlist#1\endcsname \else
+ \expandafter\newtoks\csname\??tokenlist#1\endcsname
+ \fi
+ \toksapp\lastnamedcs{#2}}
+
+\permanent\protected\def\resettokenlist[#1]%
+ {\ifcsname\??tokenlist#1\endcsname
+ \lastnamedcs\emptytoks
+ \fi}
+
+\protect