texlive[65047] Master/texmf-dist: eolang (18nov22)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 18 22:02:19 CET 2022


Revision: 65047
          http://tug.org/svn/texlive?view=revision&revision=65047
Author:   karl
Date:     2022-11-18 22:02:19 +0100 (Fri, 18 Nov 2022)
Log Message:
-----------
eolang (18nov22)

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	2022-11-18 00:49:24 UTC (rev 65046)
+++ trunk/Master/texmf-dist/source/latex/eolang/eolang.dtx	2022-11-18 21:02:19 UTC (rev 65047)
@@ -50,10 +50,11 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{eolang}
 %<*package>
-[2022-11-16 0.6.0 Formulas and Graphs for EO Programming Language]
+[2022-11-18 0.7.0 Formulas and Graphs for EO Programming Language]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
 \usepackage[maxnames=1,minnames=1,maxbibnames=1,natbib=true,citestyle=authoryear,bibstyle=authoryear,doi=false,url=false,isbn=false,isbn=false]{biblatex}
 \addbibresource{eolang.bib}
 \usepackage[tt=false, type1=true]{libertine}
@@ -100,12 +101,12 @@
 % \usepackage{eolang}
 % \begin{document}
 % \begin{phiquation*}
-% a -> [[ % it's abstract!
-%   ^ !-> $.b.^{^2}, 0/t-> TRUE,
-%   b -> [[ *-> |fn|(56),
-%     @ -> |hello|($),
-%     \Delta ..> 01-FE-C3 ]]]],\\
-% x -> [[ \alpha_0 -> ? ]].
+% app -> [[ % it's abstract!
+%   ^ !-> $.b.^{^2}, 0/t~> TRUE,
+%   b -> [[ *-> fn(56),
+%     @ -> Q.hello.bye($),
+%     D> 01-FE-C3 ]]]],\\
+% x -> [[ \lambda ..> ? ]].
 % \end{phiquation*}
 % \end{document}
 % \end{docshot}
@@ -124,6 +125,8 @@
 %     (|\sigma|),
 %   \item ``|?|'' maps to ``$\varnothing$''
 %     (|\varnothing|),
+%   \item ``|Q|'' maps to ``$\Phi$''
+%     (|\Phi|),
 %   \item ``|->|'' maps to ``$\mapsto$''
 %     (|\mapsto|),
 %   \item ``|~>|'' maps to ``$\phiWave$''
@@ -132,11 +135,15 @@
 %     (|\phiConst|),
 %   \item ``|..>|'' maps to ``$\phiDotted$''
 %     (|\phiDotted|),
+%   \item ``|D>|'' maps to ``$\Delta\phiDotted$''
+%     (|\Delta ..>|),
+%   \item ``|L>|'' maps to ``$\lambda\phiDotted$''
+%     (|\lambda ..>|),
 %   \item ``|[[|'' maps to ``$\llbracket$''
 %     (|\llbracket|),
 %   \item ``|]]|'' maps to ``$\rrbracket$''
 %     (|\rrbracket|),
-%   \item ``$\vert$|abc|$\vert$'' maps to ``\texttt{abc}''
+%   \item ``\texttt{\textbar{abc}\textbar}'' maps to ``\texttt{abc}''
 %     (|\texttt{abc}|).
 % \end{itemize}
 % Also, a few symbols are supported for $\varphi$PU architecture:
@@ -153,7 +160,7 @@
 
 % You can append a slash and a title to the number of an attribute, such as |0/g->x|.
 % this will render as \phiq{0/g->x}. You can use fixed-width words too, for example
-% \verb=\phiq{0/|foo|->x}= will render as ``\phiq{0/|foo|->x}''. It's also possible
+% \verb=\phiq{0/|f|->x}= will render as ``\phiq{0/|f|->x}''. It's also possible
 % to use an asterix instead of a number, such that |\phiq{*/g->x}| renders as ``\phiq{*/g->x}''
 
 % Numbers are automatically converted to fixed-width font, no need to always decorate them with vertical bars.
@@ -160,9 +167,13 @@
 
 % |TRUE| and |FALSE| are automatically converted to fixed-width font too.
 
+% Object names are automatically converted to fixed-width font too, if they have more than one letter.
+
+% Texts in double quotes are automatically converted to fixed-width font too.
+
 % \DescribeMacro{\phiq}
 % The command |\phiq| lets you inline a $\varphi$-calculus expressions
-% using the same simple plain-text notation:
+% using the same simple plain-text notation. You can use dollar sign directly too:
 % \docshotOptions{firstline=4,lastline=10}
 % \begin{docshot}
 % \documentclass{article}
@@ -173,7 +184,7 @@
 % \phiq{x -> [[@ -> y]]} \\
 % is a decorator of
 % the data object \\
-% \phiq{y -> [[\Delta ..> 42]]}.
+% $y -> [[\Delta ..> 42]]$.
 % \end{document}
 % \end{docshot}
 
@@ -314,6 +325,18 @@
 %</verb>
 %\fi
 
+% \DescribeMacro{nodollar}
+% You may disable special treatment of the dollar sign:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[nodollar]{eolang}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
 % \section{More Examples}
 
 % The |phiquation| environment treats ends of line as signals to start
@@ -348,7 +371,7 @@
 % \begin{phiquation*}
 % \dfrac{\begin{split}
 % x->[[@->y, z->42,
-%   0/g->?, 1/|foo|->42]]
+%   0/g->?, 1/foo->42]]
 % \end{split}}{\begin{split}
 % x->[[@->y, z->?, f ~> |pi|(
 %   0->[[ \psi !-> |hello|(12) ]],
@@ -484,7 +507,7 @@
 % v2 xy:v0,0,1
 % v0->v2 a:y
 % v3 xy:v0,1,1
-% v0->v3 a:z
+% v0->v3 a:\psi{}
 % v3->v1 a:f bend:-75 break:30
 % \end{sodg}
 % \end{document}
@@ -588,7 +611,11 @@
 % \changes{0.5.0}{2022/11/11}{Automated formatting of \texttt{TRUE} and \texttt{FALSE} added.}
 % \changes{0.5.0}{2022/11/13}{A new syntax introduced for \texttt{\char`\\alpha}-attributes: \texttt{0->}.}
 % \changes{0.5.0}{2022/11/14}{It's possible to use double names for attributes, such as \texttt{0/g->}.}
-% Then, we create a Perl script for |phiquation| processing using |VerbatimOut| from
+% \changes{0.7.0}{2022/11/17}{Object names are automatically converted to \texttt{\char`\\texttt}, provided their names include two or more symbols.}
+% \changes{0.7.0}{2022/11/17}{Text in quotes is automatically converted to \texttt{\char`\\texttt}.}
+% \changes{0.7.0}{2022/11/17}{New syntax sugar constructs added: \texttt{D>} and \texttt{L>} for \texttt{\char`\\Delta} and \texttt{\char`\\lambda} with a dotted arrow respectively.}
+% \changes{0.7.0}{2022/11/18}{New syntax sugar for $\Phi$, just using capital ``\texttt{Q}'' is enough.}
+% Then, we create a Perl script for |phiquation| processing using |VerbatimOut| environment from
 % \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
 %    \begin{macrocode}
 \makeatletter
@@ -618,6 +645,11 @@
   $tex =~ s/\n*(\\label\{[^\}]+\})\n*/\1/g;
 }
 $tex =~ s/&/\\sigma{}/g;
+$tex =~ s/([^\\{a-z0-9]|^)Q(?![a-z0-9])/\1\\Phi{}/g;
+$tex =~ s/([^\\{a-z0-9]|^)D>/\1\\Delta{}..>/g;
+$tex =~ s/([^\\{a-z0-9]|^)L>/\1\\lambda{}..>/g;
+$tex =~ s/"([^"]+)"/|"\1"|/g;
+$tex =~ s/([ )(.>\/]|^)([a-z0-9]{2,})(?=[ )(.-])/\1|\2|/g;
 $tex =~ s/([^^_]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\vert{}\3\\space{}\4/xg;
 $tex =~ s/([^^_]|^)([0-9]+|\*)
@@ -684,8 +716,6 @@
 \end{VerbatimOut}
 \message{eolang: File with Perl script
   '\eolang at tmpdir/eolang-phi.pl' saved^^J}%
-\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g'
-  "\eolang at tmpdir/eolang-phi.pl"}
 \makeatother
 %    \end{macrocode}
 % \end{macro}
@@ -733,14 +763,30 @@
     {\eolang at tmpdir/\jobname/phiq.tex}}%
   \iexec[null]{cp "\eolang at tmpdir/\jobname/phiq.tex"
     "\eolang at tmpdir/\jobname/\hash.tex"}%
+  \ifdefined\eolang at nodollar\else\catcode`\$=3 \fi%
   \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
     perl \eolang at tmpdir/eolang-phi.pl 'phiq'
     "\eolang at tmpdir/\jobname/\hash.tex"
     \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
+  \ifdefined\eolang at nodollar\else\catcode`\$\active\fi%
 }\makeatother
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{nodollar}
+% \changes{0.7.0}{2022/11/18}{Now it is possible to use dollar sign instead of \texttt{\char`\\phiq}.}
+% Then, we redefine dollar sign:
+%    \begin{macrocode}
+\ifdefined\eolang at nodollar\else
+  \begingroup
+  \catcode`\$=\active
+  \protected\gdef$#1${\phiq{#1}}
+  \endgroup
+  \AtBeginDocument{\catcode`\$=\active}
+\fi
+%    \end{macrocode}
+% \end{macro}
+
 % \begin{macro}{eolang-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}.}
@@ -799,7 +845,7 @@
 print "% ---\n";
 $tex =~ s/\\\\/\n/g;
 $tex =~ s/\\\n//g;
-$tex =~ s/(\\[a-zA-Z]+) +/\1/g;
+$tex =~ s/(\\[a-zA-Z]+)\s+/\1/g;
 $tex =~ s/\n{2,}/\n/g;
 my @cmds = split(/\n/g, $tex);
 print '% --- before processing:' . "\n";
@@ -1013,8 +1059,6 @@
 \end{VerbatimOut}
 \message{eolang: File with Perl script
   '\eolang at tmpdir/eolang-sodg.pl' saved^^J}%
-\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g'
-  "\eolang at tmpdir/eolang-sodg.pl"}
 \makeatother
 %    \end{macrocode}
 % \end{macro}
@@ -1028,7 +1072,7 @@
 % \end{macro}
 
 % \begin{macro}{tikz}
-% Then, we include |tikz| package and its libraries:
+% Then, we include \href{https://ctan.org/pkg/tikz}{tikz} package and its libraries:
 %    \begin{macrocode}
 \RequirePackage{tikz}
   \usetikzlibrary{arrows}
@@ -1131,7 +1175,7 @@
 
 % \begin{macro}{sodg}
 % \changes{0.0.2}{2022/10/20}{The environment \texttt{phigure} renamed to \texttt{sodg} for the sake of better semantic. The graph in the picture is solely a SODG graph, that's why the name \texttt{sodg} is better.}
-% Then, create a new environment |sodg|, as suggested
+% Then, we create a new environment |sodg|, as suggested
 % \href{https://tex.stackexchange.com/questions/661056}{here}:
 %    \begin{macrocode}
 \makeatletter\newenvironment{sodg}%
@@ -1144,10 +1188,12 @@
     {\eolang at tmpdir/\jobname/sodg.tex}}%
   \iexec[null]{cp "\eolang at tmpdir/\jobname/sodg.tex"
     "\eolang at tmpdir/\jobname/\hash.tex"}%
+  \catcode`\$=3 %
   \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
     perl "\eolang at tmpdir/eolang-sodg.pl"
     "\eolang at tmpdir/\jobname/\hash.tex"
     \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
+  \catcode`\$\active%
   \setcounter{FancyVerbLine}{\value{eolang at lineno}}%
 }\makeatother
 %    \end{macrocode}
@@ -1249,7 +1295,7 @@
 \newcommand{\phiDotted}{%
   \mapstochar\mathrel{\mathpalette\phiDotted@\relax}}
 \newcommand{\phiDotted@}[2]{%
-  \begingroup
+  \begingroup%
   \settowidth{\dimen\z@}{$\m at th#1\rightarrow$}%
   \settoheight{\dimen\tw@}{$\m at th#1\rightarrow$}%
   \sbox\z@{%
@@ -1264,7 +1310,9 @@
   }%
   \ht\z@=\dimen\tw@ \dp\z@=\z@%
   \box\z@%
-  \endgroup}\makeatother
+  \endgroup%
+}
+\makeatother
 %    \end{macrocode}
 % \end{macro}
 

Modified: trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2022-11-18 00:49:24 UTC (rev 65046)
+++ trunk/Master/texmf-dist/tex/latex/eolang/eolang.sty	2022-11-18 21:02:19 UTC (rev 65047)
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{eolang}
-[2022-11-16 0.6.0 Formulas and Graphs for EO Programming Language]
+[2022-11-18 0.7.0 Formulas and Graphs for EO Programming Language]
 
 
 
@@ -66,6 +66,9 @@
 
 
 
+
+
+
 \RequirePackage{stmaryrd}
 \RequirePackage{amsmath}
 \let\Bbbk\relax\RequirePackage{amssymb}
@@ -120,6 +123,11 @@
   $tex =~ s/\n*(\\label\{[^\}]+\})\n*/\1/g;
 }
 $tex =~ s/&/\\sigma{}/g;
+$tex =~ s/([^\\{a-z0-9]|^)Q(?![a-z0-9])/\1\\Phi{}/g;
+$tex =~ s/([^\\{a-z0-9]|^)D>/\1\\Delta{}..>/g;
+$tex =~ s/([^\\{a-z0-9]|^)L>/\1\\lambda{}..>/g;
+$tex =~ s/"([^"]+)"/|"\1"|/g;
+$tex =~ s/([ )(.>\/]|^)([a-z0-9]{2,})(?=[ )(.-])/\1|\2|/g;
 $tex =~ s/([^^_]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
   (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\vert{}\3\\space{}\4/xg;
 $tex =~ s/([^^_]|^)([0-9]+|\*)
@@ -186,8 +194,6 @@
 \end{VerbatimOut}
 \message{eolang: File with Perl script
   '\eolang at tmpdir/eolang-phi.pl' saved^^J}%
-\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g'
-  "\eolang at tmpdir/eolang-phi.pl"}
 \makeatother
 
 \makeatletter\newcommand\eolang at process[1]{
@@ -223,12 +229,22 @@
     {\eolang at tmpdir/\jobname/phiq.tex}}%
   \iexec[null]{cp "\eolang at tmpdir/\jobname/phiq.tex"
     "\eolang at tmpdir/\jobname/\hash.tex"}%
+  \ifdefined\eolang at nodollar\else\catcode`\$=3 \fi%
   \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
     perl \eolang at tmpdir/eolang-phi.pl 'phiq'
     "\eolang at tmpdir/\jobname/\hash.tex"
     \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
+  \ifdefined\eolang at nodollar\else\catcode`\$\active\fi%
 }\makeatother
 
+\ifdefined\eolang at nodollar\else
+  \begingroup
+  \catcode`\$=\active
+  \protected\gdef$#1${\phiq{#1}}
+  \endgroup
+  \AtBeginDocument{\catcode`\$=\active}
+\fi
+
 \makeatletter
 \begin{VerbatimOut}{\eolang at tmpdir/eolang-sodg.pl}
 sub num {
@@ -272,7 +288,7 @@
 print "% ---\n";
 $tex =~ s/\\\\/\n/g;
 $tex =~ s/\\\n//g;
-$tex =~ s/(\\[a-zA-Z]+) +/\1/g;
+$tex =~ s/(\\[a-zA-Z]+)\s+/\1/g;
 $tex =~ s/\n{2,}/\n/g;
 my @cmds = split(/\n/g, $tex);
 print '% --- before processing:' . "\n";
@@ -486,8 +502,6 @@
 \end{VerbatimOut}
 \message{eolang: File with Perl script
   '\eolang at tmpdir/eolang-sodg.pl' saved^^J}%
-\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g'
-  "\eolang at tmpdir/eolang-sodg.pl"}
 \makeatother
 
 \setcounter{FancyVerbLine}{0}
@@ -594,10 +608,12 @@
     {\eolang at tmpdir/\jobname/sodg.tex}}%
   \iexec[null]{cp "\eolang at tmpdir/\jobname/sodg.tex"
     "\eolang at tmpdir/\jobname/\hash.tex"}%
+  \catcode`\$=3 %
   \iexec[trace,stdout=\eolang at tmpdir/\jobname/\hash-post.tex]{
     perl "\eolang at tmpdir/eolang-sodg.pl"
     "\eolang at tmpdir/\jobname/\hash.tex"
     \ifdefined\eolang at nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
+  \catcode`\$\active%
   \setcounter{FancyVerbLine}{\value{eolang at lineno}}%
 }\makeatother
 
@@ -646,7 +662,7 @@
 \newcommand{\phiDotted}{%
   \mapstochar\mathrel{\mathpalette\phiDotted@\relax}}
 \newcommand{\phiDotted@}[2]{%
-  \begingroup
+  \begingroup%
   \settowidth{\dimen\z@}{$\m at th#1\rightarrow$}%
   \settoheight{\dimen\tw@}{$\m at th#1\rightarrow$}%
   \sbox\z@{%
@@ -661,7 +677,9 @@
   }%
   \ht\z@=\dimen\tw@ \dp\z@=\z@%
   \box\z@%
-  \endgroup}\makeatother
+  \endgroup%
+}
+\makeatother
 
 
 



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