diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:11:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:11:23 +0000 |
commit | 30a6d6092969e0ee1d89954510328f558a8bfd89 (patch) | |
tree | c583c6a1068f3220c92d2bbd5655416d245af172 /Master/texmf-dist/tex/latex/williams/toklist.sty | |
parent | 8efc7befb502932dd3f859ab4a3b2914f3198b01 (diff) |
williams
git-svn-id: svn://tug.org/texlive/trunk@1451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/williams/toklist.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/williams/toklist.sty | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/williams/toklist.sty b/Master/texmf-dist/tex/latex/williams/toklist.sty new file mode 100644 index 00000000000..ddc35149b17 --- /dev/null +++ b/Master/texmf-dist/tex/latex/williams/toklist.sty @@ -0,0 +1,25 @@ +% Impliment token list macros from pages 378-379 of "The TeXbook" by D.E. Knuth +% ISBN 0-201-13448-9 + +\newtoks\TOKL@ta +\newtoks\TOKL@tb +\long\def\TOKL@prepend#1\to#2{\TOKL@ta={\\{#1}}\TOKL@tb=\expandafter{#2}% + \edef#2{\the\TOKL@ta\the\TOKL@tb}} +\long\def\TOKL@prependv#1\to#2{\TOKL@ta={\\}\TOKL@tb=\expandafter{#2}% + \edef#2{\the\TOKL@ta{#1}\the\TOKL@tb}} +\long\def\TOKL@append#1\to#2{\TOKL@ta={\\{#1}}\TOKL@tb=\expandafter{#2}% + \edef#2{\the\TOKL@tb\the\TOKL@ta}} +\long\def\TOKL@appendv#1\to#2{\TOKL@ta={\\}\TOKL@tb=\expandafter{#2}% + \edef#2{\the\TOKL@tb\the\TOKL@ta{#1}}} +\def\TOK@concat#1=#2{\TOK@ta=\expandafter{#2}\TOK@tb=\expandafter{#3}% + \edef#1{\the\TOKL@ta\the\TOKL@tb}} + +\def\TOKL@lop#1\to#2{\expandafter\TOKL@lopoff#1\TOKL@lopoff#1#2} +\long\def\TOKL@lopoff\\#1#2\TOKL@lopoff#3#4{\def#4{#1}\def#3{#2}} + +\def\TOK@card#1\to#2{#2=0 \long\def\\##1{\advance#2 by 1 }#1} + +\def\TOK@select#1\of#2\to#3{\def#3{\outofrange}% + \long\def\\##1{\advance#1-1 \ifnum#1=0 \def#3{##1}\fi}#2} + +\def\TOK@empty#1{\ifx#1\empty true\else false\fi} |