[latex3-commits] [git/LaTeX3-latex3-latex3] docstrip: Update frozen DocStrip to latest release (1b616e24d)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Feb 25 13:53:55 CET 2021
Repository : https://github.com/latex3/latex3
On branch : docstrip
Link : https://github.com/latex3/latex3/commit/1b616e24d830b611cce9db2003ed2aaa7fd65ccb
>---------------------------------------------------------------
commit 1b616e24d830b611cce9db2003ed2aaa7fd65ccb
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Feb 25 12:50:48 2021 +0000
Update frozen DocStrip to latest release
>---------------------------------------------------------------
1b616e24d830b611cce9db2003ed2aaa7fd65ccb
support/docstrip.tex | 60 ++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 51 insertions(+), 9 deletions(-)
diff --git a/support/docstrip.tex b/support/docstrip.tex
index 58eb8a148..e670198de 100644
--- a/support/docstrip.tex
+++ b/support/docstrip.tex
@@ -13,7 +13,7 @@
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
-%% Copyright 1993-2017
+%% Copyright (C) 1993-2020
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
@@ -26,7 +26,7 @@
%% The latest version of this license is in
%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
+%% version 2008 or later.
%%
%% This file has the LPPL maintenance status "maintained".
%%
@@ -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 at name#1{"\quote@@name#1\@gobble""}
+\def\quote@@name#1"{#1\quote@@name}
\chardef\stream at closed=16
\def\StreamOpen#1{%
\chardef#1=\stream at closed
\def\s at 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 at curr@file{%
+ \expandafter\expandafter\expandafter\quote at name
+ \expandafter\expandafter\expandafter{\csname pth@\@stripstring#1\endcsname}}
+ \immediate\openout#1=\q at curr@file\relax
\@streamfound
\fi}
\@outputstreams
@@ -351,6 +356,7 @@ Z
\advance\codeLinesPassed\@ne
\maybeMsg{.}%
\def\inLine{#1}%
+ \replaceModuleInLine
\let\do\putline at 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
More information about the latex3-commits
mailing list.