diff options
author | Norbert Preining <norbert@preining.info> | 2024-03-29 03:02:21 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-03-29 03:02:21 +0000 |
commit | 23724df30adf3c6356ee7877833b8096987c643f (patch) | |
tree | a59cd37590258851deb53c4a5ff957cd12c308a0 /macros/latex | |
parent | 79e9e48f9496fe82b7e76b2b318d24e9aab1ca8a (diff) |
CTAN sync 202403290302
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/hvextern/Changes | 2 | ||||
-rw-r--r-- | macros/latex/contrib/hvextern/doc/hvextern.pdf | bin | 1492062 -> 1499392 bytes | |||
-rw-r--r-- | macros/latex/contrib/hvextern/doc/hvextern.tex | 40 | ||||
-rw-r--r-- | macros/latex/contrib/hvextern/latex/hvextern.sty | 116 | ||||
-rw-r--r-- | macros/latex/contrib/starray/README.md | 5 | ||||
-rw-r--r-- | macros/latex/contrib/starray/doc/starray.pdf | bin | 285149 -> 285021 bytes | |||
-rw-r--r-- | macros/latex/contrib/starray/doc/starray.tex | 9 | ||||
-rw-r--r-- | macros/latex/contrib/starray/latex/starray.sty | 175 |
8 files changed, 193 insertions, 154 deletions
diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes index 430476f263..a491647acf 100644 --- a/macros/latex/contrib/hvextern/Changes +++ b/macros/latex/contrib/hvextern/Changes @@ -1,5 +1,7 @@ hvextern.sty ---------------- +v 0.41 2024-03-27 - added compiler option=Rscript + - fix for Windows and R runs v 0.40 2024-03-22 - added option mposttex for metapost program which can be tex (default) | latex v 0.39 2024-01-30 - fixed bug with check for force option diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf Binary files differindex cc8d172784..b98bc2283b 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.pdf +++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex index 77181285d0..92a8362866 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.tex +++ b/macros/latex/contrib/hvextern/doc/hvextern.tex @@ -1,4 +1,4 @@ -%% $Id: hvextern.tex 883 2024-03-22 19:29:21Z herbert $ +%% $Id: hvextern.tex 884 2024-03-27 19:50:43Z herbert $ \DocumentMetadata{}% for lualatex and pstricks \documentclass[english,paper=a4,twoside,usegeometry]{scrartcl} \usepackage{babel} @@ -41,7 +41,7 @@ Werner Lemberg; Rolf Niepraschk}} %\newpage -\setkeys{hv}{moveToExampleDir,ExampleDir=Exa,showFilename,verbose,force=false} +\setkeys{hv}{moveToExampleDir,ExampleDir=Exa,showFilename,verbose,force=true} %\clearpage @@ -63,9 +63,12 @@ external code changed. This doesn't depends on the setting of the option \Lkeywo \begin{sloppypar} This package allows to write external \MP, \TeX, \ConTeXt, \LaTeX, \LuaTeX, \LuaLaTeX, \XeTeX, \XeLaTeX, -\Index{Lua}, \Index{Perl}, \Index{Java} and/or \Index{Python} +\Index{Lua}, \Index{Perl}, \Index{Java}, \Index{Python}, and /or \Index{R} source code, which will then be run via \texttt{shell escape} to create a PDF or text output to include -it into the main \LaTeX\ document. +it into the main \LaTeX\ document. The values for the +optional argument \Lkeyword{compiler} must be the real prgram name on the the local system, e.g. for Windows: +mpost, tex, context.exe, latex.exe, luatex.exe, lualatex.exe, xetex.exe, xelatex.exe, +lua.exe, perl.exe, java.exe, pathon.exe, and /or Rscript.exe. \end{sloppypar} @@ -418,6 +421,33 @@ must be end with a slash, e.g. \Lkeyval{./bin/} \define@key{hv}{runs}[1]{\setcounter{hv@extern@runs}{#1}} \end{verbatim} +For Windows the \Lkeyword{progpath} should always be written with slashes and not +backslashes. e.g. + +\begin{verbatim} + compiler=Rscript.exe, + progpath=C:/Program Files/R/R-4.3.3/bin/x64/, +\end{verbatim} + +For macOS it is something like this: + +\begin{externalDocument}[ + compiler=Rscript, + progpath=/opt/homebrew/bin/, + grfOptions={width=0.5\linewidth}, + code=true, + usefancyvrb, + ext=R, + docType=R]{voss} +#StartVisibleMain +head(pressure) # Die ersten Werte der internen Datenliste +pdf() # erzeugt die PDF "Rplots.pdf" +plot(pressure) +#StopVisibleMain +\end{externalDocument} + + + Instead of the optional arguments \Lkeyword{compiler}, \Lkeyword{biber}, and \Lkeyword{xindex} one can define an individual command sequence by using the optional argument @@ -539,7 +569,7 @@ public class Main { %$ - +\clearpage \subsection{Grafik options} \begin{verbatim} diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty index 16e127376f..5aaeb26f49 100644 --- a/macros/latex/contrib/hvextern/latex/hvextern.sty +++ b/macros/latex/contrib/hvextern/latex/hvextern.sty @@ -1,4 +1,4 @@ -%% $Id: hvextern.sty 882 2024-03-22 19:23:40Z herbert $ +%% $Id: hvextern.sty 884 2024-03-27 19:50:43Z herbert $ %% This is file `hvextern.sty', %% %% Copyright (C) 2016-24 @@ -12,8 +12,8 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.40} -\ProvidesFile{hvextern}[2024/03/22 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.41} +\ProvidesFile{hvextern}[2024/03/27 v\hvexternFileversion: package for running external documents (HV)] \newif\ifhv@extern@checkCode \hv@extern@checkCodefalse @@ -73,6 +73,7 @@ \newlength\hv@extern@mpwidth \setlength\hv@extern@mpwidth{\z@} \newif\ifhv@extern@save@force@state +\newif\ifhv@extern@runR \define@key{hv}{progpath}{\def\hv@extern@progpath{#1}} \define@key{hv}{runsequence}[]{\def\hv@extern@runsequence{#1}} @@ -86,7 +87,7 @@ \define@key{hv}{BOpreamble}[black!12]{\def\hv@extern@BOpreamble{#1}} \define@key{hv}{BObody}[black!8]{\def\hv@extern@BObody{#1}} \define@key{hv}{docType}[latex]{\def\hv@extern@docType{#1}} -%\define@choicekey*+{hv}{docType}[\val\nr]{latex,mp,tex,py,pl,lua,java,context,sh}[latex]{% +%\define@choicekey*+{hv}{docType}[\val\nr]{latex,mp,tex,py,pl,lua,java,context,sh,R}[latex]{% % \hv@typeout{doc type \nr}% % \def\hv@extern@docType{\val}% %}{\PackageWarning{hvextern}{erroneous input (#1) for docType ignored. Using latex.}% @@ -134,15 +135,32 @@ \define@boolkey{hv}[hv@extern@]{eps}[true]{} \define@boolkey{hv}[hv@extern@]{verbose}[true]{} -\define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,% - xetex,pdflatex,lualatex,xelatex,context,sh,texlua}[pdflatex]{% - \hv@ex@typeout{Compiler type (\nr) \val}% - \def\hv@extern@compiler{\val}% - \edef\hv@extern@compilerNo{\nr}% -}{\PackageWarning{hvextern}{unknown compiler type (#1). Maybe you should define a run sequence???}% - \def\hv@extern@compiler{#1}% - \def\hv@extern@compilerNo{-1}% - } +\ifwindows + \define@choicekey*+{hv}{compiler}[\val\nr]{mpost.exe,tex.exe,latex.exe,luatex.exe,% + python3.exe,perl.exe,lua.exe,java.exe,% + xetex.exe,pdflatex.exe,lualatex.exe,xelatex.exe,context.exe,sh,% + texlua.exe,Rscript.exe}[pdflatex.exe]{% + \hv@ex@typeout{Compiler type (\nr) \val}% + \def\hv@extern@compiler{\val}% + \edef\hv@extern@compilerNo{\nr}% + \ifnum\nr=15 \hv@extern@runRtrue\else\hv@extern@runRfalse\fi + }{\PackageWarning{hvextern}{unknown compiler type (#1). Maybe you should define + a run sequence???}% + \def\hv@extern@compiler{#1}% + \def\hv@extern@compilerNo{-1}% + } +\else + \define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,% + xetex,pdflatex,lualatex,xelatex,context,sh,texlua,Rscript}[pdflatex]{% + \hv@ex@typeout{Compiler type (\nr) \val}% + \def\hv@extern@compiler{\val}% + \edef\hv@extern@compilerNo{\nr}% + \ifnum\nr=15 \hv@extern@runRtrue\else\hv@extern@runRfalse\fi + }{\PackageWarning{hvextern}{unknown compiler type (#1). Maybe you should define a run sequence???}% + \def\hv@extern@compiler{#1}% + \def\hv@extern@compilerNo{-1}% + } +\fi \define@boolkey{hv}[hv@extern@]{shellesc}[true]{} \define@key{hv}{aboveskip}[\medskipamount]{\setlength\hv@extern@aboveskip{#1}} \define@key{hv}{belowpreambleskip}[2pt]{\setlength\hv@extern@belowpreambleskip{#1}} @@ -156,57 +174,57 @@ \setkeys{hv}{% align=\centering,% Ausgabe zentrieren aboveskip=\medskipamount,% space above everything - belowpreambleskip=2pt, %\smallskipamount,% space below preamble - belowbodyskip=2pt, %\smallskipamount,% space below body + belowpreambleskip=2pt,%\smallskipamount,% space below preamble + belowbodyskip=2pt, %\smallskipamount,% space below body belowskip=\medskipamount,% space below everything BGpreamble=black!12,% Backgroundcolor for preamble BGbody=black!8,% Backgroundcolor for body BOpreamble=black!12,% Bodercolor for preamble BObody=black!8,% Bodercolor for body - biber=false,% Biber laufen lassen? + biber=false,% Biber laufen lassen? caption=,% keine Caption cleanup={},% Hilfsdateien nicht löschen code=false,% show Code compiler=pdflatex,% zu verwendener Compiler - crop=false,% erzeugte PDF "croppen" + crop=false,% erzeugte PDF "croppen" cropmargin=2,% 2pb margin - docType=latex,% LaTeX example Code + docType=latex,% LaTeX example Code eps=false,% create an eps output? ExampleDir=Examples,% Unterverzeichnis für Beispiele ext=tex,% file extension - float=false,% nicht als Gleitumgebung + float=false,% nicht als Gleitumgebung floatsetting=!htb,% placement - force=true,% Compiler, auch wenn PDF existiert? - frame=false,% keinen Rahmen um Abbildung + force=true,% Compile, auch wenn PDF existiert? + frame=false,% keinen Rahmen um Abbildung framesep=\the\fboxsep,% - grfOptions={},% Optionen der einzubindenden Grafik + grfOptions={},% Optionen der einzubindenden Grafik includegraphic=true,% Grafik einbinden oder User überlassen inline=false,% Grafik nicht in derselben Zeile - label=,% kein Label - lstOptions={},% Optionen für das Listing + label=,% kein Label + lstOptions={},% Optionen für das Listing moveToExampleDir=false,% Verschieben nach ExamplesDir mpwidth=0pt,% no minipage mpsep=1em,% sep between two minipages mpvalign=t,% if side by side output the vertical alignment outerFN=false,% use fullwidth in twocolumn mode (starred floats) - pages=1,% welche Seiten auszugeben sind + pages=1,% welche Seiten auszugeben sind pagesep=1em,% horizontal sep between pages - progpath={}, + progpath={},% redirect=false,% write output into a file *.txt - runs=1,% Anzahl Compiler-Durchläufe - runsAfter=0, % Anzahl Durchläufe nach makeindex - runsequence={},% Im Moment nicht aktiv - shellesc=false,% use shell-escape + runs=1,% Anzahl Compiler-Durchläufe + runsAfter=0, % Anzahl Durchläufe nach makeindex + runsequence={},% Im Moment nicht aktiv + shellesc=false,% use shell-escape shiftFN=\z@,% raise printed filename showFilename=false,% Filenamen im Rand angeben - showoutput=true,% with false only code is shown + showoutput=true,% with false only code is shown tcbox=true,% use tcolorbox - textOptions={},% Options for text output + textOptions={},% Options for text output usefancyvrb=false,% use VerbatimInput instead of listings verbose=false,% no extra output in the logfile vshift=\z@,% raise object (pdf) with \raisebox{}{} - xindex=false,% xindex laufen lassen? - xindexOptions={},% options for xindex + xindex=false,% xindex laufen lassen? + xindexOptions={},% options for xindex mposttex=tex,% mpost program tex or latex }% } @@ -441,6 +459,14 @@ {\NumChar StartVisiblePreamble} {\NumChar StopVisiblePreamble} +%---- R +%\input{hvextern-R.cfg} +\hv@extern@ExampleType{R} + {\NumChar StartVisibleMain} + {\NumChar StopVisibleMain} + {\NumChar StartVisiblePreamble} + {\NumChar StopVisiblePreamble} + %%%--------------------------------- end config part ------------------ @@ -518,12 +544,21 @@ \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext > \hvExternFilename.txt}% \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext\space > \hvExternFilename.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternFilename\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hv@run@options\space\hvExternFilename\hv@extern@ext}% + \ifwindows + \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternFilename\hv@extern@ext}% + \ShellEscape{"\hv@extern@progpath\hv@extern@compiler" \hv@run@options\space\hvExternFilename\hv@extern@ext}% + \else + \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternFilename\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hv@run@options\space\hvExternFilename\hv@extern@ext}% + \fi \fi \fi \addtocounter{@@@runs}{-1}% \repeat + \ifhv@extern@runR % we have Rscript + \hv@ex@typeout{copy r-dummy.pdf to \hvExternFilename.pdf}% + \ShellEscape{\hv@move\space Rplots.pdf \hvExternFilename.pdf}% + \fi \hv@ex@typeout{... done}% \ifhv@extern@biber \ShellEscape{biber \hvExternFilename}% NAch biber nochmal latex @@ -551,8 +586,13 @@ \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext > \hvExternFilename.txt}% \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext\space > \hvExternFilename.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext}% + \ifwindows + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \ShellEscape{"\hv@extern@progpath\hv@extern@compiler" \hvExternFilename\hv@extern@ext}% + \else + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext}% + \fi \fi \fi \addtocounter{@@@runs}{-1}% diff --git a/macros/latex/contrib/starray/README.md b/macros/latex/contrib/starray/README.md index c36549c601..1bea234a15 100644 --- a/macros/latex/contrib/starray/README.md +++ b/macros/latex/contrib/starray/README.md @@ -72,7 +72,10 @@ The Current Maintainer of this work is Alceu Frigeri ------------- ## Changelog -* Version 1.8 (this) +* Version 1.9 (this) + - Removing some internal structures (_base_prop, _def_prop) deprecated by the last three updates. + +* Version 1.8 - code speedup thanks to 'linked' property lists. Code now relies on a more recent l3kernel. * Version 1.7 diff --git a/macros/latex/contrib/starray/doc/starray.pdf b/macros/latex/contrib/starray/doc/starray.pdf Binary files differindex 8302c0d0d9..b5b0dc24b4 100644 --- a/macros/latex/contrib/starray/doc/starray.pdf +++ b/macros/latex/contrib/starray/doc/starray.pdf diff --git a/macros/latex/contrib/starray/doc/starray.tex b/macros/latex/contrib/starray/doc/starray.tex index 171cd37038..0b24d131c8 100644 --- a/macros/latex/contrib/starray/doc/starray.tex +++ b/macros/latex/contrib/starray/doc/starray.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.8} {2024/03/22} +%% This is version {1.9} {2024/03/28} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray @@ -106,18 +106,17 @@ Creates a new \tsobj[marg]{starray} or raises a warning if the name is already \end{tsremark} \subsection{Conditionals}\label{conditionals:exist} -\begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_if_exist_p:n,\starray_if_exist:nTF,\starray_if_valid_p:n,\starray_if_valid:nTF} +\begin{codedescribe}[code,EXP,new=2023/05/20,update=2024/03/28]{\starray_if_exist_p:n,\starray_if_exist:nTF,\starray_if_valid_p:n,\starray_if_valid:nTF} \begin{codesyntax}% \tsmacro{\starray_if_exist_p:n}{starray} \tsmacro{\starray_if_exist:nTF}{starray,if-true,if-false} \tsmacro{\starray_if_valid_p:n}{starray} \tsmacro{\starray_if_valid:nTF}{starray,if-true,if-false} \end{codesyntax} -\tsobj{\starray_if_exist:nTF} only tests if \tsobj[marg]{starray} (the base property) is defined. It doesn't verifies if it really is a \tsobj[pkg]{starray}. -\tsobj{\starray_if_valid:nTF} further tests if an internal boolean (\tsobj[key]{is\_starray}) is also defined. This doesn't necessary mean it is a \tsobj[pkg]{starray} or if it's a really valid one (chances are that it is, but...), see \tsobj{\starray_term_syntax:nTF}, section \ref{conditionals:terms}, for a more reliable validity test. +\tsobj{\starray_if_exist:nTF} only tests if \tsobj[marg]{starray} (the base property) is defined. It doesn't verifies if it really is a \tsobj[pkg]{starray}. \tsobj{\starray_if_valid:nTF} is functionally equivalent since release 1.9. See \tsobj{\starray_term_syntax:nTF}, section \ref{conditionals:terms}, for a more reliable validity test. \end{codedescribe} \begin{tsremark} -The predicate versions, \tsobj{_p}, expand to either \tsobj{\prg_return_true:} or \tsobj{\prg_return_false:}. +The predicate versions, \tsobj{_p}, expand to either \tsobj{\prg_return_true:} or \tsobj{\prg_return_false:} \end{tsremark} \section{Defining and initialising a starray structure}\label{pack:def} diff --git a/macros/latex/contrib/starray/latex/starray.sty b/macros/latex/contrib/starray/latex/starray.sty index 43b2f39851..221c8ca45f 100644 --- a/macros/latex/contrib/starray/latex/starray.sty +++ b/macros/latex/contrib/starray/latex/starray.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.8} {2024/03/22} +%% This is version {1.9} {2024/03/28} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray @@ -23,8 +23,8 @@ \ProvidesExplPackage {starray} - {2024/03/22} - {1.8} + {2024/03/28} + {1.9} {A structured array/hash of properties} @@ -38,8 +38,8 @@ { name .code:n = {starray} , prefix .code:n = {starray} , - date .code:n = {2024/03/22}, - version .code:n = {1.8} , + date .code:n = {2024/03/28}, + version .code:n = {1.9} , description .code:n = {A~structured~array/hash~of~properties} } \cs_if_exist:NF \PkgInfo @@ -331,7 +331,7 @@ %%%%%%%%%%%%%%% % TODO variables declaration -\prop_new:N \l__starray_tmpA_prop +%\prop_new:N \l__starray_tmpA_prop %%%% %%%% 'general' (internal) returning bool @@ -354,11 +354,6 @@ \int_do_while:nNnn {\l_tmpa_int} > {0} { \tl_put_left:Nn \l_tmpa_tl {A} - \prop_new:c { l__starray_tmp \l_tmpa_tl _hash_prop } - \prop_new:c { l__starray_tmp \l_tmpa_tl _def_prop } - \prop_new:c { l__starray_tmp \l_tmpa_tl _idx_prop } - \int_new:c { l__starray_tmp \l_tmpa_tl _int } - \seq_new:c { l__starray_tmp \l_tmpa_tl _seq } \tl_new:c { l__starray_tmp \l_tmpa_tl _tl } \tl_new:c { l__starray_tmp \l_tmpa_tl :A_tl } \tl_new:c { l__starray_tmp \l_tmpa_tl :B_tl } @@ -367,15 +362,17 @@ \int_decr:N \l_tmpa_int } -\tl_new:N \l__starray_tmpa_tl -\tl_new:N \l__starray_tmpb_tl +\tl_new:N \l__starray_tmp_A_tl +\tl_new:N \l__starray_tmp_B_tl +\tl_new:N \l__starray_tmp_C_tl +\tl_new:N \l__starray_tmp_D_tl \tl_new:N \l__starray_showcmd_tl %%%% %%%% (sub)structure returning tl. %%%% -\tl_new:N \l__starray_tmpST_tl +\tl_new:N \l__starray_tmp_ST_tl %%%% @@ -427,19 +424,19 @@ %%%%%%%%%%%%%%% -\prg_new_eq_conditional:NNn \__starray_if_exist:n \prop_if_exist:c {p, T, F, TF} +\prg_new_eq_conditional:NNn \__starray_if_exist:n \cs_if_exist:c {p, T, F, TF} \prg_generate_conditional_variant:Nnn \__starray_if_exist:n {e} {p, T, F, TF} \prg_new_conditional:Npnn \starray_if_exist:n #1 {p, T, F, TF} { - \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _base_defref_tl} { \prg_return_true: } { \prg_return_false: } } - +% DEPRECATED, unless some other (simple) test become available %\prg_new_conditional:Npnn \__starray_if_valid:n #1 {p, T, F, TF} % { % \bool_lazy_and:nnTF {\prop_if_exist_p:c {#1}} {\prop_item:cn {#1} {is_starray}} @@ -447,14 +444,14 @@ % { \prg_return_false: } % } -\prg_new_eq_conditional:NNn \__starray_if_valid:n \prop_if_exist:c {p, T, F, TF} +\prg_new_eq_conditional:NNn \__starray_if_valid:n \cs_if_exist:c {p, T, F, TF} \prg_generate_conditional_variant:Nnn \__starray_if_valid:n {e} {p, T, F, TF} \prg_new_conditional:Npnn \starray_if_valid:n #1 {p, T, F, TF} { - \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _defref_tl} { \prg_return_true: } { \prg_return_false: } } @@ -480,15 +477,9 @@ \int_new:c { \l__starray_prefix_tl #2 _base_iter_int } - - \prop_new:c { \l__starray_prefix_tl #2 _base_prop } - - \prop_gset_from_keyval:cn - { \l__starray_prefix_tl #2 _base_prop } - { - def_ref = #1 , - is_starray = \c_true_bool , - } + + \tl_new:c { \l__starray_prefix_tl #2 _base_defref_tl } + \tl_set:cn { \l__starray_prefix_tl #2 _base_defref_tl } {#1} \prop_new_linked:c {\l__starray_prefix_tl #2 _base_idxhash_prop} @@ -506,22 +497,12 @@ % needs protection. \cs_new_protected:Npn \__starray_new:n #1 { - \prop_new:c - { \l__starray_prefix_tl #1 _def_prop } - - \prop_gset_from_keyval:cn - { \l__starray_prefix_tl #1 _def_prop } - { - is_starray = \c_true_bool , - def_ref = #1 - } - - \prop_clear:N \l_tmpa_prop + \tl_new:c { \l__starray_prefix_tl #1 _defref_tl } + \tl_set:cn { \l__starray_prefix_tl #1 _defref_tl } {#1} \seq_new:c { \l__starray_prefix_tl #1 _defstkeys_seq } - \prop_new:c {\l__starray_prefix_tl #1 _defkeys_prop} - + \prop_new_linked:c {\l__starray_prefix_tl #1 _defkeys_prop} } \cs_generate_variant:Nn \__starray_new:n { e } @@ -536,7 +517,7 @@ % needs protection. \cs_new_protected:Npn \starray_new:n #1 { - \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _defref_tl} { \msg_warning:nnnn {starray} {strict / (re)define} {new:1} {#1} } @@ -550,7 +531,7 @@ % needs protection. \prg_new_protected_conditional:Npnn \starray_new:n #1 {T, F, TF} { - \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _defref_tl} { \prg_return_false: } { \__starray_new:e {#1 } @@ -575,7 +556,7 @@ %%%% <st-ref> . \q_nil \q_stop %%%% so that even if {ref} (has no dot, no idx) it will return 'the root ref' %%%% -%%%% e.g.: \tl_set:Ne \l__tmpb_tl {\__starray_get_root:w \l__starray_tmpa_tl . \q_nil \q_stop} +%%%% e.g.: \tl_set:Ne \l__tmpb_tl {\__starray_get_root:w \l__starray_tmp_A_tl . \q_nil \q_stop} %%%% %%%% It will return the 'root ref' assuming that the ref is of form root.name.name (no [idx]) %%%% @@ -618,7 +599,7 @@ % needs protection, because of _p \cs_new_protected:Npn \starray_def_prop:nnn #1#2#3 { - \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _defref_tl} { \__starray_def_prop:nnn {#1} {#2} {#3} } { \msg_warning:nnxxx {starray}{reference / invalid-starray} @@ -630,7 +611,7 @@ % needs protection, because of _p \prg_new_protected_conditional:Npnn \starray_def_prop:nnn #1#2#3 {T, F, TF} { - \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF {\l__starray_prefix_tl #1 _defref_tl} { \__starray_def_prop:nnn {#1} {#2} {#3} \prg_return_true: @@ -676,7 +657,7 @@ \cs_new_protected:Npn \__starray_fix_terms_seq_aux:nnnn #1#2#3#4 { - \__starray_if_valid:eTF {\l__starray_prefix_tl #2 _ #3 . #4 _base_prop} + \__starray_if_exist:eTF {\l__starray_prefix_tl #2 _ #3 . #4 _base_defref_tl} { \__starray_fix_terms:nn {#1.#4}{#2_#3.#4} } @@ -688,10 +669,8 @@ \cs_new_protected:Npn \__starray_fix_terms_seq:nnnn #1#2#3#4 { - \prop_get:cnN - {\l__starray_prefix_tl #2 _base_prop} - {def_ref} - \l_tmpa_tl + \tl_set_eq:Nc \l_tmpa_tl {\l__starray_prefix_tl #2 _base_defref_tl} + \seq_map_inline:cn {\tl_use:N \l__starray_prefix_tl \tl_use:N \l_tmpa_tl _defstkeys_seq} {\__starray_fix_terms_seq_aux:nnnn {#1}{#2}{#4}{##1} } @@ -718,7 +697,7 @@ { \tl_set:Ne \l_tmpb_tl {\__starray_get_root:w #1 . \q_nil \q_stop} - \__starray_if_valid:nTF { \l__starray_prefix_tl \l_tmpb_tl _def_prop} + \__starray_if_exist:nTF { \l__starray_prefix_tl \l_tmpb_tl _defref_tl} { \__starray_fix_terms:ee {\l_tmpb_tl}{\l_tmpb_tl} } @@ -738,7 +717,7 @@ \cs_new_protected:Npn \starray_def_struct:nn #1#2 { - \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF { \l__starray_prefix_tl #1 _defref_tl} { \__starray_def_struct:nn {#1} {#2} } @@ -751,7 +730,7 @@ \prg_new_protected_conditional:Npnn \starray_def_struct:nn #1#2 {T, F, TF} { - \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF { \l__starray_prefix_tl #1 _defref_tl} { \__starray_def_struct:nn {#1} {#2} \prg_return_true: @@ -789,7 +768,7 @@ { \__starray_def_from_keyval_testdot_aux:wTF #2 { - \tl_set:Ne \l__starray_tmpST_tl { #1 } + \tl_set:Ne \l__starray_tmp_ST_tl { #1 } \prg_return_true: } % dot struct, OK { @@ -804,11 +783,11 @@ \group_begin: \__starray_def_from_keyval_testdot:wTF #2 . \q_nil \q_stop { - \tl_set:ce {l__starray_tmp A _tl} {#1 . \l__starray_tmpST_tl} - \__starray_def_struct:ne {#1} {\l__starray_tmpST_tl} + \tl_set:Ne \l__starray_tmpA_tl {#1 . \l__starray_tmp_ST_tl} + \__starray_def_struct:ne {#1} {\l__starray_tmp_ST_tl} \keyval_parse:nnn - {\__starray_def_from_keyval_parse:en {\tl_use:c {l__starray_tmp A _tl}}} - {\__starray_def_from_keyval_parse:enn {\tl_use:c {l__starray_tmp A _tl}}} + {\__starray_def_from_keyval_parse:en {\tl_use:N \l__starray_tmpA_tl}} + {\__starray_def_from_keyval_parse:enn {\tl_use:N \l__starray_tmpA_tl}} {#3} } { @@ -837,7 +816,7 @@ \cs_new_protected:Npn \starray_def_from_keyval:nn #1#2 { - \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF { \l__starray_prefix_tl #1 _defref_tl} { \keyval_parse:nnn {\__starray_def_from_keyval_parse:en {#1}} @@ -855,7 +834,7 @@ \prg_new_protected_conditional:Npnn \starray_def_from_keyval:nn #1#2 {T, F, TF} { - \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} + \__starray_if_exist:nTF { \l__starray_prefix_tl #1 _defref_tl} { \keyval_parse:nnn {\__starray_def_from_keyval_parse:en {#1}} @@ -888,12 +867,12 @@ {\l__starray_prefix_tl #1 _base_iter_int} {\l__starray_prefix_tl #1 _base_cnt_int} - \tl_set:Ne \l__starray_tmpa_tl + \tl_set:Ne \l__starray_tmp_A_tl { \int_to_Alph:e {\int_use:c {\l__starray_prefix_tl #1 _base_cnt_int} } } \prop_put:cee {\l__starray_prefix_tl #1 _base_idxhash_prop} { \int_use:c {\l__starray_prefix_tl #1 _base_cnt_int} } - { \l__starray_tmpa_tl } + { \l__starray_tmp_A_tl } \prop_put:cee {\l__starray_prefix_tl #1 _base_iterhash_prop} { \int_use:c {\l__starray_prefix_tl #1 _base_cnt_int} } @@ -903,7 +882,7 @@ { \prop_put:cee {\l__starray_prefix_tl #1 _base_idxhash_prop} { #2 } - { \l__starray_tmpa_tl } + { \l__starray_tmp_A_tl } \prop_put:cee {\l__starray_prefix_tl #1 _base_iterhash_prop} { #2 } @@ -911,18 +890,20 @@ } \prop_new_linked:c - { \l__starray_prefix_tl #1 _ \l__starray_tmpa_tl _term_prop } + { \l__starray_prefix_tl #1 _ \l__starray_tmp_A_tl _term_prop } - \prop_get:cnN {\l__starray_prefix_tl #1 _base_prop} {def_ref} \l_tmpb_tl + \tl_set_eq:Nc \l_tmpb_tl {\l__starray_prefix_tl #1 _base_defref_tl} - \prop_gset_eq:cc { \l__starray_prefix_tl #1 _ \l__starray_tmpa_tl _term_prop } {\l__starray_prefix_tl \l_tmpb_tl _defkeys_prop} + \prop_gset_eq:cc { \l__starray_prefix_tl #1 _ \l__starray_tmp_A_tl _term_prop } {\l__starray_prefix_tl \l_tmpb_tl _defkeys_prop} + + %\prop_make_linked:c { \l__starray_prefix_tl #1 _ \l__starray_tmp_A_tl _term_prop } % map over 'all sub-starrays parts of def_ref -> st_seq (those starting with a dot, @st_seq) \seq_map_inline:cn {\l__starray_prefix_tl \l_tmpb_tl _defstkeys_seq} { \__starray_sub_base_new:nnn - { \l_tmpb_tl }{ #1 _ \l__starray_tmpa_tl } {##1} + { \l_tmpb_tl }{ #1 _ \l__starray_tmp_A_tl } {##1} } } @@ -1014,15 +995,12 @@ { \int_use:c {\l__starray_prefix_tl #2#3 _base_iter_int } } { l__starray_tmp #1 A_tl } { - \prop_get:cnc - {\l__starray_prefix_tl #2#3 _base_prop} - {def_ref} - { l__starray_tmp #1 Adefref_tl } + \tl_set_eq:Nc \l__starray_tmp_C_tl {\l__starray_prefix_tl #2#3 _base_defref_tl} - \seq_if_empty:cF {\l__starray_prefix_tl \use:c { l__starray_tmp #1 Adefref_tl } _defstkeys_seq} + \seq_if_empty:cF {\l__starray_prefix_tl \l__starray_tmp_C_tl _defstkeys_seq} { \seq_map_inline:cn - {\l__starray_prefix_tl \use:c { l__starray_tmp #1 Adefref_tl } _defstkeys_seq} + {\l__starray_prefix_tl \l__starray_tmp_C_tl _defstkeys_seq} { \__starray_set_iter:neTF { 1 } @@ -1793,13 +1771,8 @@ % #3.<#4>_[<#4>] (idx construct from #4) 'next #3' % - \prop_get:cnN - {\l__starray_prefix_tl #2 _base_prop} - {def_ref} - \l__starray_tmp_A_tl - \seq_if_in:cnTF - {\tl_use:N \l__starray_prefix_tl \tl_use:N \l__starray_tmp_A_tl _defstkeys_seq} + {\tl_use:N \l__starray_prefix_tl \tl_use:c {\l__starray_prefix_tl #2 _base_defref_tl} _defstkeys_seq} {#4} { \int_compare:nNnTF {\int_use:c { \tl_use:N \l__starray_prefix_tl #3 .#4 _base_iter_int }} < {1} @@ -1837,26 +1810,21 @@ } } { - \prop_get:cnN - {\l__starray_prefix_tl #2 _base_prop} - {def_ref} - \l__starray_tmp_A_tl - \seq_if_in:ceTF - {\tl_use:N \l__starray_prefix_tl \tl_use:N \l__starray_tmp_A_tl _defstkeys_seq} + {\tl_use:N \l__starray_prefix_tl \tl_use:c {\l__starray_prefix_tl #2 _base_defref_tl} _defstkeys_seq} { \tl_use:c{l__starray_tmp #1 :B_tl} } { \prop_get:ceNTF { \l__starray_prefix_tl #3. \tl_use:c{l__starray_tmp #1 :B_tl} _base_idxhash_prop } { \tl_use:c{l__starray_tmp #1 :A_tl}} - \l__starray_tmp_B_tl + \l__starray_tmp_D_tl { %% here should be all the remaining code. 'everything fine so far'. \tl_set:ce { l__starray_tmp #1 _idx_tl } { #3 . \tl_use:c{l__starray_tmp #1 :B_tl} _ - \tl_use:N \l__starray_tmp_B_tl + \tl_use:N \l__starray_tmp_D_tl } \tl_put_left:cn { l__starray_tmp #1 :B_tl } { #3 . } @@ -2089,8 +2057,8 @@ { \l__starray_parser_aux_tl \l__starray_parsed_term_tl } \tl_set:Nn \l__starray_parser_aux_tl { . } - \__starray_if_valid:eTF - {\l__starray_prefix_tl \l__starray_parsed_ref_tl _base_prop} + \__starray_if_exist:eTF + {\l__starray_prefix_tl \l__starray_parsed_ref_tl _base_defref_tl} { \quark_if_nil:nTF {#2} { % this is the last one @@ -2283,7 +2251,7 @@ \cs_new_protected:Npn \__starray_show_def_item:nnn #1#2#3 { - \tl_gput_right:Nn \l__starray_tmpa_tl + \tl_gput_right:Nn \l__starray_tmp_B_tl { \l__starray_showcmd_tl > #1 \use:nnn { ~ } { ~ } { ~ } \tl_to_str:n { {#2} } @@ -2296,7 +2264,7 @@ \cs_new_protected:Npn \__starray_show_def:nnn #1#2#3 { \group_begin: - \tl_gput_right:Nn \l__starray_tmpa_tl + \tl_gput_right:Nn \l__starray_tmp_B_tl { \l__starray_showcmd_tl > #1 \tl_to_str:n {{#3} ~ struct} @@ -2324,24 +2292,24 @@ \cs_new_protected:Npn \starray_show_def:n #1 { - \tl_clear:N \l__starray_tmpa_tl + \tl_clear:N \l__starray_tmp_B_tl \tl_set:Nn \l__starray_showcmd_tl \iow_newline: \__starray_show_def:nnn {}{}{#1} \msg_show:nnxxx {starray}{info / show} { show~def } { The~ starray~ <#1> ~is~defined~as~follow: } - { \tl_use:N \l__starray_tmpa_tl } + { \tl_use:N \l__starray_tmp_B_tl } } \cs_new_protected:Npn \starray_show_def_in_text:n #1 { - \tl_clear:N \l__starray_tmpa_tl + \tl_clear:N \l__starray_tmp_B_tl \tl_set:Nn \l__starray_showcmd_tl \par \__starray_show_def:nnn {}{}{#1} - \tl_use:N \l__starray_tmpa_tl + \tl_use:N \l__starray_tmp_B_tl } @@ -2365,7 +2333,7 @@ \cs_new_protected:Npn \__starray_show_term_item:nnnnn #1#2#3#4#5 { \group_begin: - \tl_gput_right:Nn \l__starray_tmpa_tl + \tl_gput_right:Nn \l__starray_tmp_B_tl { \l__starray_showcmd_tl > #1 \tl_to_str:n { {#3[#4]} ~ (idx: ~ #5)} @@ -2376,10 +2344,7 @@ {\l__starray_prefix_tl #2 #3 _ #5 _term_prop} {\__starray_show_def_item:nnn {#1 } {##1}{##2}} - \prop_get:cnN - { \l__starray_prefix_tl #2 #3 _base_prop } - { def_ref } - \l_tmpa_tl + \tl_set_eq:Nc \l_tmpa_tl {\l__starray_prefix_tl #2#3 _base_defref_tl} \seq_if_empty:cTF { \l__starray_prefix_tl \l_tmpa_tl _defstkeys_seq } {} @@ -2412,24 +2377,24 @@ \cs_new_protected:Npn \starray_show_terms:n #1 { - \tl_clear:N \l__starray_tmpa_tl + \tl_clear:N \l__starray_tmp_B_tl \tl_set:Nn \l__starray_showcmd_tl \iow_newline: \__starray_show_terms:nnn {}{}{#1} \msg_show:nnxxx {starray}{info / show} { show~terms } { The~ starray~ <#1> ~has~the~following~terms: } - { \tl_use:N \l__starray_tmpa_tl } + { \tl_use:N \l__starray_tmp_B_tl } } \cs_new_protected:Npn \starray_show_terms_in_text:n #1 { - \tl_clear:N \l__starray_tmpa_tl + \tl_clear:N \l__starray_tmp_B_tl \tl_set:Nn \l__starray_showcmd_tl \par \__starray_show_terms:nnn {}{}{#1} - \tl_use:N \l__starray_tmpa_tl + \tl_use:N \l__starray_tmp_B_tl } |