summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/base/docstrip.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/base/docstrip.tex')
-rw-r--r--Master/texmf-dist/tex/latex/base/docstrip.tex56
1 files changed, 49 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/base/docstrip.tex b/Master/texmf-dist/tex/latex/base/docstrip.tex
index feb04768b2c..e670198de27 100644
--- a/Master/texmf-dist/tex/latex/base/docstrip.tex
+++ b/Master/texmf-dist/tex/latex/base/docstrip.tex
@@ -44,9 +44,9 @@
\catcode`\{=1
\catcode`\}=2
\def\filename{docstrip.dtx}
-\def\fileversion{2.5g}
-\def\filedate{2018/05/03}
-\def\docdate {2018/05/03}
+\def\fileversion{v2.6a}
+\def\filedate{2020-07-07}
+\def\docdate {2020-07-11}
%%
%% The docstrip program for use with TeX.
%% Copyright (C) 1989-1991 Frank Mittelbach
@@ -54,7 +54,7 @@
%% Frank Mittelbach
%% Copyright (C) 1995 Marcin Woli\'nski
%% Copyright (C) 1996-1997 Mark Wooding, Marcin Woli\'nski
-%% Copyright (C) 1998-2003 LaTeX3 project and the above authors
+%% Copyright (C) 1998-2020 LaTeX3 project and the above authors
%% All rights are reserved.
%%
\catcode`\Z=\catcode`\%
@@ -219,13 +219,18 @@ Z
\bgroup\edef\x{\egroup
\def\noexpand\@stripstr\string\s@{}}
\x
+\def\quote@name#1{"\quote@@name#1\@gobble""}
+\def\quote@@name#1"{#1\quote@@name}
\chardef\stream@closed=16
\def\StreamOpen#1{%
\chardef#1=\stream@closed
\def\s@do##1{\ifnum##1=0
\chardef#1=\expandafter\@stripstr\string##1 %
\global\chardef##1=1 %
- \immediate\openout#1=\csname pth@\@stripstring#1\endcsname %
+ \edef\q@curr@file{%
+ \expandafter\expandafter\expandafter\quote@name
+ \expandafter\expandafter\expandafter{\csname pth@\@stripstring#1\endcsname}}
+ \immediate\openout#1=\q@curr@file\relax
\@streamfound
\fi}
\@outputstreams
@@ -351,6 +356,7 @@ Z
\advance\codeLinesPassed\@ne
\maybeMsg{.}%
\def\inLine{#1}%
+ \replaceModuleInLine
\let\do\putline@do
\activefiles
}
@@ -392,19 +398,23 @@ Z
\ifcase
\ifx*#10\else \ifx/#11\else
\ifx+#12\else \ifx-#13\else
- \ifx<#14\else 5\fi\fi\fi\fi\fi\relax
+ \ifx<#14\else \ifx @#15\else 6\fi\fi\fi\fi\fi\fi\relax
\expandafter\starOption\or
\expandafter\slashOption\or
\expandafter\plusOption\or
\expandafter\minusOption\or
\expandafter\verbOption\or
+ \expandafter\moduleOption\or
\expandafter\doOption\fi
#1}
\def\doOption#1>#2\endLine{%
\maybeMsg{<#1 . >}%
\Evaluate{#1}%
\def\do##1##2##3{%
- \if1\Expr{##2}\StreamPut##1{#2}\fi
+ \if1\Expr{##2}%
+ \def\inLine{#2}%
+ \replaceModuleInLine
+ \StreamPut##1{\inLine}\fi
}%
\activefiles
}
@@ -480,6 +490,38 @@ Z
\repeat
\maybeMsg{>}%
}}
+\def\moduleOption @@=#1>#2\endLine{%
+ \maybeMsg{<@@=#1>}%
+ \prepareActiveModule{#1}%
+}
+\begingroup
+ \catcode`\_ = 12 %
+ \long\gdef\prepareActiveModule#1{%
+ \ifx\relax#1\relax
+ \let\replaceModuleInLine\empty
+ \else
+ \edef\replaceModuleInLine{%
+ \noexpand\replaceAllIn\noexpand\inLine{@@@@}{\string aa}%
+ \noexpand\replaceAllIn\noexpand\inLine{__@@}{__#1}%
+ \noexpand\replaceAllIn\noexpand\inLine{_@@}{__#1}%
+ \noexpand\replaceAllIn\noexpand\inLine{@@}{__#1}%
+ \noexpand\replaceAllIn\noexpand\inLine{\string aa}{@@}%
+ }%
+ \fi
+ }
+\endgroup
+\let\replaceModuleInLine\empty
+\long\def\replaceAllIn#1#2#3{%
+ \long\def\tempa##1##2#2{%
+ ##2\qMark\replaceAllInAuxIII#3##1%
+ }%
+ \edef#1{\expandafter\replaceAllInAuxI#1\qMark#2\qStop}%
+}
+\def\replaceAllInAuxI{%
+ \expandafter\replaceAllInAuxII\tempa\replaceAllInAuxI\empty
+}
+\long\def\replaceAllInAuxII#1\qMark#2{#1}
+\long\def\replaceAllInAuxIII#1\qStop{}
\def\generate#1{\begingroup
\let\inputfiles\empty \let\filestogenerate\empty
\let\file\@file