texlive[69274] Master/texmf-dist: eolang (2jan24)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 2 22:24:41 CET 2024


Revision: 69274
          https://tug.org/svn/texlive?view=revision&revision=69274
Author:   karl
Date:     2024-01-02 22:24:41 +0100 (Tue, 02 Jan 2024)
Log Message:
-----------
eolang (2jan24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/eolang/eolang.pdf
    trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx
    trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty

Modified: trunk/Master/texmf-dist/doc/latex/eolang/eolang.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx	2024-01-02 21:24:32 UTC (rev 69273)
+++ trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx	2024-01-02 21:24:41 UTC (rev 69274)
@@ -50,7 +50,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{eolang}
 %<*package>
-[2023-12-28 0.17.0 Formulas and Graphs for EO Programming Language]
+[2024-01-02 0.17.1 Formulas and Graphs for EO Programming Language]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -84,16 +84,19 @@
 % \maketitle
 %
 % \textbf{\color{red}NB!}
-% You must run \TeX{} processor with |--shell-escape| option
+% You must run \TeX{} processor with |-shell-escape| option
 % and you must have \href{https://www.perl.org}{Perl} installed.
-% If you omit the |--shell-escape| option, the package will try
+% If you omit the |-shell-escape| option, the package will try
 % to use cached files, if they exist. If they don't, compilation will
-% crash. Thus, when you must prepare your document for a compilation
-% without the |--shell-escape| option, run it locally with the option
-% and then package all files (including the files in the |_eolang| directory)
-% into a single ZIP archive.
+% fail. Thus, when you must prepare your document for a compilation
+% without the |-shell-escape| option, run it locally with the option provided
+% and then package all files (including the files in the |_eolang-*| directories)
+% into a single ZIP archive. It is advised to use |tmpdir| package option
+% in this case, in order to make the directory name not depend on the
+% \LaTeX{} engine.
 %
-% If |--shell-escape| is set, this package doesn't work on Windows.
+% If |-shell-escape| is set, this package won't work on Windows, because
+% it uses POSIX command line interface.
 
 % \section{Introduction}
 %
@@ -778,12 +781,21 @@
 
 % Then, we make a directory where all temporary files will be kept:
 %    \begin{macrocode}
-\ifnum\ShellEscapeStatus=1%
-  \iexec[null]{mkdir -p "\eolang at tmpdir/\jobname"}%
-\else%
-  \message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
-    is not created, because --shell-escape is not set^^J}%
-\fi%
+\RequirePackage{shellesc}
+\IfFileExists
+  {\eolang at tmpdir/\jobname}
+  {\message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
+    already exists^^J}}
+  {%
+    \ifnum\ShellEscapeStatus=1%
+      \iexec[null]{mkdir -p "\eolang at tmpdir/\jobname"}%
+    \else%
+      \message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
+        is not created, because -shell-escape is not set, and
+        it doesn't exist, most probably the compilation
+        will fail later^^J}%
+    \fi%
+  }
 %    \end{macrocode}
 
 % \begin{macro}{\eolang at lineno}
@@ -805,7 +817,7 @@
 %    \end{macrocode}
 % \end{macro}
 
-% \begin{macro}{eolang-phi.pl}
+% \begin{macro}{-phi.pl}
 % \changes{0.0.2}{2022/10/21}{The symbols ``\texttt{[}'' and ``\texttt{]}'' replaced with ``\texttt{[[}'' and ``\texttt{]]}'' for abstract object brackets, because they conflicted with normal square brackets}
 % \changes{0.0.2}{2022/10/21}{New symbol added for basket slots}
 % \changes{0.0.2}{2022/10/21}{Parsing of the symbols ``\texttt{@},'' ``\texttt{\^{}},'' and ``\texttt{\&}'' enabled (\texttt{\char`\\varphi}, \texttt{\char`\\rho}, and \texttt{\char`\\sigma})}
@@ -828,11 +840,17 @@
 % \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
 %    \begin{macrocode}
 \makeatletter
-\begin{VerbatimOut}{\eolang at tmpdir/eolang-phi.pl}
+\openin 15=\eolang at tmpdir/\jobname-phi.pl
+\ifeof 15
+\message{eolang: Perl script is going to be created,
+  because it is absent at "\eolang at tmpdir/\jobname-phi.pl",
+  but if -shell-escape is not set, the compilation will
+  most likely fail now^^J}
+\begin{VerbatimOut}{\eolang at tmpdir/\jobname-phi.pl}
 $macro = $ARGV[0];
 open(my $fh, '<', $ARGV[1]);
 my $tex; { local $/; $tex = <$fh>; }
-print "% This file is auto-generated by 0.17.0\n";
+print "% This file is auto-generated by 0.17.1\n";
 print '% There are ', length($tex),
   ' chars in the input: ', $ARGV[1], "\n";
 print '% ---', "\n";
@@ -909,9 +927,9 @@
 $tex =~ s/([^\\{a-z0-9]|^)L>/\1\\lambda{}..>/g;
 $tex =~ s/"([^"]+)"/|"\1"|/g;
 $tex =~ s/(^|(?<=[\s)(\]\[,.>\/]))([a-zA-Z][a-z0-9]+)(?=[\s)(\]\[,.-]|$)/|\2|/g;
-$tex =~ s/([^^_]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
+$tex =~ s/([^_^]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\vert{}\3\\space{}\4/xg;
-$tex =~ s/([^^_]|^)([0-9]+|\*)
+$tex =~ s/([^_^]|^)([0-9]+|\*)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\space{}\3/xg;
 if ($macro ne 'phiq') {
   if (not $splitting) {
@@ -999,7 +1017,12 @@
 print '\endinput';
 \end{VerbatimOut}
 \message{eolang: File with Perl script
-  '\eolang at tmpdir/eolang-phi.pl' saved^^J}%
+  '\eolang at tmpdir/\jobname-phi.pl' saved^^J}
+\else
+  \message{eolang: Perl script already exists at
+    "\eolang at tmpdir/\jobname-phi.pl"^^J}
+\fi
+\closein 15
 \makeatother
 %    \end{macrocode}
 % \end{macro}
@@ -1027,7 +1050,7 @@
       \input{#1}}
     {%
       \ifnum\ShellEscapeStatus=1\else%
-        \message{eolang: The --shell-escape command line
+        \message{eolang: The -shell-escape command line
         option is not provided, most probably compilation
         will fail now:^^J}%
       \fi%
@@ -1053,7 +1076,7 @@
         "\eolang at tmpdir/\jobname/\hash.tex"}%
       \message{Start parsing 'phi' at line no. \the\inputlineno^^J}
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
-        perl "\eolang at tmpdir/eolang-phi.pl"
+        perl "\eolang at tmpdir/\jobname-phi.pl"
         '#1'
         "\eolang at tmpdir/\jobname/\hash.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
@@ -1097,7 +1120,7 @@
       \iexec[quiet,null]{cp "\eolang at tmpdir/\jobname/phiq.tex"
         "\eolang at tmpdir/\jobname/\hash-phiq.tex"}%
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-phiq-post.tex]{
-        perl \eolang at tmpdir/eolang-phi.pl 'phiq'
+        perl \eolang at tmpdir/\jobname-phi.pl 'phiq'
         "\eolang at tmpdir/\jobname/\hash-phiq.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g' \fi}%
     }%
@@ -1120,7 +1143,7 @@
 %    \end{macrocode}
 % \end{macro}
 
-% \begin{macro}{eolang-sodg.pl}
+% \begin{macro}{-sodg.pl}
 % \changes{0.0.2}{2022/10/24}{The Perl file now has a fixed name, which doesn't depend on the name of the TeX job. This file may be shared among jobs, no need to make it uniquely named.}
 % \changes{0.1.0}{2022/10/26}{There are two Perl scripts now: one for \texttt{phiquation}, another one for \texttt{sodg}.}
 % \changes{0.2.0}{2022/10/28}{The content of the \texttt{atom} and the \texttt{data} boxes is parsed automatically as formulas and numbers, respectively.}
@@ -1140,7 +1163,13 @@
 % \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
 %    \begin{macrocode}
 \makeatletter
-\begin{VerbatimOut}{\eolang at tmpdir/eolang-sodg.pl}
+\openin 15=\eolang at tmpdir/\jobname-sodg.pl
+\ifeof 15
+\message{eolang: Perl script is going to be created,
+  because it is absent at "\eolang at tmpdir/\jobname-sodg.pl",
+  but if -shell-escape is not set, the compilation will
+  most likely fail now^^J}
+\begin{VerbatimOut}{\eolang at tmpdir/\jobname-sodg.pl}
 sub num {
   my ($i) = @_;
   $i =~ s/(\+|-)\./\10./g;
@@ -1413,7 +1442,12 @@
 print '\endinput';
 \end{VerbatimOut}
 \message{eolang: File with Perl script
-  '\eolang at tmpdir/eolang-sodg.pl' saved^^J}%
+  '\eolang at tmpdir/\jobname-sodg.pl' saved^^J}
+\else
+  \message{eolang: Perl script already exists at
+    "\eolang at tmpdir/\jobname-sodg.pl"^^J}
+\fi
+\closein 15
 \makeatother
 %    \end{macrocode}
 % \end{macro}
@@ -1559,7 +1593,7 @@
         "\eolang at tmpdir/\jobname/\hash.tex"}%
       \message{eolang: Start parsing `sodg' at line no. \the\inputlineno^^J}
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-sodg-post.tex]{
-        perl "\eolang at tmpdir/eolang-sodg.pl"
+        perl "\eolang at tmpdir/\jobname-sodg.pl"
         "\eolang at tmpdir/\jobname/\hash.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
         \ifdefined\eolang at sodgSaveTo > \eolang at sodgSaveTo\fi}%

Modified: trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2024-01-02 21:24:32 UTC (rev 69273)
+++ trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2024-01-02 21:24:41 UTC (rev 69274)
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{eolang}
-[2023-12-28 0.17.0 Formulas and Graphs for EO Programming Language]
+[2024-01-02 0.17.1 Formulas and Graphs for EO Programming Language]
 
 
 
@@ -99,12 +99,21 @@
 }
 \ProcessPgfPackageOptions{/eolang}
 
-\ifnum\ShellEscapeStatus=1%
-  \iexec[null]{mkdir -p "\eolang at tmpdir/\jobname"}%
-\else%
-  \message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
-    is not created, because --shell-escape is not set^^J}%
-\fi%
+\RequirePackage{shellesc}
+\IfFileExists
+  {\eolang at tmpdir/\jobname}
+  {\message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
+    already exists^^J}}
+  {%
+    \ifnum\ShellEscapeStatus=1%
+      \iexec[null]{mkdir -p "\eolang at tmpdir/\jobname"}%
+    \else%
+      \message{eolang: Temporary directory "\eolang at tmpdir/\jobname"
+        is not created, because -shell-escape is not set, and
+        it doesn't exist, most probably the compilation
+        will fail later^^J}%
+    \fi%
+  }
 
 \makeatletter\newcounter{eolang at lineno}\makeatother
 
@@ -114,11 +123,17 @@
 \makeatother
 
 \makeatletter
-\begin{VerbatimOut}{\eolang at tmpdir/eolang-phi.pl}
+\openin 15=\eolang at tmpdir/\jobname-phi.pl
+\ifeof 15
+\message{eolang: Perl script is going to be created,
+  because it is absent at "\eolang at tmpdir/\jobname-phi.pl",
+  but if -shell-escape is not set, the compilation will
+  most likely fail now^^J}
+\begin{VerbatimOut}{\eolang at tmpdir/\jobname-phi.pl}
 $macro = $ARGV[0];
 open(my $fh, '<', $ARGV[1]);
 my $tex; { local $/; $tex = <$fh>; }
-print "% This file is auto-generated by 0.17.0\n";
+print "% This file is auto-generated by 0.17.1\n";
 print '% There are ', length($tex),
   ' chars in the input: ', $ARGV[1], "\n";
 print '% ---', "\n";
@@ -195,9 +210,9 @@
 $tex =~ s/([^\\{a-z0-9]|^)L>/\1\\lambda{}..>/g;
 $tex =~ s/"([^"]+)"/|"\1"|/g;
 $tex =~ s/(^|(?<=[\s)(\]\[,.>\/]))([a-zA-Z][a-z0-9]+)(?=[\s)(\]\[,.-]|$)/|\2|/g;
-$tex =~ s/([^^_]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
+$tex =~ s/([^_^]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\vert{}\3\\space{}\4/xg;
-$tex =~ s/([^^_]|^)([0-9]+|\*)
+$tex =~ s/([^_^]|^)([0-9]+|\*)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\space{}\3/xg;
 if ($macro ne 'phiq') {
   if (not $splitting) {
@@ -285,7 +300,12 @@
 print '\endinput';
 \end{VerbatimOut}
 \message{eolang: File with Perl script
-  '\eolang at tmpdir/eolang-phi.pl' saved^^J}%
+  '\eolang at tmpdir/\jobname-phi.pl' saved^^J}
+\else
+  \message{eolang: Perl script already exists at
+    "\eolang at tmpdir/\jobname-phi.pl"^^J}
+\fi
+\closein 15
 \makeatother
 
 \makeatletter
@@ -301,7 +321,7 @@
       \input{#1}}
     {%
       \ifnum\ShellEscapeStatus=1\else%
-        \message{eolang: The --shell-escape command line
+        \message{eolang: The -shell-escape command line
         option is not provided, most probably compilation
         will fail now:^^J}%
       \fi%
@@ -320,7 +340,7 @@
         "\eolang at tmpdir/\jobname/\hash.tex"}%
       \message{Start parsing 'phi' at line no. \the\inputlineno^^J}
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
-        perl "\eolang at tmpdir/eolang-phi.pl"
+        perl "\eolang at tmpdir/\jobname-phi.pl"
         '#1'
         "\eolang at tmpdir/\jobname/\hash.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
@@ -356,7 +376,7 @@
       \iexec[quiet,null]{cp "\eolang at tmpdir/\jobname/phiq.tex"
         "\eolang at tmpdir/\jobname/\hash-phiq.tex"}%
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-phiq-post.tex]{
-        perl \eolang at tmpdir/eolang-phi.pl 'phiq'
+        perl \eolang at tmpdir/\jobname-phi.pl 'phiq'
         "\eolang at tmpdir/\jobname/\hash-phiq.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g' \fi}%
     }%
@@ -372,7 +392,13 @@
 \fi
 
 \makeatletter
-\begin{VerbatimOut}{\eolang at tmpdir/eolang-sodg.pl}
+\openin 15=\eolang at tmpdir/\jobname-sodg.pl
+\ifeof 15
+\message{eolang: Perl script is going to be created,
+  because it is absent at "\eolang at tmpdir/\jobname-sodg.pl",
+  but if -shell-escape is not set, the compilation will
+  most likely fail now^^J}
+\begin{VerbatimOut}{\eolang at tmpdir/\jobname-sodg.pl}
 sub num {
   my ($i) = @_;
   $i =~ s/(\+|-)\./\10./g;
@@ -645,7 +671,12 @@
 print '\endinput';
 \end{VerbatimOut}
 \message{eolang: File with Perl script
-  '\eolang at tmpdir/eolang-sodg.pl' saved^^J}%
+  '\eolang at tmpdir/\jobname-sodg.pl' saved^^J}
+\else
+  \message{eolang: Perl script already exists at
+    "\eolang at tmpdir/\jobname-sodg.pl"^^J}
+\fi
+\closein 15
 \makeatother
 
 \setcounter{FancyVerbLine}{0}
@@ -761,7 +792,7 @@
         "\eolang at tmpdir/\jobname/\hash.tex"}%
       \message{eolang: Start parsing `sodg' at line no. \the\inputlineno^^J}
       \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-sodg-post.tex]{
-        perl "\eolang at tmpdir/eolang-sodg.pl"
+        perl "\eolang at tmpdir/\jobname-sodg.pl"
         "\eolang at tmpdir/\jobname/\hash.tex"
         \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi
         \ifdefined\eolang at sodgSaveTo > \eolang at sodgSaveTo\fi}%



More information about the tex-live-commits mailing list.