From 081b1c0da58e16ccc2583b2417048d1849508606 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 30 Nov 2011 23:02:47 +0000 Subject: ydoc (19nov11) git-svn-id: svn://tug.org/texlive/trunk@24709 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/ydoc/ydocincl.tex | 106 +++++++++++++++++++++++ Master/texmf-dist/tex/generic/ydoc/ydocstrip.tex | 83 ++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 Master/texmf-dist/tex/generic/ydoc/ydocincl.tex create mode 100644 Master/texmf-dist/tex/generic/ydoc/ydocstrip.tex (limited to 'Master/texmf-dist/tex/generic/ydoc') diff --git a/Master/texmf-dist/tex/generic/ydoc/ydocincl.tex b/Master/texmf-dist/tex/generic/ydoc/ydocincl.tex new file mode 100644 index 00000000000..1a1f0b5c00f --- /dev/null +++ b/Master/texmf-dist/tex/generic/ydoc/ydocincl.tex @@ -0,0 +1,106 @@ +%% +%% This is file `ydocincl.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `ydocincl.tex') +%% +\expandafter\ifx\csname ydocinclversion\endcsname\relax\else + \endinput +\fi + +\chardef\ydocinclversion=1 + +\newread\inFile +\newread\subFile +\newwrite\outFile +\newif\ifContinue +\newlinechar=`^^J + +\def\makeOther#1{\catcode`#1=12\relax} + +\let\inLine\relax +\let\lastLine\relax + +\def\includefiles#1#2{% + \begingroup + \immediate\openin\inFile#1\relax + \immediate\openout\outFile#2\relax + \makeOther\@% + \makeOther\ \makeOther\\\makeOther\$% + \makeOther\#\makeOther\^\makeOther\^^K% + \makeOther\_\makeOther\^^A\makeOther\%% + \makeOther\~\makeOther\{\makeOther\}\makeOther\&% + \endlinechar-1\relax + \Continuetrue + \loop + \let\lastLine\inLine + \read\inFile to\inLine + \ifeof\inFile + \Continuefalse + \else + \expandafter\checkLine\inLine\empty\empty\empty\endLine + \fi + \ifContinue + \repeat + \immediate\closein\inFile + \immediate\closeout\outFile + \endgroup + \end +} + +\def\copyline{% + \immediate\write\outFile{\inLine}% +} + +\chardef\percentcharnum=`\% + +\begingroup +\makeOther\%\makeOther\@\relax +\gdef\SubFileOptionString{%<@}\relax +\gdef\CommentChar{%}\relax +\catcode`\|=0 +\makeOther\ \makeOther\\|relax +|gdef|IfFalseString{% \iffalse}|relax +|gdef|FiString{% \fi}|relax +|endgroup + +\def\checkLine#1#2#3#4\endLine{% + \def\firstthree{#1#2#3}% + \ifx\firstthree\SubFileOptionString + \readSubFile#4\endLine + \else + \copyline + \fi +} + +\def\readSubFile#1>#2\endLine{% + \immediate\openin\subFile=#1\relax + \ifeof\subFile + % File not found + \else + \message{^^JIncluding subfile '#1'^^J}% + \immediate\write\outFile{\CommentChar<*#1>}% + \ifx\lastLine\IfFalseString + \immediate\write\outFile{\FiString}% + \fi + \copySubFile + \ifx\lastLine\IfFalseString + \immediate\write\outFile{\IfFalseString}% + \fi + \immediate\write\outFile{\CommentChar}% + \fi + \immediate\closein\subFile +} + +\def\copySubFile{% + \read\subFile to\subLine + \ifeof\subFile\else + \immediate\write\outFile{\subLine}% + \expandafter\copySubFile + \fi +} +\endinput +%% +%% End of file `ydocincl.tex'. diff --git a/Master/texmf-dist/tex/generic/ydoc/ydocstrip.tex b/Master/texmf-dist/tex/generic/ydoc/ydocstrip.tex new file mode 100644 index 00000000000..6d27fd42d0c --- /dev/null +++ b/Master/texmf-dist/tex/generic/ydoc/ydocstrip.tex @@ -0,0 +1,83 @@ +%% +%% This is file `ydocstrip.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `ydocstrip.tex') +%% +\expandafter\ifx\csname ydocstripversion\endcsname\relax\else + \endinput +\fi + +\chardef\ydocstripversion=1 + +\input docstrip + +\def\checkOption<#1{% + \ifcase + \ifx*#10\else \ifx/#11\else + \ifx+#12\else \ifx-#13\else + \ifx<#14\else + \ifx=#15\else + \ifx!#16\else + 10\fi\fi\fi\fi\fi\fi\fi\relax + \expandafter\starOption\or + \expandafter\slashOption\or + \expandafter\plusOption\or + \expandafter\minusOption\or + \expandafter\verbOption\or + \expandafter\varOption\or + \expandafter\valueOption\else + \expandafter\doOption\fi + #1} + +\def\varOption =#1#2>#3\endLine{{% + \ifx*#1\relax + \edef\varStop{\perCent<=/#2>}% + \global\expandafter\let\csname ydocstrip@var@#2\endcsname\empty% + \expandafter\def\csname ydocstrip@var@#2\endcsname##1{}% + \loop + \ifeof\inFile + \errmessage{Source file ended while reading a multi-line variable content!}% + \fi + \read\inFile to \inLine + \if 1\ifx\inLine\varStop 0\fi 1% if not inLine==varStop + \expandafter\xdef\csname ydocstrip@var@#2\endcsname{\csname ydocstrip@var@#2\endcsname^^J\inLine}% + \maybeMsg{.}% + \repeat + \else + \ifx/#1\relax + \errmessage{Error in expression: spurious '<=/#2>'}% + \else + \ifx+#1\relax + \expandafter\ifx\csname ydocstrip@var@#2\endcsname\relax + \expandafter\xdef\csname ydocstrip@var@#2\endcsname{#3}% + \else + \expandafter\xdef\csname ydocstrip@var@#2\endcsname{\csname ydocstrip@var@#2\endcsname^^J#3}% + \fi + \else + \expandafter\gdef\csname ydocstrip@var@#1#2\endcsname{#3}% + \fi + \fi + \fi +}} + +\def\valueOption !#1>#2\endLine{% + \begingroup + \expandafter\let\expandafter\var\csname ydocstrip@var@#1\endcsname + \ifx\var\relax + \errmessage{Used variable '#1' was never defined!}% + \else + \ifx\var\empty\else + \def\do##1##2##3{% + \StreamPut##1{\csname ydocstrip@var@#1\endcsname}% + }% + \activefiles + \fi + \fi + \endgroup +} +\endinput +%% +%% End of file `ydocstrip.tex'. -- cgit v1.2.3