diff options
author | Marius <mariausol@gmail.com> | 2010-07-04 15:32:09 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-07-04 15:32:09 +0300 |
commit | 85b7bc695629926641c7cb752fd478adfdf374f3 (patch) | |
tree | 80293f5aaa7b95a500a78392c39688d8ee7a32fc /tex/context/base/type-run.mkii | |
download | context-85b7bc695629926641c7cb752fd478adfdf374f3.tar.gz |
stable 2010-05-24 13:10
Diffstat (limited to 'tex/context/base/type-run.mkii')
-rw-r--r-- | tex/context/base/type-run.mkii | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tex/context/base/type-run.mkii b/tex/context/base/type-run.mkii new file mode 100644 index 000000000..1b64c102e --- /dev/null +++ b/tex/context/base/type-run.mkii @@ -0,0 +1,51 @@ +%D \module +%D [ file=type-run, +%D version=2001.04.20, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\typetypescript + {\dotripleempty\dotypetypescript} + +\gdef\dotypetypescript[#1][#2][#3]% + {\bgroup + \def\dochecktypescript##1##2% script use + {\doifelsenothing{##1##2} + {\donetrue} + {\ExpandBothAfter\doifcommonelse{##1}{##2}\donetrue\donefalse}} + \edef\typescriptone {\truetypescript{#1}}% + \edef\typescripttwo {\truetypescript{#2}}% + \edef\typescriptthree{\truetypescript{#3}}% + \def\starttypescript + {\bgroup + \obeylines % else we loose the first line due to lookahead + \dotripleempty\dostarttypescript} + \def\dostarttypescript[##1][##2][##3]% + {\long\def\next####1\stoptypescript{\egroup} + \dochecktypescript{##1}\typescriptone \ifdone + \dochecktypescript{##2}\typescripttwo \ifdone + \dochecktypescript{##3}\typescriptthree\ifdone + \def\next% + {\def\stoptypescript{\egroup\type{\stoptypescript}} + % what follows now is quite ugly + \skipfirstverbatimlinefalse + \type{\starttypescript} + \doifsomething{##1}{\type{[##1]}} + \doifsomething{##2}{\type{[##2]}} + \doifsomething{##3}{\type{[##3]}} + \processdisplayverbatim{\stoptypescript}}% + \fi\fi\fi + \next} + \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript + \egroup} + +\protect \endinput |