diff options
author | Norbert Preining <norbert@preining.info> | 2023-05-06 03:01:13 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-05-06 03:01:13 +0000 |
commit | 507fa9c669d7e4bc2c808f269113c6ced0b18827 (patch) | |
tree | 92d0ad38dc9549526803851fa62b4399f03006ac /macros/latex/contrib/l3kernel/l3candidates.dtx | |
parent | 3cf2e76fc502cb474081c80838c95ecaba2f386d (diff) |
CTAN sync 202305060301
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3candidates.dtx')
-rw-r--r-- | macros/latex/contrib/l3kernel/l3candidates.dtx | 862 |
1 files changed, 1 insertions, 861 deletions
diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx index 478db99daa..4c08d8e422 100644 --- a/macros/latex/contrib/l3kernel/l3candidates.dtx +++ b/macros/latex/contrib/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-04-20} +% \date{Released 2023-05-05} % % \maketitle % @@ -84,221 +84,6 @@ % into the kernel. However, real use sometimes leads to better ideas, so functions from this module are % \textbf{not necessarily stable} and we may have to adjust them! % -% \section{Additions to \pkg{l3expan}} -% -% \begin{function}[added = 2018-04-04, updated = 2019-02-08] -% {\exp_args_generate:n} -% \begin{syntax} -% \cs{exp_args_generate:n} \Arg{variant argument specifiers} -% \end{syntax} -% Defines \cs[no-index]{exp_args:N\meta{variant}} functions for each -% \meta{variant} given in the comma list \Arg{variant argument -% specifiers}. Each \meta{variant} should consist of the letters |N|, -% |c|, |n|, |V|, |v|, |o|, |f|, |e|, |x|, |p| and the resulting function is -% protected if the letter |x| appears in the \meta{variant}. This is -% only useful for cases where \cs{cs_generate_variant:Nn} is not -% applicable. -% \end{function} -% -% \section{Additions to \pkg{l3fp}} -% -% \begin{function}[pTF, added = 2019-08-25]{\fp_if_nan:n} -% \begin{syntax} -% \cs{fp_if_nan:n} \Arg{fp expr} -% \end{syntax} -% Evaluates the \meta{fp expr} and tests whether the result is exactly -% \nan{}. The test returns \texttt{false} for any other result, even -% a tuple containing \nan{}. -% \end{function} -% -% \section{Additions to \pkg{l3file}} -% -% \begin{function}[added = 2018-12-29]{\iow_allow_break:} -% \begin{syntax} -% \cs{iow_allow_break:} -% \end{syntax} -% In the first argument of \cs{iow_wrap:nnnN} (for instance in -% messages), inserts a break-point that allows a line break. -% In other words this is a zero-width breaking space. -% \end{function} -% -% \begin{function}[added = 2019-03-23]{\ior_get_term:nN, \ior_str_get_term:nN} -% \begin{syntax} -% \cs{ior_get_term:nN} \meta{prompt} \meta{token list variable} -% \end{syntax} -% Function that reads one or more lines (until an equal number of left -% and right braces are found) from the terminal and stores -% the result locally in the \meta{token list} variable. Tokenization -% occurs as described for \cs{ior_get:NN} or \cs{ior_str_get:NN}, respectively. -% When the \meta{prompt} -% is empty, \TeX{} will wait for input without any other indication: -% typically the programmer will have provided a suitable text using -% e.g.~\cs{iow_term:n}. Where the \meta{prompt} is given, it will appear -% in the terminal followed by an |=|, e.g. -% \begin{verbatim} -% prompt= -% \end{verbatim} -% \end{function} -% -% \begin{function}[added = 2019-05-08]{\ior_shell_open:Nn} -% \begin{syntax} -% \cs{ior_shell_open:Nn} \meta{stream} \Arg{shell~command} -% \end{syntax} -% Opens the \emph{pseudo}-file created by the output of the -% \meta{shell command} for reading using \meta{stream} as the -% control sequence for access. If the \meta{stream} was already -% open it is closed before the new operation begins. The -% \meta{stream} is available for access immediately and will remain -% allocated to \meta{shell command} until a \cs{ior_close:N} instruction -% is given or the \TeX{} run ends. -% If piped system calls are disabled an error is raised. -% -% For details of handling of the \meta{shell command}, see -% \cs{sys_get_shell:nnNTF}. -% \end{function} -% -% \section{Additions to \pkg{l3flag}} -% -% \begin{function}[EXP, added = 2018-04-02]{\flag_raise_if_clear:n} -% \begin{syntax} -% \cs{flag_raise_if_clear:n} \Arg{flag name} -% \end{syntax} -% Ensures the \meta{flag} is raised by making its height at least~$1$, -% locally. -% \end{function} -% -% \section{Additions to \pkg{l3intarray}} -% -% \begin{function}[added = 2018-05-05] -% { -% \intarray_gset_rand:Nnn, \intarray_gset_rand:cnn, -% \intarray_gset_rand:Nn, \intarray_gset_rand:cn -% } -% \begin{syntax} -% \cs{intarray_gset_rand:Nnn} \meta{intarray~var} \Arg{minimum} \Arg{maximum} -% \cs{intarray_gset_rand:Nn} \meta{intarray~var} \Arg{maximum} -% \end{syntax} -% Evaluates the integer expressions \meta{minimum} and \meta{maximum} -% then sets each entry (independently) of the \meta{integer array -% variable} to a pseudo-random number between the two (with bounds -% included). If the absolute value of either bound is bigger than -% $2^{30}-1$, an error occurs. Entries are generated in the same way -% as repeated calls to \cs{int_rand:nn} or \cs{int_rand:n} -% respectively, in particular for the second function the -% \meta{minimum} is $1$. -% Assignments are always global. -% This is not available in older versions of \XeTeX{}. -% \end{function} -% -% \begin{function}[added = 2018-05-04, rEXP]{\intarray_to_clist:N} -% \begin{syntax} -% \cs{intarray_to_clist:N} \meta{intarray~var} -% \end{syntax} -% Converts the \meta{intarray} to integer denotations separated by -% commas. All tokens have category code other. If the -% \meta{intarray} has no entry the result is empty; otherwise the -% result has one fewer comma than the number of items. -% \end{function} -% -% \section{Additions to \pkg{l3msg}} -% -% \begin{function}[added = 2017-12-04]{\msg_show_eval:Nn, \msg_log_eval:Nn} -% \begin{syntax} -% \cs{msg_show_eval:Nn} \meta{function} \Arg{expression} -% \end{syntax} -% Shows or logs the \meta{expression} (turned into a string), an equal -% sign, and the result of applying the \meta{function} to the -% \Arg{expression} (with \texttt{f}-expansion). For instance, if the -% \meta{function} is \cs{int_eval:n} and the \meta{expression} is -% |1+2| then this logs |> 1+2=3.| -% \end{function} -% -% \begin{function}[EXP, added = 2017-12-04] -% {\msg_show_item:n, \msg_show_item_unbraced:n, \msg_show_item:nn, \msg_show_item_unbraced:nn} -% \begin{syntax} -% \cs{seq_map_function:NN} \meta{seq} \cs{msg_show_item:n} -% \cs{prop_map_function:NN} \meta{prop} \cs{msg_show_item:nn} -% \end{syntax} -% Used in the text of messages for \cs{msg_show:nnxxxx} to show or log -% a list of items or key--value pairs. The one-argument functions are -% used for sequences, clist or token lists and the others for property -% lists. These functions turn their arguments to strings. -% \end{function} -% -% \section{Additions to \pkg{l3prg}} -% -% \begin{function}[added = 2018-05-10] -% { -% \bool_set_inverse:N , \bool_set_inverse:c , -% \bool_gset_inverse:N, \bool_gset_inverse:c -% } -% \begin{syntax} -% \cs{bool_set_inverse:N} \meta{boolean} -% \end{syntax} -% Toggles the \meta{boolean} from \texttt{true} to \texttt{false} and -% conversely: sets it to the inverse of its current value. -% \end{function} -% -% \begin{function}[added = 2019-02-10, EXP, noTF] -% {\bool_case_true:n, \bool_case_false:n} -% \begin{syntax} -% \cs{bool_case_true:nTF} \\ -% ~~|{| \\ -% ~~~~\Arg{boolexpr case_1} \Arg{code case_1} \\ -% ~~~~\Arg{boolexpr case_2} \Arg{code case_2} \\ -% ~~~~\ldots \\ -% ~~~~\Arg{boolexpr case_n} \Arg{code case_n} \\ -% ~~|}| \\ -% ~~\Arg{true code} -% ~~\Arg{false code} -% \end{syntax} -% Evaluates in turn each of the \meta{boolean expression cases} until -% the first one that evaluates to \texttt{true} or to \texttt{false}, -% for \cs{bool_case_true:n} and \cs{bool_case_false:n}, respectively. -% The \meta{code} associated to this first case is left in the input -% stream, followed by the \meta{true code}, and other cases are -% discarded. If none of the cases match then only the \meta{false -% code} is inserted. The functions \cs{bool_case_true:n} and -% \cs{bool_case_false:n}, which do nothing if there is no match, are -% also available. For example -% \begin{verbatim} -% \bool_case_true:nF -% { -% { \dim_compare_p:n { \l__mypkg_wd_dim <= 10pt } } -% { Fits } -% { \int_compare_p:n { \l__mypkg_total_int >= 10 } } -% { Many } -% { \l__mypkg_special_bool } -% { Special } -% } -% { No idea! } -% \end{verbatim} -% leaves \enquote{\texttt{Fits}} or \enquote{\texttt{Many}} or -% \enquote{\texttt{Special}} or \enquote{\texttt{No idea!}} in the -% input stream, in a way similar to some other language's -% \enquote{\texttt{if} \ldots\ \texttt{elseif} \ldots\ \texttt{elseif} \ldots\ -% \texttt{else} \ldots}. -% \end{function} -% -% \section{Additions to \pkg{l3prop}} -% -% \begin{function}[EXP, added = 2016-12-06] -% {\prop_rand_key_value:N, \prop_rand_key_value:c} -% \begin{syntax} -% \cs{prop_rand_key_value:N} \meta{property list} -% \end{syntax} -% Selects a pseudo-random key--value pair from the \meta{property list} -% and returns \Arg{key} and \Arg{value}. If the \meta{property list} is -% empty the result is empty. -% This is not available in older versions of \XeTeX{}. -% \begin{texnote} -% The result is returned within the \tn{unexpanded} -% primitive (\cs{exp_not:n}), which means that the \meta{value} -% does not expand further when appearing in an \texttt{x}-type -% or \texttt{e}-type argument expansion. -% \end{texnote} -% \end{function} -% % \section{Additions to \pkg{l3seq}} % % \begin{function}[rEXP] @@ -334,44 +119,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[added = 2018-04-06] -% {\seq_set_from_function:NnN, \seq_gset_from_function:NnN} -% \begin{syntax} -% \cs{seq_set_from_function:NnN} \meta{seq~var} \Arg{loop~code} \meta{function} -% \end{syntax} -% Sets the \meta{seq~var} equal to a sequence whose items are obtained -% by \texttt{x}-expanding \meta{loop~code} \meta{function}. This -% expansion must result in successive calls to the \meta{function} -% with no nonexpandable tokens in between. More precisely the -% \meta{function} is replaced by a wrapper function that inserts the -% appropriate separators between items in the sequence. The -% \meta{loop~code} must be expandable; it can be for example -% \cs{tl_map_function:NN} \meta{tl~var} or \cs{clist_map_function:nN} -% \Arg{clist} or \cs{int_step_function:nnnN} \Arg{initial value} -% \Arg{step} \Arg{final value}. -% \end{function} -% -% \begin{function}[added = 2018-04-06] -% {\seq_set_from_inline_x:Nnn, \seq_gset_from_inline_x:Nnn} -% \begin{syntax} -% \cs{seq_set_from_inline_x:Nnn} \meta{seq~var} \Arg{loop~code} \Arg{inline~code} -% \end{syntax} -% Sets the \meta{seq~var} equal to a sequence whose items are obtained -% by \texttt{x}-expanding \meta{loop~code} applied to a -% \meta{function} derived from the \meta{inline~code}. A -% \meta{function} is defined, that takes one argument, -% \texttt{x}-expands the \meta{inline~code} with that argument -% as~|#1|, then adds appropriate separators to turn the result into an -% item of the sequence. The \texttt{x}-expansion of \meta{loop~code} -% \meta{function} must result in successive calls to the -% \meta{function} with no nonexpandable tokens in between. The -% \meta{loop~code} must be expandable; it can be for example -% \cs{tl_map_function:NN} \meta{tl~var} or \cs{clist_map_function:nN} -% \Arg{clist} or \cs{int_step_function:nnnN} \Arg{initial value} -% \Arg{step} \Arg{final value}, but not the analogous \enquote{inline} -% mappings. -% \end{function} -% % \begin{function}[added = 2021-04-29, noTF] % {\seq_set_item:Nnn, \seq_set_item:cnn, \seq_gset_item:Nnn, \seq_gset_item:cnn} % \begin{syntax} @@ -408,87 +155,8 @@ % assigned locally for |pop| or globally for |gpop| functions. % \end{function} % -% \section{Additions to \pkg{l3sys}} -% -% \begin{variable}[added = 2018-05-02]{\c_sys_engine_version_str} -% The version string of the current engine, in the same form as -% given in the banner issued when running a job. For \pdfTeX{} -% and \LuaTeX{} this is of the form -% \begin{quote} -% \meta{major}.\meta{minor}.\meta{revision} -% \end{quote} -% For \XeTeX{}, the form is -% \begin{quote} -% \meta{major}.\meta{minor} -% \end{quote} -% For \pTeX{} and \upTeX{}, only releases since \TeX{} Live 2018 -% make the data available, and the form is more complex, as it comprises -% the \pTeX{} version, the \upTeX{} version and the e-\pTeX{} version. -% \begin{quote} -% p\meta{major}.\meta{minor}.\meta{revision}-u\meta{major}.\meta{minor}^^A -% -\meta{epTeX} -% \end{quote} -% where the |u| part is only present for \upTeX{}. -% \end{variable} -% -% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_rand_exist:} -% \begin{syntax} -% \cs{sys_if_rand_exist_p:} -% \cs{sys_if_rand_exist:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the engine has a pseudo-random number generator. Currently -% this is the case in \pdfTeX{}, \LuaTeX{}, \pTeX{}, \upTeX{} and recent -% releases of \XeTeX{}. -% \end{function} -% % \section{Additions to \pkg{l3tl}} % -% \begin{function}[EXP, added = 2017-07-15] -% { -% \tl_range_braced:Nnn, \tl_range_braced:cnn, \tl_range_braced:nnn, -% \tl_range_unbraced:Nnn, \tl_range_unbraced:cnn, \tl_range_unbraced:nnn -% } -% \begin{syntax} -% \cs{tl_range_braced:Nnn} \meta{tl~var} \Arg{start index} \Arg{end index} -% \cs{tl_range_braced:nnn} \Arg{token list} \Arg{start index} \Arg{end index} -% \cs{tl_range_unbraced:Nnn} \meta{tl~var} \Arg{start index} \Arg{end index} -% \cs{tl_range_unbraced:nnn} \Arg{token list} \Arg{start index} \Arg{end index} -% \end{syntax} -% Leaves in the input stream the items from the \meta{start index} to -% the \meta{end index} inclusive, using the same indexing as -% \cs{tl_range:nnn}. Spaces are ignored. Regardless of whether items -% appear with or without braces in the \meta{token list}, the -% \cs{tl_range_braced:nnn} function wraps each item in braces, while -% \cs{tl_range_unbraced:nnn} does not (overall it removes an outer set -% of braces). For instance, -% \begin{verbatim} -% \iow_term:x { \tl_range_braced:nnn { abcd~{e{}}f } { 2 } { 5 } } -% \iow_term:x { \tl_range_braced:nnn { abcd~{e{}}f } { -4 } { -1 } } -% \iow_term:x { \tl_range_braced:nnn { abcd~{e{}}f } { -2 } { -1 } } -% \iow_term:x { \tl_range_braced:nnn { abcd~{e{}}f } { 0 } { -1 } } -% \end{verbatim} -% prints \verb*|{b}{c}{d}{e{}}|, \verb*|{c}{d}{e{}}{f}|, \verb*|{e{}}{f}|, and an empty -% line to the terminal, while -% \begin{verbatim} -% \iow_term:x { \tl_range_unbraced:nnn { abcd~{e{}}f } { 2 } { 5 } } -% \iow_term:x { \tl_range_unbraced:nnn { abcd~{e{}}f } { -4 } { -1 } } -% \iow_term:x { \tl_range_unbraced:nnn { abcd~{e{}}f } { -2 } { -1 } } -% \iow_term:x { \tl_range_unbraced:nnn { abcd~{e{}}f } { 0 } { -1 } } -% \end{verbatim} -% prints \verb*|bcde{}|, \verb*|cde{}f|, \verb*|e{}f|, and an empty -% line to the terminal. Because braces are removed, the result of -% \cs{tl_range_unbraced:nnn} may have a different number of items as -% for \cs{tl_range:nnn} or \cs{tl_range_braced:nnn}. In cases where -% preserving spaces is important, consider the slower function -% \cs{tl_range:nnn}. -% \begin{texnote} -% The result is returned within the \tn{unexpanded} -% primitive (\cs{exp_not:n}), which means that the \meta{item} -% does not expand further when appearing in an \texttt{x}-type -% or \texttt{e}-type argument expansion. -% \end{texnote} -% \end{function} -% % \begin{function}[added = 2018-04-01]{\tl_build_begin:N, \tl_build_gbegin:N} % \begin{syntax} % \cs{tl_build_begin:N} \meta{tl~var} @@ -557,46 +225,6 @@ % \cs[no-index]{tl_build_\ldots{}} functions. % \end{function} % -% \section{Additions to \pkg{l3token}} -% -% \begin{variable}[added = 2017-08-07]{\c_catcode_active_space_tl} -% Token list containing one character with category code $13$, -% (\enquote{active}), and character code $32$ (space). -% \end{variable} -% -% \begin{function}[added = 2018-09-23] -% { -% \peek_catcode_collect_inline:Nn, -% \peek_charcode_collect_inline:Nn, -% \peek_meaning_collect_inline:Nn -% } -% \begin{syntax} -% \cs{peek_catcode_collect_inline:Nn} \meta{test token} \Arg{inline code} -% \cs{peek_charcode_collect_inline:Nn} \meta{test token} \Arg{inline code} -% \cs{peek_meaning_collect_inline:Nn} \meta{test token} \Arg{inline code} -% \end{syntax} -% Collects and removes tokens from the input stream until finding a -% token that does not match the \meta{test token} (as defined by the -% test \cs{token_if_eq_catcode:NNTF} or \cs{token_if_eq_charcode:NNTF} -% or \cs{token_if_eq_meaning:NNTF}). The collected tokens are passed -% to the \meta{inline code} as~|#1|. When begin-group or end-group -% tokens (usually |{| or~|}|) are collected they are replaced by -% implicit \cs{c_group_begin_token} and \cs{c_group_end_token}, and -% when spaces (including \cs{c_space_token}) are collected they are -% replaced by explicit spaces. -% -% For example the following code prints ``Hello'' to the terminal and -% leave ``, world!'' in the input stream. -% \begin{verbatim} -% \peek_catcode_collect_inline:Nn A { \iow_term:n {#1} } Hello,~world! -% \end{verbatim} -% Another example is that the following code tests if the next token is |*|, ignoring intervening spaces, but putting them back using |#1| if there is no~|*|. -% \begin{verbatim} -% \peek_meaning_collect_inline:Nn \c_space_token -% { \peek_charcode:NTF * { star } { no~star #1 } } -% \end{verbatim} -% \end{function} -% % \end{documentation} % % \begin{implementation} @@ -607,202 +235,6 @@ %<*package> % \end{macrocode} % -% \subsection{Additions to \pkg{l3flag}} -% -% \begin{macrocode} -%<@@=flag> -% \end{macrocode} -% -% \begin{macro}[EXP]{\flag_raise_if_clear:n} -% It might be faster to just call the \enquote{trap} function in all -% cases but conceptually the function name suggests we should only run -% it if the flag is zero in case the \enquote{trap} made customizable -% in the future. -% \begin{macrocode} -\cs_new:Npn \flag_raise_if_clear:n #1 - { - \if_cs_exist:w flag~#1~0 \cs_end: - \else: - \cs:w flag~#1 \cs_end: 0 ; - \fi: - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Additions to \pkg{l3msg}} -% -% \begin{macrocode} -%<@@=msg> -% \end{macrocode} -% -% \begin{macro}{\msg_show_eval:Nn, \msg_log_eval:Nn, \@@_show_eval:nnN} -% A short-hand used for \cs{int_show:n} and similar functions that -% passes to \cs{tl_show:n} the result of applying |#1| (a -% function such as \cs{int_eval:n}) to the expression |#2|. The use of -% \texttt{f}-expansion ensures that |#1| is expanded in the scope in which the -% show command is called, rather than in the group created by -% \cs{iow_wrap:nnnN}. This is only important for expressions -% involving the \tn{currentgrouplevel} or \tn{currentgrouptype}. -% On the other hand we want the expression to be converted to a string -% with the usual escape character, hence within the wrapping code. -% \begin{macrocode} -\cs_new_protected:Npn \msg_show_eval:Nn #1#2 - { \exp_args:Nf \@@_show_eval:nnN { #1 {#2} } {#2} \tl_show:n } -\cs_new_protected:Npn \msg_log_eval:Nn #1#2 - { \exp_args:Nf \@@_show_eval:nnN { #1 {#2} } {#2} \tl_log:n } -\cs_new_protected:Npn \@@_show_eval:nnN #1#2#3 { #3 { #2 = #1 } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\msg_show_item:n} -% \begin{macro}[EXP]{\msg_show_item_unbraced:n} -% \begin{macro}[EXP]{\msg_show_item:nn} -% \begin{macro}[EXP]{\msg_show_item_unbraced:nn} -% Each item in the variable is formatted using one of the following -% functions. We cannot use |\\| and so on because these short-hands -% cannot be used inside the arguments of messages, only when defining -% the messages. -% \begin{macrocode} -\cs_new:Npx \msg_show_item:n #1 - { \iow_newline: > ~ \c_space_tl \exp_not:N \tl_to_str:n { {#1} } } -\cs_new:Npx \msg_show_item_unbraced:n #1 - { \iow_newline: > ~ \c_space_tl \exp_not:N \tl_to_str:n {#1} } -\cs_new:Npx \msg_show_item:nn #1#2 - { - \iow_newline: > \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n { {#1} } - \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n { {#2} } - } -\cs_new:Npx \msg_show_item_unbraced:nn #1#2 - { - \iow_newline: > \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n {#1} - \use:nn { ~ } { ~ } => \use:nn { ~ } { ~ } - \exp_not:N \tl_to_str:n {#2} - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Additions to \pkg{l3prg}} -% -% \begin{macrocode} -%<@@=bool> -% \end{macrocode} -% -% \begin{macro}[added = 2018-05-10] -% {\bool_set_inverse:N, \bool_set_inverse:c, \bool_gset_inverse:N, \bool_gset_inverse:c} -% Set to \texttt{false} or \texttt{true} locally or globally. -% \begin{macrocode} -\cs_new_protected:Npn \bool_set_inverse:N #1 - { \bool_if:NTF #1 { \bool_set_false:N } { \bool_set_true:N } #1 } -\cs_generate_variant:Nn \bool_set_inverse:N { c } -\cs_new_protected:Npn \bool_gset_inverse:N #1 - { \bool_if:NTF #1 { \bool_gset_false:N } { \bool_gset_true:N } #1 } -\cs_generate_variant:Nn \bool_gset_inverse:N { c } -% \end{macrocode} -% \end{macro} -% -% \begin{variable}{\s_@@_mark,\s_@@_stop} -% Internal scan marks. -% \begin{macrocode} -\scan_new:N \s_@@_mark -\scan_new:N \s_@@_stop -% \end{macrocode} -% \end{variable} -% -% \begin{macro}[EXP, noTF]{\bool_case_true:n, \bool_case_false:n} -% \begin{macro}{\@@_case:NnTF} -% \begin{macro}{\@@_case_true:w, \@@_case_false:w, \@@_case_end:nw} -% For boolean cases the overall idea is the same as for -% \cs{tl_case:nnTF} as described in \pkg{l3tl}. -% \begin{macrocode} -\cs_new:Npn \bool_case_true:nTF - { \exp:w \@@_case:NnTF \c_true_bool } -\cs_new:Npn \bool_case_true:nT #1#2 - { \exp:w \@@_case:NnTF \c_true_bool {#1} {#2} { } } -\cs_new:Npn \bool_case_true:nF #1 - { \exp:w \@@_case:NnTF \c_true_bool {#1} { } } -\cs_new:Npn \bool_case_true:n #1 - { \exp:w \@@_case:NnTF \c_true_bool {#1} { } { } } -\cs_new:Npn \bool_case_false:nTF - { \exp:w \@@_case:NnTF \c_false_bool } -\cs_new:Npn \bool_case_false:nT #1#2 - { \exp:w \@@_case:NnTF \c_false_bool {#1} {#2} { } } -\cs_new:Npn \bool_case_false:nF #1 - { \exp:w \@@_case:NnTF \c_false_bool {#1} { } } -\cs_new:Npn \bool_case_false:n #1 - { \exp:w \@@_case:NnTF \c_false_bool {#1} { } { } } -\cs_new:Npn \@@_case:NnTF #1#2#3#4 - { - \bool_if:NTF #1 \@@_case_true:w \@@_case_false:w - #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop - } -\cs_new:Npn \@@_case_true:w #1#2 - { - \bool_if:nTF {#1} - { \@@_case_end:nw {#2} } - { \@@_case_true:w } - } -\cs_new:Npn \@@_case_false:w #1#2 - { - \bool_if:nTF {#1} - { \@@_case_false:w } - { \@@_case_end:nw {#2} } - } -\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop - { \exp_end: #1 #4 } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Additions to \pkg{l3prop}} -% -% \begin{macrocode} -%<@@=prop> -% \end{macrocode} -% -% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw} -% Functions to gobble up to a scan mark. -% \begin{macrocode} -\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP] -% {\prop_rand_key_value:N, \prop_rand_key_value:c} -% \begin{macro}[EXP]{\@@_rand_item:w} -% Contrarily to |clist|, |seq| and |tl|, there is no function to get -% an item of a |prop| given an integer between $1$ and the number of -% items, so we write the appropriate code. There is no bounds -% checking because \cs{int_rand:nn} is always within bounds. The -% initial \cs{int_value:w} is stopped by the first \cs{s_@@} in~|#1|. -% \begin{macrocode} -\cs_new:Npn \prop_rand_key_value:N #1 - { - \prop_if_empty:NF #1 - { - \exp_after:wN \@@_rand_item:w - \int_value:w \int_rand:nn { 1 } { \prop_count:N #1 } - #1 \s_@@_stop - } - } -\cs_generate_variant:Nn \prop_rand_key_value:N { c } -\cs_new:Npn \@@_rand_item:w #1 \s_@@ \@@_pair:wn #2 \s_@@ #3 - { - \int_compare:nNnF {#1} > 1 - { \@@_use_i_delimit_by_s_stop:nw { \exp_not:n { {#2} {#3} } } } - \exp_after:wN \@@_rand_item:w - \int_value:w \int_eval:n { #1 - 1 } \s_@@ - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{Additions to \pkg{l3seq}} % % \begin{macrocode} @@ -880,35 +312,6 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\seq_set_from_inline_x:Nnn, \seq_gset_from_inline_x:Nnn} -% \begin{macro}{\@@_set_from_inline_x:NNnn} -% Set \cs{@@_item:n} then map it using the loop code. -% \begin{macrocode} -\cs_new_protected:Npn \seq_set_from_inline_x:Nnn - { \@@_set_from_inline_x:NNnn \__kernel_tl_set:Nx } -\cs_new_protected:Npn \seq_gset_from_inline_x:Nnn - { \@@_set_from_inline_x:NNnn \__kernel_tl_gset:Nx } -\cs_new_protected:Npn \@@_set_from_inline_x:NNnn #1#2#3#4 - { - \@@_push_item_def:n { \exp_not:N \@@_item:n {#4} } - #1 #2 { \s_@@ #3 \@@_item:n } - \@@_pop_item_def: - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\seq_set_from_function:NnN, \seq_gset_from_function:NnN} -% Reuse \cs{seq_set_from_inline_x:Nnn}. -% \begin{macrocode} -\cs_new_protected:Npn \seq_set_from_function:NnN #1#2#3 - { \seq_set_from_inline_x:Nnn #1 {#2} { #3 {##1} } } -\cs_new_protected:Npn \seq_gset_from_function:NnN #1#2#3 - { \seq_gset_from_inline_x:Nnn #1 {#2} { #3 {##1} } } -% \end{macrocode} -% \end{macro} -% -% % \begin{macro}{\@@_int_eval:w} % Useful to more quickly go through items. % \begin{macrocode} @@ -1079,114 +482,6 @@ % \end{macro} % \end{macro} % -% \subsection{Additions to \pkg{l3sys}} -% -% \begin{macrocode} -%<@@=sys> -% \end{macrocode} -% -% \begin{variable}{\c_sys_engine_version_str} -% Various different engines, various different ways to extract the -% data! -% \begin{macrocode} -\str_const:Nx \c_sys_engine_version_str - { - \str_case:on \c_sys_engine_str - { - { pdftex } - { - \int_div_truncate:nn { \tex_pdftexversion:D } { 100 } - . - \int_mod:nn { \tex_pdftexversion:D } { 100 } - . - \tex_pdftexrevision:D - } - { ptex } - { - \cs_if_exist:NT \tex_ptexversion:D - { - p - \int_use:N \tex_ptexversion:D - . - \int_use:N \tex_ptexminorversion:D - \tex_ptexrevision:D - - - \int_use:N \tex_epTeXversion:D - } - } - { luatex } - { - \int_div_truncate:nn { \tex_luatexversion:D } { 100 } - . - \int_mod:nn { \tex_luatexversion:D } { 100 } - . - \tex_luatexrevision:D - } - { uptex } - { - \cs_if_exist:NT \tex_ptexversion:D - { - p - \int_use:N \tex_ptexversion:D - . - \int_use:N \tex_ptexminorversion:D - \tex_ptexrevision:D - - - u - \int_use:N \tex_uptexversion:D - \tex_uptexrevision:D - - - \int_use:N \tex_epTeXversion:D - } - } - { xetex } - { - \int_use:N \tex_XeTeXversion:D - \tex_XeTeXrevision:D - } - } - } -% \end{macrocode} -% \end{variable} -% -% \subsection{Additions to \pkg{l3file}} -% -% \begin{macrocode} -%<@@=ior> -% \end{macrocode} -% -% \begin{macro}{\ior_shell_open:Nn} -% \begin{macro}{\@@_shell_open:nN} -% Actually much easier than either the standard open or input versions! -% When calling \cs{__kernel_ior_open:Nn} the file the pipe is added to -% signal a shell command, but the quotes are not added yet---they are -% added later by \cs{__kernel_file_name_quote:n}. -% \begin{macrocode} -\cs_new_protected:Npn \ior_shell_open:Nn #1#2 - { - \sys_if_shell:TF - { \exp_args:No \@@_shell_open:nN { \tl_to_str:n {#2} } #1 } - { \msg_error:nn { ior } { pipe-failed } } - } -\cs_new_protected:Npn \@@_shell_open:nN #1#2 - { - \tl_if_in:nnTF {#1} { " } - { - \msg_error:nnx - { kernel } { quote-in-shell } {#1} - } - { \__kernel_ior_open:Nn #2 { |#1 } } - } -\msg_new:nnnn { ior } { pipe-failed } - { Cannot~run~piped~system~commands. } - { - LaTeX~tried~to~call~a~system~process~but~this~was~not~possible.\\ - Try~the~"--shell-escape"~(or~"--enable-pipes")~option. - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{Additions to \pkg{l3tl}} % % \subsubsection{Building a token list} @@ -1409,161 +704,6 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{Other additions to \pkg{l3tl}} -% -% \begin{macro}{\tl_range_braced:Nnn, \tl_range_braced:cnn, \tl_range_braced:nnn} -% \begin{macro} -% {\tl_range_unbraced:Nnn, \tl_range_unbraced:cnn, \tl_range_unbraced:nnn} -% \begin{macro} -% { -% \@@_range_braced:w, \@@_range_collect_braced:w, -% \@@_range_unbraced:w, \@@_range_collect_unbraced:w, -% } -% For the braced version \cs{@@_range_braced:w} sets up -% \cs{@@_range_collect_braced:w} which stores items one by one in an -% argument after the semicolon. The unbraced version is almost -% identical. The version preserving braces and spaces starts by -% deleting spaces before the argument to avoid collecting them, and -% sets up \cs{@@_range_collect:nn} with a first argument of the form -% |{| \Arg{collected} \meta{tokens} |}|, whose head is the collected -% tokens and whose tail is what remains of the original token list. -% This form makes it easier to move tokens to the \meta{collected} -% tokens. -% \begin{macrocode} -\cs_new:Npn \tl_range_braced:Nnn { \exp_args:No \tl_range_braced:nnn } -\cs_generate_variant:Nn \tl_range_braced:Nnn { c } -\cs_new:Npn \tl_range_braced:nnn { \@@_range:Nnnn \@@_range_braced:w } -\cs_new:Npn \tl_range_unbraced:Nnn - { \exp_args:No \tl_range_unbraced:nnn } -\cs_generate_variant:Nn \tl_range_unbraced:Nnn { c } -\cs_new:Npn \tl_range_unbraced:nnn - { \@@_range:Nnnn \@@_range_unbraced:w } -\cs_new:Npn \@@_range_braced:w #1 ; #2 - { \@@_range_collect_braced:w #1 ; { } #2 } -\cs_new:Npn \@@_range_unbraced:w #1 ; #2 - { \@@_range_collect_unbraced:w #1 ; { } #2 } -\cs_new:Npn \@@_range_collect_braced:w #1 ; #2#3 - { - \if_int_compare:w #1 > \c_one_int - \exp_after:wN \@@_range_collect_braced:w - \int_value:w \int_eval:n { #1 - 1 } \exp_after:wN ; - \fi: - { #2 {#3} } - } -\cs_new:Npn \@@_range_collect_unbraced:w #1 ; #2#3 - { - \if_int_compare:w #1 > \c_one_int - \exp_after:wN \@@_range_collect_unbraced:w - \int_value:w \int_eval:n { #1 - 1 } \exp_after:wN ; - \fi: - { #2 #3 } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Additions to \pkg{l3token}} -% -% \begin{variable}{\c_catcode_active_space_tl} -% While \cs{char_generate:nn} can produce active characters in some -% engines it cannot in general. It would be possible to simply change -% the catcode of space but then the code would need to avoid all -% spaces, making it quite unreadable. Instead we use the primitive -% \cs{tex_lowercase:D} trick. -% \begin{macrocode} -\group_begin: - \char_set_catcode_active:N * - \char_set_lccode:nn { `* } { `\ } - \tex_lowercase:D { \tl_const:Nn \c_catcode_active_space_tl { * } } -\group_end: -% \end{macrocode} -% \end{variable} -% -% \begin{macrocode} -%<@@=peek> -% \end{macrocode} -% -% \begin{variable}{\l_@@_collect_tl} -% \begin{macrocode} -\tl_new:N \l_@@_collect_tl -% \end{macrocode} -% \end{variable} -% -% \begin{macro} -% { -% \peek_catcode_collect_inline:Nn, -% \peek_charcode_collect_inline:Nn, -% \peek_meaning_collect_inline:Nn -% } -% \begin{macro} -% { -% \@@_collect:NNn, \@@_collect_true:w, -% \@@_collect_remove:nw, \@@_collect:N -% } -% Most of the work is done by \cs{@@_execute_branches_\ldots{}:}, -% which calls either \cs{@@_true:w} or \cs{@@_false:w} according to -% whether the next token \cs{l_peek_token} matches the search token -% (stored in \cs{l_@@_search_token} and \cs{l_@@_search_tl}). -% Here, in the \texttt{true} case we run \cs{@@_collect_true:w}, -% which generally calls \cs{@@_collect:N} to store the peeked token -% into \cs{l_@@_collect_tl}, except in special non-\texttt{N}-type -% cases (begin-group, end-group, or space), where a frozen token is -% stored. The \texttt{true} branch calls -% \cs{@@_execute_branches_\ldots{}:} to fetch more matching tokens. -% Once there are no more, \cs{@@_false_aux:n} closes the safe-align -% group and runs the user's inline code. -% \begin{macrocode} -\cs_new_protected:Npn \peek_catcode_collect_inline:Nn - { \@@_collect:NNn \@@_execute_branches_catcode: } -\cs_new_protected:Npn \peek_charcode_collect_inline:Nn - { \@@_collect:NNn \@@_execute_branches_charcode: } -\cs_new_protected:Npn \peek_meaning_collect_inline:Nn - { \@@_collect:NNn \@@_execute_branches_meaning: } -\cs_new_protected:Npn \@@_collect:NNn #1#2#3 - { - \group_align_safe_begin: - \cs_set_eq:NN \l_@@_search_token #2 - \tl_set:Nn \l_@@_search_tl {#2} - \tl_clear:N \l_@@_collect_tl - \cs_set:Npn \@@_false:w - { \exp_args:No \@@_false_aux:n \l_@@_collect_tl } - \cs_set:Npn \@@_false_aux:n ##1 - { - \group_align_safe_end: - #3 - } - \cs_set_eq:NN \@@_true:w \@@_collect_true:w - \cs_set:Npn \@@_true_aux:w { \peek_after:Nw #1 } - \@@_true_aux:w - } -\cs_new_protected:Npn \@@_collect_true:w - { - \if_case:w - \if_catcode:w \exp_not:N \l_peek_token { 1 \exp_stop_f: \fi: - \if_catcode:w \exp_not:N \l_peek_token } 2 \exp_stop_f: \fi: - \if_meaning:w \l_peek_token \c_space_token 3 \exp_stop_f: \fi: - 0 \exp_stop_f: - \exp_after:wN \@@_collect:N - \or: \@@_collect_remove:nw { \c_group_begin_token } - \or: \@@_collect_remove:nw { \c_group_end_token } - \or: \@@_collect_remove:nw { ~ } - \fi: - } -\cs_new_protected:Npn \@@_collect:N #1 - { - \tl_put_right:Nn \l_@@_collect_tl {#1} - \@@_true_aux:w - } -\cs_new_protected:Npn \@@_collect_remove:nw #1 - { - \tl_put_right:Nn \l_@@_collect_tl {#1} - \exp_after:wN \@@_true_remove:w - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macrocode} %</package> % \end{macrocode} |