toks-aux.mkiv /size: 1278 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=toks-aux,
3%D        version=2018.11.29,
4%D          title=\CONTEXT\ Token Support,
5%D       subtitle=Helpers,
6%D         author=Wolfgang Schuster,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Token Support / Helpers}
15
16\unprotect
17
18\installcorenamespace {tokenlist}
19
20\unexpanded\def\definetokenlist[#1]%
21  {\ifcsname\??tokenlist#1\endcsname
22     \global\lastnamedcs\emptytoks
23   \else
24     \expandafter\newtoks\csname\??tokenlist#1\endcsname
25   \fi}
26
27\unexpanded\def\starttokenlist[#1]#2\stoptokenlist
28  {\ifcsname\??tokenlist#1\endcsname \else
29     \expandafter\newtoks\csname\??tokenlist#1\endcsname
30   \fi
31   \toksapp\lastnamedcs{#2}}
32
33\let\stoptokenlist\relax
34
35\def\gettokenlist[#1]%
36  {\ifcsname\??tokenlist#1\endcsname
37     \the\lastnamedcs
38   \fi}
39
40\def\settokenlist[#1]#2%
41  {\ifcsname\??tokenlist#1\endcsname \else
42     \expandafter\newtoks\csname\??tokenlist#1\endcsname
43   \fi
44   \toksapp\lastnamedcs{#2}}
45
46\unexpanded\def\resettokenlist[#1]%
47  {\ifcsname\??tokenlist#1\endcsname
48     \lastnamedcs\emptytoks
49   \fi}
50
51\protect
52