From 24d395b004e4e1f571430b915fcc2e4bb95326cb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 29 Nov 2022 21:09:04 +0000 Subject: eolang (29nov22) git-svn-id: svn://tug.org/texlive/trunk@65142 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/eolang/eolang.pdf | Bin 1746109 -> 1869634 bytes Master/texmf-dist/source/latex/eolang/eolang.dtx | 90 +++++++++++++++-------- Master/texmf-dist/tex/latex/eolang/eolang.sty | 50 ++++++------- 3 files changed, 86 insertions(+), 54 deletions(-) diff --git a/Master/texmf-dist/doc/latex/eolang/eolang.pdf b/Master/texmf-dist/doc/latex/eolang/eolang.pdf index f22ea00e441..87a430837ea 100644 Binary files a/Master/texmf-dist/doc/latex/eolang/eolang.pdf and b/Master/texmf-dist/doc/latex/eolang/eolang.pdf differ diff --git a/Master/texmf-dist/source/latex/eolang/eolang.dtx b/Master/texmf-dist/source/latex/eolang/eolang.dtx index 8a9469e0d79..402bcd4b8f8 100644 --- a/Master/texmf-dist/source/latex/eolang/eolang.dtx +++ b/Master/texmf-dist/source/latex/eolang/eolang.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{eolang} %<*package> -[2022-11-28 0.7.1 Formulas and Graphs for EO Programming Language] +[2022-11-29 0.8.0 Formulas and Graphs for EO Programming Language] % %<*driver> \documentclass{ltxdoc} @@ -251,10 +251,24 @@ % \DescribeMacro{\phic} % \DescribeMacro{\xmir} % There is also a no-argument command |\eolang| to help you print the name of -% \eolang{} language. It understands the |anonymous| mode of \href{https://ctan.org/pkg/acmart}{acmart} and prints itself +% \eolang{} language. It understands the |anonymous| package option and prints itself % differently, to double-blind your paper. There is also |\phic| command to print % the name of \phic{}, also sensitive to |anonymous| mode. The macro |\xmir| prints "XMIR". -% \docshotOptions{firstline=4,lastline=10} +% \docshotOptions{firstline=3,lastline=10} +% \begin{docshot} +% \documentclass{acmart} +% \thispagestyle{empty} +% \usepackage[anonymous]{eolang} +% \begin{document} +% In our research we use \eolang{}, \\ +% an experimental object-oriented \\ +% dataflow language, \phic{}, as its \\ +% formal foundation, and \xmir{} --- \\ +% its XML-based presentation. +% \end{document} +% \end{docshot} +% Without the |anonymous| option there will be no orange color: +% \docshotOptions{firstline=3,lastline=10} % \begin{docshot} % \documentclass[anonymous]{acmart} % \thispagestyle{empty} @@ -377,6 +391,18 @@ % %\fi +% \DescribeMacro{anonymous} +% You may anonymize |\eolang|, |\XMIR|, and |\phic| commands by using |anonymous| package option: +%\iffalse +%<*verb> +%\fi +\begin{verbatim} +\usepackage[anonymous]{eolang} +\end{verbatim} +%\iffalse +% +%\fi + % \section{More Examples} % The |phiquation| environment treats ends of line as signals to start @@ -633,6 +659,7 @@ % Then, we process package options: % \changes{0.1.0}{2022/10/26}{Parsing of package options introduced.} % \changes{0.6.0}{2022/11/14}{Package option \texttt{nocomments} added in order to enable comments suppression in temporary \texttt{.tex} files (may be pretty important for \texttt{.dtx} documents).} +% \changes{0.8.0}{2022/11/29}{The \texttt{anonymous} package option added.} % \begin{macrocode} \RequirePackage{pgfopts} \RequirePackage{ifluatex} @@ -642,9 +669,10 @@ tmpdir/.store in=\eolang@tmpdir, tmpdir/.default=_eolang\ifxetex-xe\else\ifluatex-lua\fi\fi, nocomments/.store in=\eolang@nocomments, + anonymous/.store in=\eolang@anonymous, tmpdir } -\ProcessPgfOptions{/eolang} +\ProcessPgfPackageOptions{/eolang} % \end{macrocode} % Then, we make a directory where all temporary files will be kept: @@ -766,11 +794,11 @@ if ($macro ne 'phiq') { $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g; $tex =~ s/\s{2}/ \\quad{}/g; $tex = '&' . $tex; - my $lead = '[^\s]+\s(->|:=|=)'; + my $lead = '[^\s]+\s(?:->|:=|=)'; my @leads = $tex =~ /&${lead}/g; my @eols = $tex =~ /&/g; - if (0+@leads == 0+@eols && 0+@eols > 0) { - $tex =~ s/&${lead}/\1&/g; + if (0+@leads == 0+@eols && 0+@eols > 1) { + $tex =~ s/&(${lead})/\1&/g; $gathered = 0; print '% The "gathered" is NOT used because all ' . (0+@eols) . ' lines are ' . (0+@leads) . " leads\n"; @@ -853,6 +881,7 @@ print '\endinput'; {\eolang@tmpdir/\jobname/phiquation.tex}}% \iexec[null]{cp "\eolang@tmpdir/\jobname/phiquation.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% + \message{Start parsing 'phi' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-phi.pl" '#1' @@ -1337,6 +1366,7 @@ print '\endinput'; \iexec[null]{cp "\eolang@tmpdir/\jobname/sodg.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% \catcode`\$=3 % + \message{Start parsing `sodg' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-sodg.pl" "\eolang@tmpdir/\jobname/\hash.tex" @@ -1349,18 +1379,29 @@ print '\endinput'; % \end{macrocode} % \end{macro} +% \begin{macro}{\eolang@anon} +% Then, we define a supplementary command to help us anonymize some content. +% \changes{0.9.0}{2022/11/29}{New command \texttt{\char`\\eolang@anon} added.} +% \begin{macrocode} +\makeatletter +\NewExpandableDocumentCommand{\eolang@anon}{O{ANONYMIZED}m}{% + \ifdefined\eolang@anonymous% + \textcolor{orange}{#1}% + \else% + #2% + \fi% +}\makeatother +% \end{macrocode} +% \end{macro} + % \begin{macro}{\eolang} % Then, we define a simple supplementary command to help you print \eolang{}, the name of our language. % \changes{0.1.0}{2022/10/25}{New command \texttt{\char`\\eolang} added to print the name of the language in both % normal and the anonymous mode of \texttt{acmart}.} % \begin{macrocode} -\newcommand\eolang{% - \ifdefined\anon% - \anon[XYZ]{{\sffamily EO}}% - \else% - {\sffamily EO}% - \fi% -} +\makeatletter\newcommand\eolang{% + \eolang@anon[XYZ]{{\sffamily EO}}} +\makeatother % \end{macrocode} % \end{macro} @@ -1370,14 +1411,9 @@ print '\endinput'; % normal and the anonymous mode of \texttt{acmart}.} % \begin{macrocode} \RequirePackage{hyperref} -\newcommand\phic{% - \ifdefined\anon% - \anon[\texorpdfstring{$\alpha$}{a}-cal\-cu\-lus] - {\texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus}% - \else% - \texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus% - \fi% -} +\makeatletter\newcommand\phic{% + \eolang@anon[$\alpha$-cal\-cu\-lus]{$\varphi$-cal\-cu\-lus}} +\makeatother % \end{macrocode} % \end{macro} @@ -1385,13 +1421,9 @@ print '\endinput'; % Then, we define a simple supplementary command to help you print \xmir{}, the name of our XML-based format of program representation. % \changes{0.2.0}{2022/10/28}{New command \texttt{\char`\\xmir} prints XMIR in both normal and the anonymous mode of \texttt{acmart}.} % \begin{macrocode} -\newcommand\xmir{% - \ifdefined\anon% - \anon[XML$^+$]{XMIR}% - \else% - XMIR% - \fi% -} +\makeatletter\newcommand\xmir{% + \eolang@anon[XML$^+$]{XMIR}} +\makeatother % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/tex/latex/eolang/eolang.sty b/Master/texmf-dist/tex/latex/eolang/eolang.sty index ff8b74b6f5b..66a31bd43b2 100644 --- a/Master/texmf-dist/tex/latex/eolang/eolang.sty +++ b/Master/texmf-dist/tex/latex/eolang/eolang.sty @@ -31,7 +31,8 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{eolang} -[2022-11-28 0.7.1 Formulas and Graphs for EO Programming Language] +[2022-11-29 0.8.0 Formulas and Graphs for EO Programming Language] + @@ -87,9 +88,10 @@ tmpdir/.store in=\eolang@tmpdir, tmpdir/.default=_eolang\ifxetex-xe\else\ifluatex-lua\fi\fi, nocomments/.store in=\eolang@nocomments, + anonymous/.store in=\eolang@anonymous, tmpdir } -\ProcessPgfOptions{/eolang} +\ProcessPgfPackageOptions{/eolang} \iexec[null]{mkdir -p "\eolang@tmpdir/\jobname"}% @@ -177,11 +179,11 @@ if ($macro ne 'phiq') { $tex =~ s/([^&\s])\s{2}([^\s])/\1 \2/g; $tex =~ s/\s{2}/ \\quad{}/g; $tex = '&' . $tex; - my $lead = '[^\s]+\s(->|:=|=)'; + my $lead = '[^\s]+\s(?:->|:=|=)'; my @leads = $tex =~ /&${lead}/g; my @eols = $tex =~ /&/g; - if (0+@leads == 0+@eols && 0+@eols > 0) { - $tex =~ s/&${lead}/\1&/g; + if (0+@leads == 0+@eols && 0+@eols > 1) { + $tex =~ s/&(${lead})/\1&/g; $gathered = 0; print '% The "gathered" is NOT used because all ' . (0+@eols) . ' lines are ' . (0+@leads) . " leads\n"; @@ -252,6 +254,7 @@ print '\endinput'; {\eolang@tmpdir/\jobname/phiquation.tex}}% \iexec[null]{cp "\eolang@tmpdir/\jobname/phiquation.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% + \message{Start parsing 'phi' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-phi.pl" '#1' @@ -677,6 +680,7 @@ print '\endinput'; \iexec[null]{cp "\eolang@tmpdir/\jobname/sodg.tex" "\eolang@tmpdir/\jobname/\hash.tex"}% \catcode`\$=3 % + \message{Start parsing `sodg' at line no. \the\inputlineno^^J} \iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{ perl "\eolang@tmpdir/eolang-sodg.pl" "\eolang@tmpdir/\jobname/\hash.tex" @@ -687,31 +691,27 @@ print '\endinput'; \def\eolang@sodgSaveTo{\relax}% }\makeatother -\newcommand\eolang{% - \ifdefined\anon% - \anon[XYZ]{{\sffamily EO}}% +\makeatletter +\NewExpandableDocumentCommand{\eolang@anon}{O{ANONYMIZED}m}{% + \ifdefined\eolang@anonymous% + \textcolor{orange}{#1}% \else% - {\sffamily EO}% + #2% \fi% -} +}\makeatother + +\makeatletter\newcommand\eolang{% + \eolang@anon[XYZ]{{\sffamily EO}}} +\makeatother \RequirePackage{hyperref} -\newcommand\phic{% - \ifdefined\anon% - \anon[\texorpdfstring{$\alpha$}{a}-cal\-cu\-lus] - {\texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus}% - \else% - \texorpdfstring{$\varphi$}{phi}-cal\-cu\-lus% - \fi% -} +\makeatletter\newcommand\phic{% + \eolang@anon[$\alpha$-cal\-cu\-lus]{$\varphi$-cal\-cu\-lus}} +\makeatother -\newcommand\xmir{% - \ifdefined\anon% - \anon[XML$^+$]{XMIR}% - \else% - XMIR% - \fi% -} +\makeatletter\newcommand\xmir{% + \eolang@anon[XML$^+$]{XMIR}} +\makeatother \newcommand\phiConst{% \mathrel{\hspace{.15em}}% -- cgit v1.2.3