diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx | 294 |
1 files changed, 1 insertions, 293 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index f39ec112729..39a6dd5623a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-04-21} +% \date{Released 2019-05-03} % % \maketitle % @@ -299,83 +299,6 @@ % % \section{Additions to \pkg{l3file}} % -% \begin{function}[noTF, added = 2017-07-11, updated = 2019-02-16] -% {\file_get_mdfive_hash:nN} -% \begin{syntax} -% \cs{file_get_mdfive_hash:nN} \Arg{file name} \meta{tl var} -% \end{syntax} -% Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by \cs{file_path_include:n}. -% If found, sets the \meta{str var} to the MD5 sum generated from the -% content of the file. The file is read as bytes, which means that in -% contrast to most \TeX{} behaviour there will be a difference in result -% depending on the line endings used in text files. The same file will -% produce the same result between different engines: the algorithm used -% is the same in all cases. -% Where the file is not found, the \meta{str var} will be empty. -% \end{function} -% -% \begin{function}[noTF, added = 2017-07-09, updated = 2019-02-16] -% {\file_get_size:nN} -% \begin{syntax} -% \cs{file_get_size:nN} \Arg{file name} \meta{tl var} -% \end{syntax} -% Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by \cs{file_path_include:n}. -% If found, sets the \meta{str var} to the size of the file in bytes. -% Where the file is not found, the \meta{str var} will be empty. -% This is not available in older versions of \XeTeX{}. -% \end{function} -% -% \begin{function}[noTF, added = 2017-07-09, updated = 2019-02-16] -% {\file_get_timestamp:nN} -% \begin{syntax} -% \cs{file_get_timestamp:nN} \Arg{file name} \meta{tl var} -% \end{syntax} -% Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by \cs{file_path_include:n}. -% If found, sets the \meta{str var} to the modification timestamp of -% the file in the form |D:|\meta{year}\meta{month}\meta{day}\meta{hour}^^A -% \meta{minute}\meta{second}\meta{offset}, where the latter may be |Z| -% (UTC) or \meta{plus-minus}\meta{hours}|'|\meta{minutes}|'|. -% Where the file is not found, the \meta{str var} will be empty. -% This is not available in older versions of \XeTeX{}. -% \end{function} -% -% \begin{function}[added = 2014-07-02]{\file_if_exist_input:n, \file_if_exist_input:nF} -% \begin{syntax} -% \cs{file_if_exist_input:n} \Arg{file name} -% \cs{file_if_exist_input:nF} \Arg{file name} \Arg{false code} -% \end{syntax} -% Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by -% \cs{file_path_include:n}. If found then -% reads in the file as additional \LaTeX{} source as described for -% \cs{file_input:n}, otherwise inserts the \meta{false code}. -% Note that these functions do not raise -% an error if the file is not found, in contrast to \cs{file_input:n}. -% \end{function} -% -% \begin{function}[added = 2017-07-07]{\file_input_stop:} -% \begin{syntax} -% \cs{file_input_stop:} -% \end{syntax} -% Ends the reading of a file started by \cs{file_input:n} or similar before -% the end of the file is reached. Where the file reading is being terminated -% due to an error, \cs{msg_critical:nn(nn)} should be preferred. -% \begin{texnote} -% This function must be used on a line on its own: \TeX{} reads files -% line-by-line and so any additional tokens in the \enquote{current} line -% will still be read. -% -% This is also true if the function is hidden inside another function -% (which will be the normal case), i.e., all tokens on the same line -% in the source file are still processed. Putting it on a line by itself -% in the definition doesn't help as it is the line where it is used that -% counts! -% \end{texnote} -% \end{function} -% % \begin{function}[added = 2019-01-13]{\ior_map_variable:NNn} % \begin{syntax} % \cs{ior_map_variable:NNn} \meta{stream} \meta{tl~var} \Arg{code} @@ -1324,26 +1247,6 @@ % and |#3| and |#4| empty. % \end{function} % -% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:} -% \begin{syntax} -% \cs{peek_N_type:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next \meta{token} in the input stream can be safely -% grabbed as an \texttt{N}-type argument. The test is \meta{false} -% if the next \meta{token} is either an explicit or implicit -% begin-group or end-group token (with any character code), or -% an explicit or implicit space character (with character code $32$ -% and category code $10$), or an outer token (never used in \LaTeX3) -% and \meta{true} in all other cases. -% Note that a \meta{true} result ensures that the next \meta{token} is -% a valid \texttt{N}-type argument. However, if the next \meta{token} -% is for instance \cs{c_space_token}, the test takes the -% \meta{false} branch, even though the next \meta{token} is in fact -% a valid \texttt{N}-type argument. The \meta{token} is left -% in the input stream after the \meta{true code} or \meta{false code} -% (as appropriate to the result of the test). -% \end{function} -% % \begin{function}[added = 2018-09-23] % { % \peek_catcode_collect_inline:Nn, @@ -1595,130 +1498,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Additions to \pkg{l3file}} -% -% \begin{macrocode} -%<@@=file> -% \end{macrocode} -% -% \begin{macro} -% {\file_get_mdfive_hash:nN, \file_get_size:nN, \file_get_timestamp:nN} -% \begin{macro}{\@@_get_details:nnN} -% These are all wrappers around the \pdfTeX{} primitives doing the same -% jobs: as we want consistent file paths to be found, they are all set up -% using \cs{file_get_full_name:nN} and so are non-expandable \texttt{get} -% functions. Much of the code is repetitive but we need to branch for -% \LuaTeX{} (emulation in Lua), for the slightly different syntax -% needed for \tn{tex_mdfivesum:D} and for the fact that primitive -% coverage varies in other engines. -% \begin{macrocode} -\cs_new_protected:Npn \file_get_mdfive_hash:nN #1#2 - { \file_get_mdfive_hash:nNF {#1} #2 { \tl_set:Nn #2 { \q_no_value } } } -\cs_new_protected:Npn \file_get_size:nN #1#2 - { \file_get_size:nNF {#1} #2 { \tl_set:Nn #2 { \q_no_value } } } -\cs_new_protected:Npn \file_get_timestamp:nN #1#2 - { \file_get_timestamp:nNF {#1} #2 { \tl_set:Nn #2 { \q_no_value } } } -\prg_new_protected_conditional:Npnn \file_get_mdfive_hash:nN #1#2 { T , F , TF } - { \@@_get_details:nnN {#1} { mdfivesum } {#2} } -\prg_new_protected_conditional:Npnn \file_get_size:nN #1#2 { T , F , TF } - { \@@_get_details:nnN {#1} { size } {#2} } -\prg_new_protected_conditional:Npnn \file_get_timestamp:nN #1#2 { T , F , TF } - { \@@_get_details:nnN {#1} { moddate } {#2} } -\cs_new_protected:Npn \@@_get_details:nnN #1#2#3 - { - \file_get_full_name:nNTF {#1} \l_@@_full_name_tl - { - \tl_set:Nx #3 - { - \use:c { tex_file #2 :D } \exp_after:wN - { \l_@@_full_name_tl } - } - \prg_return_true: - } - { \prg_return_false: } - } -\sys_if_engine_luatex:TF - { - \cs_set_protected:Npn \@@_get_details:nnN #1#2#3 - { - \file_get_full_name:nNTF {#1} \l_@@_full_name_tl - { - \tl_set:Nx #3 - { - \lua_now:e - { - l3kernel.file#2 - ( " \lua_escape:e { \l_@@_full_name_tl } " ) - } - } - \prg_return_true: - } - { \prg_return_false: } - } - } - { - \prg_set_protected_conditional:Npnn \file_get_mdfive_hash:nN #1#2 - { T , F , TF } - { - \file_get_full_name:nNTF {#1} \l_@@_full_name_tl - { - \tl_set:Nx #2 - { - \tex_mdfivesum:D file \exp_after:wN - { \l_@@_full_name_tl } - } - \prg_return_true: - } - { \prg_return_false: } - } - \cs_if_exist:NF \tex_filesize:D - { - \cs_set_protected:Npn \@@_get_details:nnN #1#2#3 - { - \tl_clear:N #3 - \__kernel_msg_error:nnx - { kernel } { primitive-not-available } - { \exp_not:c { (pdf)file #2 } } - \prg_return_false: - } - } - } -\__kernel_msg_new:nnnn { kernel } { primitive-not-available } - { Primitive~\token_to_str:N #1 not~available } - { - The~version~of~XeTeX~in~use~does~not~provide~functionality~equivalent~to~ - the~\token_to_str:N #1 primitive. - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\file_if_exist_input:n, \file_if_exist_input:nF} -% Input of a file with a test for existence. We do not define the |T| -% or |TF| variants because the most useful place to place the -% \meta{true code} would be inconsistent with other conditionals. -% \begin{macrocode} -\cs_new_protected:Npn \file_if_exist_input:n #1 - { - \file_get_full_name:nNT {#1} \l_@@_full_name_tl - { \@@_input:V \l_@@_full_name_tl } - } -\cs_new_protected:Npn \file_if_exist_input:nF #1#2 - { - \file_get_full_name:nNTF {#1} \l_@@_full_name_tl - { \@@_input:V \l_@@_full_name_tl } - {#2} - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\file_input_stop:} -% A simple rename. -% \begin{macrocode} -\cs_new_protected:Npn \file_input_stop: { \tex_endinput:D } -% \end{macrocode} -% \end{macro} -% % \subsection{Additions to \pkg{l3flag}} % % \begin{macrocode} @@ -4331,77 +4110,6 @@ %<@@=peek> % \end{macrocode} % -% \begin{macro}[TF]{\peek_N_type:} -% \begin{macro} -% {\@@_execute_branches_N_type:, \@@_N_type:w, \@@_N_type_aux:nnw} -% All tokens are \texttt{N}-type tokens, except in four cases: -% begin-group tokens, end-group tokens, space tokens with character -% code~$32$, and outer tokens. Since \cs{l_peek_token} might be -% outer, we cannot use the convenient \cs{bool_if:nTF} function, and -% must resort to the old trick of using \tn{ifodd} to expand a set of -% tests. The \texttt{false} branch of this test is taken if the token -% is one of the first three kinds of non-\texttt{N}-type tokens -% (explicit or implicit), thus we call \cs{@@_false:w}. In the -% \texttt{true} branch, we must detect outer tokens, without impacting -% performance too much for non-outer tokens. The first filter is to -% search for \texttt{outer} in the \tn{meaning} of \cs{l_peek_token}. -% If that is absent, \cs{use_none_delimit_by_q_stop:w} cleans up, and -% we call \cs{@@_true:w}. Otherwise, the token can be a non-outer -% macro or a primitive mark whose parameter or replacement text -% contains \texttt{outer}, it can be the primitive \tn{outer}, or it -% can be an outer token. Macros and marks would have \texttt{ma} in -% the part before the first occurrence of \texttt{outer}; the meaning -% of \tn{outer} has nothing after \texttt{outer}, contrarily to outer -% macros; and that covers all cases, calling \cs{@@_true:w} or -% \cs{@@_false:w} as appropriate. Here, there is no \meta{search -% token}, so we feed a dummy \cs{scan_stop:} to the -% \cs{@@_token_generic:NNTF} function. -% \begin{macrocode} -\group_begin: - \cs_set_protected:Npn \@@_tmp:w #1 \q_stop - { - \cs_new_protected:Npn \@@_execute_branches_N_type: - { - \if_int_odd:w - \if_catcode:w \exp_not:N \l_peek_token { 0 \exp_stop_f: \fi: - \if_catcode:w \exp_not:N \l_peek_token } 0 \exp_stop_f: \fi: - \if_meaning:w \l_peek_token \c_space_token 0 \exp_stop_f: \fi: - 1 \exp_stop_f: - \exp_after:wN \@@_N_type:w - \token_to_meaning:N \l_peek_token - \q_mark \@@_N_type_aux:nnw - #1 \q_mark \use_none_delimit_by_q_stop:w - \q_stop - \exp_after:wN \@@_true:w - \else: - \exp_after:wN \@@_false:w - \fi: - } - \cs_new_protected:Npn \@@_N_type:w ##1 #1 ##2 \q_mark ##3 - { ##3 {##1} {##2} } - } - \exp_after:wN \@@_tmp:w \tl_to_str:n { outer } \q_stop -\group_end: -\cs_new_protected:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi: - { - \fi: - \tl_if_in:noTF {#1} { \tl_to_str:n {ma} } - { \@@_true:w } - { \tl_if_empty:nTF {#2} { \@@_true:w } { \@@_false:w } } - } -\cs_new_protected:Npn \peek_N_type:TF - { - \@@_token_generic:NNTF - \@@_execute_branches_N_type: \scan_stop: - } -\cs_new_protected:Npn \peek_N_type:T - { \@@_token_generic:NNT \@@_execute_branches_N_type: \scan_stop: } -\cs_new_protected:Npn \peek_N_type:F - { \@@_token_generic:NNF \@@_execute_branches_N_type: \scan_stop: } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{variable}{\l_@@_collect_tl} % \begin{macrocode} \tl_new:N \l_@@_collect_tl |