diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-06 21:14:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-06 21:14:35 +0000 |
commit | eb76e93af3b7c53f70f6fd840a6923541250b1ba (patch) | |
tree | c2a22c1fab23169e2bd4aaa0e1b6facdfac80a6c /Master/texmf-dist/source/latex/l3kernel | |
parent | 672ea6ad9ccdaf9dd827a8a0d9c41e18a07cc6ab (diff) |
l3 (6sep19)
git-svn-id: svn://tug.org/texlive/trunk@52041 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel')
52 files changed, 733 insertions, 313 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 7733d54a7a2..b6a56617e72 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -23,7 +23,7 @@ % for those people who are interested. % %<*driver|generic|package> -\def\ExplFileDate{2019-08-25}% +\def\ExplFileDate{2019-09-05}% %</driver|generic|package> %<*driver> \documentclass[full]{l3doc} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index 1c74174aeb0..e0d20718ca3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 8bd1bd8e6c0..88dba0cf3aa 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -992,7 +992,7 @@ % % \begin{function}[EXP, added = 2019-06-02]{\use_ii_i:nn} % \begin{syntax} -% \cs{use_ii_i:nnn} \Arg{arg_1} \Arg{arg_2} +% \cs{use_ii_i:nn} \Arg{arg_1} \Arg{arg_2} % \end{syntax} % This function absorbs two arguments and leaves the content of the % second and first in the input stream. The category code of diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 35ab971e153..68a668e732d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 8067a6ca6a6..dd33e0dd17f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index a92db3ebedf..116d1e83ef0 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-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -589,24 +589,6 @@ % % \section{Additions to \pkg{l3prop}} % -% \begin{function}[rEXP] -% {\prop_map_tokens:Nn, \prop_map_tokens:cn} -% \begin{syntax} -% \cs{prop_map_tokens:Nn} \meta{property list} \Arg{code} -% \end{syntax} -% Analogue of \cs{prop_map_function:NN} which maps several tokens -% instead of a single function. The \meta{code} receives each -% key--value pair in the \meta{property list} as two trailing brace -% groups. For instance, -% \begin{verbatim} -% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } } -% \end{verbatim} -% expands to the value corresponding to \texttt{mykey}: for each -% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives -% \texttt{mykey}, the \meta{key} and the \meta{value} as its three -% arguments. For that specific task, \cs{prop_item:Nn} is faster. -% \end{function} -% % \begin{function}[EXP, added = 2016-12-06] % {\prop_rand_key_value:N, \prop_rand_key_value:c} % \begin{syntax} @@ -1751,33 +1733,6 @@ %<@@=prop> % \end{macrocode} % -% \begin{macro}[rEXP]{\prop_map_tokens:Nn, \prop_map_tokens:cn} -% \begin{macro}{\@@_map_tokens:nwwn} -% The mapping is very similar to \cs{prop_map_function:NN}. The -% \cs{use_i:nn} removes the leading \cs{s_@@}. The odd construction -% |\use:n {#1}| allows |#1| to contain any token without interfering -% with \cs{prop_map_break:}. The loop stops when the argument -% delimited by \cs{@@_pair:wn} is \cs{prg_break:} instead of being -% empty. -% \begin{macrocode} -\cs_new:Npn \prop_map_tokens:Nn #1#2 - { - \exp_last_unbraced:Nno - \use_i:nn { \@@_map_tokens:nwwn {#2} } #1 - \prg_break: \@@_pair:wn \s_@@ { } \prg_break_point: - \prg_break_point:Nn \prop_map_break: { } - } -\cs_new:Npn \@@_map_tokens:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4 - { - #2 - \use:n {#1} {#3} {#4} - \@@_map_tokens:nwwn {#1} - } -\cs_generate_variant:Nn \prop_map_tokens:Nn { c } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}[EXP] % {\prop_rand_key_value:N, \prop_rand_key_value:c} % \begin{macro}[EXP]{\@@_rand_item:w} @@ -2531,11 +2486,12 @@ % } % \begin{macro}[EXP]{\@@_change_case:nNN} % \begin{macro}[EXP]{\@@_change_case:nN} -% \begin{macro}[EXP]{\@@_change_case_multi:n, \@@_change_case_multi:v} -% \begin{macro}[EXP]{\@@_change_case_multi:NNNw} -% \begin{macro}[EXP]{\@@_change_case:NN} +% \begin{macro}[EXP]{\@@_change_case_multi:nN, \@@_change_case_multi:vN} +% \begin{macro}[EXP]{\@@_change_case_multi:NNNNw} % \begin{macro}[EXP]{\@@_change_case:NNN} -% \begin{macro}[EXP]{\@@_change_case:N} +% \begin{macro}[EXP]{\@@_change_case:NNNN} +% \begin{macro}[EXP]{\@@_change_case:NN} +% \begin{macro}[EXP]{\@@_change_case_catcode:N} % \begin{macro}[EXP] % { % \char_str_lower_case:N, \char_str_upper_case:N, @@ -2566,8 +2522,8 @@ { \tl_if_exist:cTF { c_@@_mixed_case_ \token_to_str:N #1 _tl } { - \@@_change_case_multi:v - { c_@@_mixed_case_ \token_to_str:N #1 _tl } + \@@_change_case_multi:vN + { c_@@_mixed_case_ \token_to_str:N #1 _tl } #1 } { \char_upper_case:N #1 } } @@ -2577,48 +2533,76 @@ { \tl_if_exist:cTF { c_@@_ #1 _case_ \token_to_str:N #3 _tl } { - \@@_change_case_multi:v - { c_@@_ #1 _case_ \token_to_str:N #3 _tl } + \@@_change_case_multi:vN + { c_@@_ #1 _case_ \token_to_str:N #3 _tl } #3 } { \exp_args:Nf \@@_change_case:nN { #2 { `#3 } } #3 } } \cs_new:Npn \@@_change_case:nN #1#2 { \int_compare:nNnTF {#1} = 0 - { \@@_change_case:N #2 } - { \char_generate:nn {#1} { \char_value_catcode:n {#1} } } + { #2 } + { \char_generate:nn {#1} { \@@_change_case_catcode:N #2 } } } -\cs_new:Npn \@@_change_case_multi:n #1 - { \@@_change_case_multi:NNNw #1 \q_no_value \q_no_value \q_stop } -\cs_new:Npn \@@_change_case_multi:NNNw #1#2#3#4 \q_stop +\cs_new:Npn \@@_change_case_multi:nN #1#2 + { \@@_change_case_multi:NNNNw #2 #1 \q_no_value \q_no_value \q_stop } +\cs_generate_variant:Nn \@@_change_case_multi:nN { v } +\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \q_stop { - \quark_if_no_value:NTF #3 + \quark_if_no_value:NTF #4 { - \quark_if_no_value:NTF #2 - { \@@_change_case:N #1 } - { \@@_change_case:NN #1#2 } + \quark_if_no_value:NTF #3 + { \@@_change_case:NN #1 #2 } + { \@@_change_case:NNN #1 #2#3 } } - { \@@_change_case:NNN #1#2#3 } + { \@@_change_case:NNNN #1 #2#3#4 } } -\cs_generate_variant:Nn \@@_change_case_multi:n { v } -\cs_new:Npn \@@_change_case:NN #1#2 +\cs_new:Npn \@@_change_case:NNN #1#2#3 { \exp_args:Nnf \use:nn - { \@@_change_case:N #1 } - { \@@_change_case:N #2 } + { \@@_change_case:NN #1 #2 } + { \@@_change_case:NN #1 #3 } } -\cs_new:Npn \@@_change_case:NNN #1#2#3 +\cs_new:Npn \@@_change_case:NNNN #1#2#3#4 { \exp_args:Nnff \use:nnn - { \@@_change_case:N #1 } - { \@@_change_case:N #2 } - { \@@_change_case:N #3 } + { \@@_change_case:NN #1 #2 } + { \@@_change_case:NN #1 #3 } + { \@@_change_case:NN #1 #4 } } -\cs_new:Npn \@@_change_case:N #1 - { \char_generate:nn { `#1 } { \char_value_catcode:n { `#1 } } } -\bool_lazy_or:nnF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } +\cs_new:Npn \@@_change_case:NN #1#2 + { \char_generate:nn { `#2 } { \@@_change_case_catcode:N #1 } } +\cs_new:Npn \@@_change_case_catcode:N #1 { - \cs_set_eq:NN \@@_change_case:nN \use_ii:nn + \if_catcode:w \exp_not:N #1 \c_math_toggle_token + 3 + \else: + \if_catcode:w \exp_not:N #1 \c_alignment_token + 4 + \else: + \if_catcode:w \exp_not:N #1 \c_math_superscript_token + 7 + \else: + \if_catcode:w \exp_not:N #1 \c_math_subscript_token + 8 + \else: + \if_catcode:w \exp_not:N #1 \c_space_token + 10 + \else: + \if_catcode:w \exp_not:N #1 \c_catcode_letter_token + 11 + \else: + \if_catcode:w \exp_not:N #1 \c_catcode_other_token + 12 + \else: + 13 + \fi: + \fi: + \fi: + \fi: + \fi: + \fi: + \fi: } % \end{macrocode} % Same story for the string version, except category code is easier @@ -2648,7 +2632,7 @@ { \tl_to_str:n {#2} } { \char_generate:nn {#1} { 12 } } } -\bool_lazy_or:nnF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: } +\cs_if_exist:NF \tex_Uchar:D { \cs_set:Npn \@@_str_change_case:nN #1#2 { \tl_to_str:n {#2} } @@ -2665,6 +2649,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}[EXP]{\char_codepoint_to_bytes:n} % \begin{macro}[EXP]{\@@_codepoint_to_bytes_auxi:n} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index fa743396b72..f52f55d9893 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index fa54e318251..1bc708f406c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx index 4881aae53ed..95128d0760a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index 50219502b02..ad33b60f381 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 9c00e79283b..0a43f3feac6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % \maketitle % \tableofcontents % @@ -1153,6 +1153,7 @@ and all files in that bundle must be distributed together. { n } { n } { o } { n } { f } { n } + { e } { n } { x } { n } { V } { n } { v } { n } @@ -1258,7 +1259,9 @@ and all files in that bundle must be distributed together. \bool_if:NT #3 { \token_to_str:N : - \str_if_eq:nnTF { #1 ~ } { \exp_args } + \bool_lazy_or:nnTF + { \str_if_eq_p:nn { #1 ~ } { \exp_args } } + { \str_if_eq_p:nn { #1 ~ } { \exp_last_unbraced } } { \exp_not:n {#2} } { \@@_signature_base_form:n {#2} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index 722ed3f484d..d05845abce2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index a8101b0f6c1..05e9064a474 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 017c9954f70..dce560e4f6c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -625,6 +625,19 @@ % \cs{q_no_value} in the case that the file does not exist. % \end{function} % +% \begin{function}[added = 2019-09-03, rEXP]{\file_full_name:n, \file_full_name:V} +% \begin{syntax} +% \cs{file_full_name:n} \Arg{file name} +% \end{syntax} +% Searches for \meta{file name} in the path as detailed for +% \cs{file_if_exist:nTF}, and if found leaves the +% fully-qualified name of the file, \emph{i.e.}~the path and file name, +% in the input stream. +% This includes an extension |.tex| when the given \meta{file name} +% has no extension but the file found has that extension. +% If the file is not found on the path, the expansion is empty. +% \end{function} +% % \begin{function}[added = 2017-06-23, updated = 2017-06-26] % {\file_parse_full_name:nNNN, \file_parse_full_name:VNNN} % \begin{syntax} @@ -650,21 +663,39 @@ % quote (|"|) characters or is surrounded by a pair of quotes. % \end{function} % -% \begin{function}[noTF, added = 2017-07-11, updated = 2019-02-16] -% {\file_get_mdfive_hash:nN} +% \begin{function}[rEXP, added = 2019-09-03]{\file_mdfive_hash:n} % \begin{syntax} -% \cs{file_get_mdfive_hash:nN} \Arg{file name} \meta{tl var} +% \cs{file_mdfive_hash:nN} \Arg{file name} % \end{syntax} % Searches for \meta{file name} using the current \TeX{} search % path and the additional paths controlled by \cs{l_file_search_path_seq}. -% If found, sets the \meta{tl var} to the MD5 sum generated from the -% content of the file. The file is read as bytes, which means that in +% It then expands to leave the MD5 sum generated from the contents of +% the file in the input stream. 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{tl var} will set to -% \cs{q_no_value}. +% is the same in all cases. When the file is not found, the result of +% expansion is empty. +% \end{function} +% +% \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} +% Sets the \meta{tl var} to the result of applying +% \cs{file_mdfive_hash:n} to the \meta{file}. If the file is not found, +% the \meta{tl var} will be set to \cs{q_no_value}. +% \end{function} +% +% \begin{function}[rEXP, added = 2019-09-03]{\file_size:n} +% \begin{syntax} +% \cs{file_size:n} \Arg{file name} +% \end{syntax} +% Searches for \meta{file name} using the current \TeX{} search +% path and the additional paths controlled by \cs{l_file_search_path_seq}. +% It then expands to leave the size of the file in bytes in the input stream. +% When the file is not found, the result of expansion is empty. % \end{function} % % \begin{function}[noTF, added = 2017-07-09, updated = 2019-02-16] @@ -672,10 +703,24 @@ % \begin{syntax} % \cs{file_get_size:nN} \Arg{file name} \meta{tl var} % \end{syntax} +% Sets the \meta{tl var} to the result of applying +% \cs{file_size:n} to the \meta{file}. If the file is not found, +% the \meta{tl var} will be set to \cs{q_no_value}. +% This is not available in older versions of \XeTeX{}. +% \end{function} +% +% \begin{function}[rEXP, added = 2019-09-03]{\file_timestamp:n} +% \begin{syntax} +% \cs{file_timestamp:n} \Arg{file name} +% \end{syntax} % Searches for \meta{file name} using the current \TeX{} search % path and the additional paths controlled by \cs{l_file_search_path_seq}. -% If found, sets the \meta{tl var} to the size of the file in bytes. -% Where the file is not found, the \meta{tl var} will set to \cs{q_no_value}. +% It then expands to leave the modification timestamp of +% the file in the input stream. The timestamp is of 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}|'|. +% When the file is not found, the result of expansion is empty. % This is not available in older versions of \XeTeX{}. % \end{function} % @@ -684,14 +729,9 @@ % \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{l_file_search_path_seq}. -% If found, sets the \meta{tl 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{tl var} will be set to -% \cs{q_no_value}. +% Sets the \meta{tl var} to the result of applying +% \cs{file_timestamp:n} to the \meta{file}. If the file is not found, +% the \meta{tl var} will be set to \cs{q_no_value}. % This is not available in older versions of \XeTeX{}. % \end{function} % @@ -1327,7 +1367,11 @@ % \begin{macrocode} \cs_new_protected:Npn \iow_open:Nn #1#2 { - \__kernel_file_name_sanitize:nN {#2} \l_@@_file_name_tl + \tl_set:Nx \l_@@_file_name_tl + { + \exp_args:Ne \__kernel_file_name_quote:n + { \__kernel_file_name_sanitize:n {#2} } + } \iow_close:N #1 \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl { \@@_open_stream:NV #1 \l_@@_file_name_tl } @@ -2145,13 +2189,6 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_internal_ior} -% A reserved stream to test for file existence. -% \begin{macrocode} -\ior_new:N \g_@@_internal_ior -% \end{macrocode} -% \end{variable} -% % \begin{variable} % { % \g_file_curr_dir_str , @@ -2266,46 +2303,113 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\__kernel_file_name_sanitize:nN} -% \begin{macro}{\@@_name_quote:nN} -% \begin{macro}{\@@_name_sanitize_aux:n} -% For converting a token list to a string where active characters are treated -% as strings from the start. The logic to the quoting normalisation is the -% same as used by \texttt{lualatexquotejobname}: check for balanced |"|, and -% assuming they balance strip all of them out before quoting the entire name -% if it contains spaces. +% \begin{macro}[rEXP]{\__kernel_file_name_sanitize:n} +% \begin{macro}[rEXP]{\__kernel_file_name_expand_loop:w} +% \begin{macro}[rEXP]{\__kernel_file_name_expand_N_type:Nw} +% \begin{macro}[rEXP]{\__kernel_file_name_expand_group:nw} +% \begin{macro}[rEXP]{\__kernel_file_name_expand_space:w} +% Expanding the file name without expanding active characters is done +% using the same token-by-token approach as for example case changing. +% The finale outcome only need be \texttt{e}-type expandable, so there +% is no need for the shuffling that is seen in other locations. % \begin{macrocode} -\cs_new_protected:Npn \__kernel_file_name_sanitize:nN #1#2 +\cs_new:Npn \__kernel_file_name_sanitize:n #1 { - \group_begin: - \seq_map_inline:Nn \l_char_active_seq - { - \tl_set:Nx \l_@@_internal_tl { \iow_char:N ##1 } - \char_set_active_eq:NN ##1 \l_@@_internal_tl - } - \tl_set:Nx \l_@@_internal_tl {#1} - \exp_args:NNNV \group_end: - \str_set:Nn #2 \l_@@_internal_tl + \__kernel_file_name_expand_loop:w #1 + \q_recursion_tail \q_recursion_stop } -\cs_new_protected:Npn \@@_name_quote:nN #1#2 +\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_recursion_stop { - \str_set:Nx #2 {#1} - \int_if_even:nF - { 0 \tl_map_function:NN #2 \@@_name_quote_aux:n } + \tl_if_head_is_N_type:nTF {#1} + { \__kernel_file_name_expand_N_type:Nw } { - \__kernel_msg_error:nnx - { kernel } { unbalanced-quote-in-filename } {#2} + \tl_if_head_is_group:nTF {#1} + { \__kernel_file_name_expand_group:nw } + { \__kernel_file_name_expand_space:w } + } + #1 \q_recursion_stop + } +\cs_new:Npn \__kernel_file_name_expand_N_type:Nw #1 + { + \quark_if_recursion_tail_stop:N #1 + \bool_lazy_and:nnTF + { \token_if_expandable_p:N #1 } + { + \bool_not_p:n + { + \bool_lazy_any_p:n + { + { \token_if_protected_macro_p:N #1 } + { \token_if_protected_long_macro_p:N #1 } + { \token_if_active_p:N #1 } + } + } + } + { \exp_after:wN \__kernel_file_name_expand_loop:w #1 } + { + \token_to_str:N #1 + \__kernel_file_name_expand_loop:w + } + } +\cs_new:Npx \__kernel_file_name_expand_group:nw #1 + { + \c_left_brace_str + \exp_not:N \__kernel_file_name_expand_loop:w + #1 + \c_right_brace_str + } +\exp_last_unbraced:NNo + \cs_new:Npx \__kernel_file_name_expand_space:w \c_space_tl + { + \c_space_tl + \exp_not:N \__kernel_file_name_expand_loop:w + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}[rEXP]{\__kernel_file_name_quote:n} +% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxi:nnnw} +% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxii:nnn} +% \begin{macro}[rEXP]{\__kernel_file_name_quote_auxiii:nw} +% Quoting file name uses basically the same approach as for +% \texttt{luaquotejobname}: count the |"| tokens, remove them then +% re-add at the extremities. +% \begin{macrocode} +\cs_new:Npn \__kernel_file_name_quote:n #1 + { + \__kernel_file_name_quote_auxi:nnnw {#1} { 0 } { } + #1 " \q_recursion_tail " \q_recursion_stop + } +\cs_new:Npn \__kernel_file_name_quote_auxi:nnnw #1#2#3#4 " + { + \quark_if_recursion_tail_stop_do:nn {#4} + { \__kernel_file_name_quote_auxii:nnn {#1} {#2} {#3} } + \__kernel_file_name_quote_auxi:nnnw {#1} { #2 + 1 } { #3#4 } + } +\cs_new:Npn \__kernel_file_name_quote_auxii:nnn #1#2#3 + { + \int_if_even:nT {#2} + { + \__kernel_msg_expandable_error:nnn + { kernel } { unbalanced-quote-in-filename } {#1} } - \tl_remove_all:Nn #2 { " } - \tl_if_in:NnT #2 { ~ } - { \str_set:Nx #2 { " \exp_not:V #2 " } } + \__kernel_file_name_quote_auxiii:nw {#3} #3 ~ \q_nil \q_stop + } +\cs_new:Npn \__kernel_file_name_quote_auxiii:nw #1 #2 ~ #3 \q_stop + { + \quark_if_nil:nTF {#3} + { #1 } + { "#1" } } -\cs_new:Npn \@@_name_quote_aux:n #1 - { \token_if_eq_charcode:NNT #1 " { + 1 } } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{variable}{\c_@@_marker_tl} % The same idea as the marker for rescanning token lists: this pair of @@ -2365,10 +2469,182 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\@@_file_size:n} +% A copy of the primitive where it's available, or the \LuaTeX{} +% equivalent if relevant. +% \begin{macrocode} +\cs_new_eq:NN \@@_file_size:n \tex_filesize:D +\sys_if_engine_luatex:T + { + \cs_gset:Npn \@@_file_size:n #1 + { + \lua_now:e + { + l3kernel.filesize + ( " \lua_escape:e {#1} " ) + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[rEXP]{\file_full_name:n, \@@_full_name:n} +% \begin{macro}[rEXP]{\@@_full_name:nn} +% \begin{macro}[rEXP]{\@@_full_name_aux:nn} +% \begin{macro}[rEXP]{\@@_full_name_aux:n} +% \begin{macro}[rEXP]{\@@_file_name_cleanup:w} +% \begin{macro}[rEXP]{\@@_file_name_end:} +% \begin{macro}[rEXP]{\@@_file_name_ext_check:n} +% \begin{macro}[rEXP] +% { +% \@@_file_name_ext_check_auxi:nw , +% \@@_file_name_ext_check_auxii:nw , +% \@@_file_name_ext_check_auxiii:nw +% } +% File searching can be carried out if the \tn{pdffilesize} primitive +% or an equivalent is available. That of course means we need to +% arrange for everything else to here to be done by expansion too. +% We start off by sanitizing the name and quoting if required: we +% may need to remove those quotes, so the raw name is passed too. +% \begin{macrocode} +\cs_new:Npn \file_full_name:n #1 + { + \exp_args:Ne \@@_full_name:n + { \__kernel_file_name_sanitize:n {#1} } + } +\cs_new:Npn \@@_full_name:n #1 + { + \exp_args:Ne \@@_full_name:nn + { \__kernel_file_name_quote:n {#1} } {#1} + } +% \end{macrocode} +% First, we check of the file is just here: no mapping so we do not +% need the break part of the broader auxiliary. We are using the fact +% that the primitive here returns nothing if the file is entirely absent. +% For package mode, \tn{input@path} is a token list not a sequence. +% \begin{macrocode} +\cs_new:Npn \@@_full_name:nn #1#2 + { + \tl_if_blank:nF {#1} + { + \tl_if_blank:eTF { \@@_file_size:n {#1} } + { + \seq_map_tokens:Nn \l_file_search_path_seq + { \@@_full_name_aux:nn {#2} } +%<*package> + \cs_if_exist:NT \input@path + { + \tl_map_tokens:Nn \input@path + { \@@_full_name_aux:nn {#2} } + } +%</package> + \@@_file_name_end: + } + { \@@_file_ext_check:n {#1} } + } + } +% \end{macrocode} +% Two pars to the auxiliary here so we can avoid doing quoting +% twice in the event we find the right file. +% \begin{macrocode} +\cs_new:Npn \@@_full_name_aux:nn #1#2 + { + \exp_args:Ne \@@_full_name_aux:n + { \__kernel_file_name_quote:e { \tl_to_str:n {#2} #1 } } + } +\cs_new:Npn \@@_full_name_aux:n #1 + { + \tl_if_blank:eF { \@@_file_size:n {#1} } + { + \seq_map_break:n + { + \@@_file_ext_check:n {#1} + \@@_file_name_cleanup:w + } + } + } +\cs_new:Npn \@@_file_name_cleanup:w #1 \@@_file_name_end:n #2 { } +\cs_new:Npn \@@_file_name_end: { } +% \end{macrocode} +% As \TeX{} automatically adds |.tex| if there is no extension, +% there is a little clean up to do here. First, find the file +% extension if present, ignoring any quotes and avoiding dots in +% the path.(The quoted name is retained for the common case that +% there is no additional work to do.) +% \begin{macrocode} +\cs_new:Npn \@@_file_ext_check:n #1 + { \@@_file_ext_check_auxi:nw {#1} #1 " #1 " \q_stop } +\cs_new:Npn \@@_file_ext_check_auxi:nw #1#2 " #3 " #4 \q_stop + { \@@_file_ext_check_auxii:nw {#1} #3 / \q_nil / \q_stop } +\cs_new:Npn \@@_file_ext_check_auxii:nw #1#2 / #3 / #4 \q_stop + { + \quark_if_nil:nTF {#3} + { \@@_file_ext_check_auxiii:nw {#1} #2 . \q_nil . \q_stop } + { \@@_file_ext_check_auxii:nw {#1} #3 / #4 \q_stop } + } +\cs_new:Npx \@@_file_ext_check_auxiii:nw #1#2 . #3 . #4 \q_stop + { + \exp_not:N \quark_if_nil:nTF {#3} + { \exp_not:N \__kernel_file_name_quote:n { #1 \tl_to_str:n { .tex } } } + {#1} + } +% \end{macrocode} +% Deal with the fact that the primitive might not be available. +% \begin{macrocode} +\bool_lazy_or:nnF + { \cs_if_exist_p:N \tex_filesize:D } + { \sys_if_engine_luatex_p: } + { + \cs_gset:Npn \file_full_name:n #1 + { + \__kernel_msg_expandable_error:nnn + { kernel } { primitive-not-available } + { \(pdf)filesize } + } + } +\__kernel_msg_new:nnnn { kernel } { primitive-not-available } + { Primitive~\token_to_str:N #1 not~available } + { + The~version~of~your~TeX~engine~does~not~provide~functionality~equivalent~to~ + the~#1~primitive. + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\file_get_full_name:nN, \file_get_full_name:VN} % \begin{macro}[TF]{\file_get_full_name:nN, \file_get_full_name:VN} % \begin{macro}{\@@_get_full_name_search:nN} -% The way to test if a file exists is to try to open it: if it does +% These functions pre-date using \cs{tex_filesize:D} for file searching, +% so are |get| functions with protection. To avoid having different +% search set ups, they are simply wrappers around the code above. +% \begin{macrocode} +\cs_new_protected:Npn \file_get_full_name:nN #1#2 + { + \file_get_full_name:nNF {#1} #2 + { \tl_set:Nn #2 { \q_no_value } } + } +\cs_generate_variant:Nn \file_get_full_name:nN { V } +\prg_new_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF } + { + \tl_set:Nx #2 + { \file_full_name:n {#1} } + \tl_if_empty:NTF #2 + { \prg_return_false: } + { \prg_return_true: } + } +\cs_generate_variant:Nn \file_get_full_name:nNT { V } +\cs_generate_variant:Nn \file_get_full_name:nNF { V } +\cs_generate_variant:Nn \file_get_full_name:nNTF { V } +% \end{macrocode} +% If \cs{tex_filesize:D} is not available, the +% way to test if a file exists is to try to open it: if it does % not exist then \TeX{} reports end-of-file. A search is made % looking at each potential path in turn (starting from the current % directory). The first location is of course treated as the correct @@ -2378,55 +2654,52 @@ % existence of the file with |.tex| extension in that directory, and % if it exists we include the |.tex| extension in the result. % \begin{macrocode} -\cs_new_protected:Npn \file_get_full_name:nN #1#2 - { - \file_get_full_name:nNF {#1} #2 - { \tl_set:Nn #2 { \q_no_value } } - } -\cs_generate_variant:Nn \file_get_full_name:nN { V } -\prg_new_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF } +\bool_lazy_or:nnF + { \cs_if_exist_p:N \tex_filesize:D } + { \sys_if_engine_luatex_p: } { - \__kernel_file_name_sanitize:nN {#1} \l_@@_base_name_tl - \@@_get_full_name_search:nN { } \use:n - \seq_map_inline:Nn \l_file_search_path_seq - { \@@_get_full_name_search:nN { ##1 / } \seq_map_break:n } -%<*package> - \cs_if_exist:NT \input@path + \prg_set_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF } { - \tl_map_inline:Nn \input@path - { \@@_get_full_name_search:nN { ##1 } \tl_map_break:n } - } + \@@_get_full_name_search:nN { } \use:n + \seq_map_inline:Nn \l_file_search_path_seq + { \@@_get_full_name_search:nN { ##1 / } \seq_map_break:n } +%<*package> + \cs_if_exist:NT \input@path + { + \tl_map_inline:Nn \input@path + { \@@_get_full_name_search:nN { ##1 } \tl_map_break:n } + } %</package> - \tl_set:Nn \l_@@_full_name_tl { \q_no_value } - \prg_break_point: - \quark_if_no_value:NTF \l_@@_full_name_tl - { - \ior_close:N \g_@@_internal_ior - \prg_return_false: - } - { - \file_parse_full_name:VNNN \l_@@_full_name_tl - \l_@@_dir_str \l_@@_name_str \l_@@_ext_str - \str_if_empty:NT \l_@@_ext_str + \tl_set:Nn \l_@@_full_name_tl { \q_no_value } + \prg_break_point: + \quark_if_no_value:NTF \l_@@_full_name_tl { - \__kernel_ior_open:No \g_@@_internal_ior - { \l_@@_full_name_tl .tex } - \ior_if_eof:NF \g_@@_internal_ior - { \tl_put_right:Nn \l_@@_full_name_tl { .tex } } + \ior_close:N \g_@@_internal_ior + \prg_return_false: + } + { + \file_parse_full_name:VNNN \l_@@_full_name_tl + \l_@@_dir_str \l_@@_name_str \l_@@_ext_str + \str_if_empty:NT \l_@@_ext_str + { + \__kernel_ior_open:No \g_@@_internal_ior + { \l_@@_full_name_tl .tex } + \ior_if_eof:NF \g_@@_internal_ior + { \tl_put_right:Nn \l_@@_full_name_tl { .tex } } + } + \ior_close:N \g_@@_internal_ior + \tl_set_eq:NN #2 \l_@@_full_name_tl + \prg_return_true: } - \ior_close:N \g_@@_internal_ior - \tl_set_eq:NN #2 \l_@@_full_name_tl - \prg_return_true: } } -\cs_generate_variant:Nn \file_get_full_name:nNT { V } -\cs_generate_variant:Nn \file_get_full_name:nNF { V } -\cs_generate_variant:Nn \file_get_full_name:nNTF { V } \cs_new_protected:Npn \@@_get_full_name_search:nN #1#2 { - \@@_name_quote:nN - { \tl_to_str:n {#1} \l_@@_base_name_tl } - \l_@@_full_name_tl + \tl_set:Nx \l_@@_full_name_tl + { + \exp_args:Ne \__kernel_file_name_quote:n + { \tl_to_str:n {#1} \l_@@_base_name_tl } + } \__kernel_ior_open:No \g_@@_internal_ior \l_@@_full_name_tl \ior_if_eof:NF \g_@@_internal_ior { #2 { \prg_break: } } } @@ -2434,17 +2707,63 @@ % \end{macro} % \end{macro} % \end{macro} +% \begin{variable}{\g_@@_internal_ior} +% A reserved stream to test for file existence, if required. +% \begin{macrocode} +\bool_lazy_or:nnF + { \cs_if_exist_p:N \tex_filesize:D } + { \sys_if_engine_luatex_p: } + { \ior_new:N \g_@@_internal_ior } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}[rEXP]{\file_mdfive_hash:n, \file_size:n, \file_timestamp:n} +% \begin{macro}[rEXP]{\@@_details:nn, \@@_details_aux:nn} +% \begin{macro}[rEXP]{\@@_mdfive_hash:n} +% Getting file details by expansion is relatively easy if a bit repetitive. +% As the MD5 function has a slightly different syntax from the other commands, +% there is a little cleaning up to do. +% \begin{macrocode} +\cs_new:Npn \file_mdfive_hash:n #1 + { \@@_details:nn {#1} { mdfivesum } } +\cs_new:Npn \file_size:n #1 + { \@@_details:nn {#1} { size } } +\cs_new:Npn \file_timestamp:n #1 + { \@@_details:nn {#1} { moddate } } +\cs_new:Npn \@@_details:nn #1#2 + { + \exp_args:Ne \@@_details_aux:nn + { \file_full_name:n {#1} } {#2} + } +\cs_new:Npn \@@_details_aux:nn #1#2 + { + \tl_if_blank:nF {#1} + { \use:c { tex_file #2 :D } {#1} } + } +\sys_if_engine_luatex:TF + { + \cs_gset:Npn \@@_details_aux:nn #1#2 + { + \lua_now:e + { l3kernel.file#2 ( " \lua_escape:e { #1 } " ) } + } + } + { + \cs_gset:Npn \file_mdfive_hash:n #1 + { \exp_args:Ne \@@_mdfive_hash:n { \file_full_name:n {#1} } } + \cs_new:Npn \@@_mdfive_hash:n #1 + { \tex_mdfivesum:D file {#1} } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % % \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. +% Non-expandable wrappers around the above in the case where appropriate +% primitive support exists. % \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 } } } @@ -2453,76 +2772,44 @@ \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} } + { \@@_get_details:nnN {#1} { mdfive_hash } #2 } \prg_new_protected_conditional:Npnn \file_get_size:nN #1#2 { T , F , TF } - { \@@_get_details:nnN {#1} { size } {#2} } + { \@@_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} } + { \@@_get_details:nnN {#1} { timestamp } #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: - } + \tl_set:Nx #3 + { \use:c { file_ #2 :n } {#1} } + \tl_if_empty:NTF #3 { \prg_return_false: } + { \prg_return_true: } } -\sys_if_engine_luatex:TF +% \end{macrocode} +% Where the primitive is not available, issue an error: this is a little +% more conservative than absolutely needed, but does work. +% \begin{macrocode} +\bool_lazy_or:nnF + { \cs_if_exist_p:N \tex_filesize:D } + { \sys_if_engine_luatex_p: } { \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_clear:N #3 + \__kernel_msg_error:nnx + { kernel } { primitive-not-available } { - \tl_set:Nx #2 + \token_to_str:N \(pdf)file + \str_case:nn {#2} { - \tex_mdfivesum:D file \exp_after:wN - { \l_@@_full_name_tl } + { mdfive_hash } { mdfivesum } + { timestamp } { moddate } + { size } { size } } - \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: } + \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} @@ -2573,9 +2860,8 @@ % \begin{macrocode} \cs_new_protected:Npn \__kernel_file_missing:n #1 { - \__kernel_file_name_sanitize:nN {#1} \l_@@_base_name_tl \__kernel_msg_error:nnx { kernel } { file-not-found } - { \l_@@_base_name_tl } + { \__kernel_file_name_sanitize:n {#1} } } % \end{macrocode} % \end{macro} @@ -2778,6 +3064,11 @@ % \begin{macrocode} \cs_new_protected:Npn \GetIdInfo { + \tl_clear_new:N \ExplFileDescription + \tl_clear_new:N \ExplFileDate + \tl_clear_new:N \ExplFileName + \tl_clear_new:N \ExplFileExtension + \tl_clear_new:N \ExplFileVersion \group_begin: \char_set_catcode_space:n { 32 } \exp_after:wN diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 13ad327dbc7..03dafcd76f6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 7b829b4418d..28bfba42a0c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index 0245f807f79..4be91184e43 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 616cce45f36..3e540bce708 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 4c0e12ffcf8..cb86fc8367a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index cd545aec517..144000e4400 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index 72c4020d6c1..d39e5874625 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index d78a0290385..09351e062c8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index c0584cde425..bbe64af1913 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index b3d7b32bc85..22e3d4f3ed1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index 9c74c70774c..9cde69190c5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 9bedd90aab2..5638c5fa7b5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index aad063f831a..b79ee0deeb9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 085641bafd5..f3ac40570c7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index a74b27f9006..89c24f80cde 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index 5a80f4cfe04..3ef49285725 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 7c0dd3caec8..865c4629f26 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index a371b6ee635..9a2dc16f366 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index e8d675eebaa..c315f69ee9f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 074ca85b6e3..abb636a3655 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx index 90ca8c5d0e7..bee9d5ff9c6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 9557fc8a085..acee969aeee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index d005a8131f1..1bcd3418ea0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 9f0bc82400e..ee129a9c1f4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index 5e4fa7732c0..df8726d1f1c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index d79073065dc..cd2f51c9988 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -353,6 +353,8 @@ % each iteration: the \meta{key} and associated \meta{value}. % The order in which \meta{entries} are returned is not defined and % should not be relied upon. +% To pass further arguments to the \meta{function}, see +% \cs{prop_map_tokens:Nn}. % \end{function} % % \begin{function}[updated = 2013-01-08] @@ -368,6 +370,24 @@ % should not be relied upon. % \end{function} % +% \begin{function}[rEXP] +% {\prop_map_tokens:Nn, \prop_map_tokens:cn} +% \begin{syntax} +% \cs{prop_map_tokens:Nn} \meta{property list} \Arg{code} +% \end{syntax} +% Analogue of \cs{prop_map_function:NN} which maps several tokens +% instead of a single function. The \meta{code} receives each +% key--value pair in the \meta{property list} as two trailing brace +% groups. For instance, +% \begin{verbatim} +% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } } +% \end{verbatim} +% expands to the value corresponding to \texttt{mykey}: for each +% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives +% \texttt{mykey}, the \meta{key} and the \meta{value} as its three +% arguments. For that specific task, \cs{prop_item:Nn} is faster. +% \end{function} +% % \begin{function}[updated = 2012-06-29, rEXP]{\prop_map_break:} % \begin{syntax} % \cs{prop_map_break:} @@ -1215,6 +1235,34 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[rEXP]{\prop_map_tokens:Nn, \prop_map_tokens:cn} +% \begin{macro}{\@@_map_tokens:nwwn} +% The mapping is very similar to \cs{prop_map_function:NN}. The +% \cs{use_i:nn} removes the leading \cs{s_@@}. The odd construction +% |\use:n {#1}| allows |#1| to contain any token without interfering +% with \cs{prop_map_break:}. The loop stops when the argument +% delimited by \cs{@@_pair:wn} is \cs{prg_break:} instead of being +% empty. +% \begin{macrocode} +\cs_new:Npn \prop_map_tokens:Nn #1#2 + { + \exp_last_unbraced:Nno + \use_i:nn { \@@_map_tokens:nwwn {#2} } #1 + \prg_break: \@@_pair:wn \s_@@ { } \prg_break_point: + \prg_break_point:Nn \prop_map_break: { } + } +\cs_new:Npn \@@_map_tokens:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4 + { + #2 + \use:n {#1} {#3} {#4} + \@@_map_tokens:nwwn {#1} + } +\cs_generate_variant:Nn \prop_map_tokens:Nn { c } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% % \begin{macro}[tested = m3prop003]{\prop_map_break:} % \begin{macro}[tested = m3prop003]{\prop_map_break:n} % The break statements are based on the general \cs{prg_map_break:Nn}. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index 9ef207f3462..a3a3ab9bc8c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index f4f3fb1ddd5..3a44b40ce0a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -656,7 +656,7 @@ % \cs{regex_replace_all:nnN} \Arg{regular expression} \Arg{replacement} \meta{tl~var} % \cs{regex_replace_all:nnNTF} \Arg{regular expression} \Arg{replacement} \meta{tl~var} \Arg{true code} \Arg{false code} % \end{syntax} -% Replaces all occurrences of the \cs{regular expression} in the +% Replaces all occurrences of the \meta{regular expression} in the % \meta{token list} by the \meta{replacement}, where |\0| represents % the full match, |\1| represent the contents of the first capturing % group, |\2| of the second, \emph{etc.} Every match is treated @@ -697,7 +697,7 @@ % non-implemented syntax. % \item Test for the maximum register \cs{c_max_register_int}. % \item Find out whether the fact that |\W| and friends match the -% end-marker leads to bugs. Possibly update \cs{__regex_item_reverse:n}. +% end-marker leads to bugs. Possibly update \cs[no-index]{__regex_item_reverse:n}. % \item The empty cs should be matched by |\c{}|, not by % |\c{csname.?endcsname\s?}|. % \end{itemize} @@ -709,21 +709,21 @@ % \item Only build |\c{...}| once. % \item Use arrays for the left and right state stacks when % compiling a regex. -% \item Should \cs{__regex_action_free_group:n} only be used for greedy +% \item Should \cs[no-index]{__regex_action_free_group:n} only be used for greedy % |{n,}| quantifier? (I think not.) % \item Quantifiers for |\u| and assertions. % \item When matching, keep track of an explicit stack of % \texttt{current_state} and \texttt{current_submatches}. % \item If possible, when a state is reused by the same thread, kill % other subthreads. -% \item Use an array rather than \cs{l__regex_balance_tl} -% to build the function \cs{__regex_replacement_balance_one_match:n}. +% \item Use an array rather than \cs[no-index]{l__regex_balance_tl} +% to build the function \cs[no-index]{__regex_replacement_balance_one_match:n}. % \item Reduce the number of epsilon-transitions in alternatives. % \item Optimize simple strings: use less states (|abcade| should give % two states, for |abc| and |ade|). [Does that really make sense?] % \item Optimize groups with no alternative. -% \item Optimize states with a single \cs{__regex_action_free:n}. -% \item Optimize the use of \cs{__regex_action_success:} by inserting it +% \item Optimize states with a single \cs[no-index]{__regex_action_free:n}. +% \item Optimize the use of \cs[no-index]{__regex_action_success:} by inserting it % in state $2$ directly instead of having an extra transition. % \item Optimize the use of \cs{int_step_...} functions. % \item Groups don't capture within regexes for csnames; optimize and diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 2a0083bd6af..91bb0784fab 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -498,6 +498,8 @@ % Applies \meta{function} to every \meta{item} stored in the % \meta{sequence}. The \meta{function} will receive one argument for % each iteration. The \meta{items} are returned from left to right. +% To pass further arguments to the \meta{function}, see +% \cs{seq_map_tokens:Nn}. % The function \cs{seq_map_inline:Nn} is faster than % \cs{seq_map_function:NN} for sequences with more than about~$10$ % items. @@ -514,6 +516,23 @@ % The \meta{items} are returned from left to right. % \end{function} % +% \begin{function}[rEXP, added = 2019-08-30] +% {\seq_map_tokens:Nn, \seq_map_tokens:cn} +% \begin{syntax} +% \cs{seq_map_tokens:Nn} \meta{sequence} \Arg{code} +% \end{syntax} +% Analogue of \cs{seq_map_function:NN} which maps several tokens +% instead of a single function. The \meta{code} receives each item in +% the \meta{sequence} as two trailing brace groups. For instance, +% \begin{verbatim} +% \seq_map_tokens:Nn \l_my_seq { \prg_replicate:nn { 2 } } +% \end{verbatim} +% expands to twice each item in the \meta{sequence}: for each item in +% |\l_my_seq| the function \cs{prg_replicate:nn} receives |2| and +% \meta{item} as its two arguments. The function +% \cs{seq_map_inline:Nn} is typically faster but is not expandable. +% \end{function} +% % \begin{function}[updated = 2012-06-29] % { % \seq_map_variable:NNn, \seq_map_variable:Ncn, @@ -1835,6 +1854,31 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\seq_map_tokens:Nn, \seq_map_tokens:cn} +% \begin{macro}{\@@_map_tokens:nw} +% This is based on the function mapping but using the same tricks as +% described for \cs{prop_map_tokens:Nn}. The idea is to remove the leading +% \cs{s_@@} and apply the tokens such that they are safe with the +% break points, hence the \cs{use:n}. +% \begin{macrocode} +\cs_new:Npn \seq_map_tokens:Nn #1#2 + { + \exp_last_unbraced:Nno + \use_i:nn { \@@_map_tokens:nw {#2} } #1 + \prg_break: \@@_item:n { } \prg_break_point: + \prg_break_point:Nn \seq_map_break: { } + } +\cs_generate_variant:Nn \seq_map_tokens:Nn { c } +\cs_new:Npn \@@_map_tokens:nw #1#2 \@@_item:n #3 + { + #2 + \use:n {#1} {#3} + \@@_map_tokens:nw {#1} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro} % { % \seq_map_variable:NNn, \seq_map_variable:Ncn, diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 7f086805832..3985d09297b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index ddff3a85835..8e8ca964aa4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx index 1343955f7a4..90ed9bcc75d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -186,7 +186,7 @@ % encoding. Instead, the \meta{false code} is performed. % \end{function} % -% \section{Creating $8$-bit mappings} +% \section[Creating 8-bit mappings]{Creating $8$-bit mappings} % % \begin{function}{\str_declare_eight_bit_encoding:nnn} % \begin{syntax} @@ -218,8 +218,8 @@ % \item The \texttt{hex} unescaping should raise an error for % odd-token count strings. % \item Decide what bytes should be escaped in the \texttt{url} -% escaping. Perhaps |!'()*-./0123456789_| are safe, and all other -% characters should be escaped? +% escaping. Perhaps the characters |!'()*-./0123456789_| are safe, +% and all other characters should be escaped? % \item Automate generation of 8-bit mapping files. % \item Change the framework for 8-bit encodings: for decoding from % 8-bit to Unicode, use $256$ integer registers; for encoding, use a diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 32dd203cfc4..453d341acb9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -656,7 +656,11 @@ % \iow_term:x { \str_range:nnn { abcdef } { -1 } { -4 } } % \end{verbatim} % both yield empty strings. +% \end{function} % +% ^^A If this stays in the same {function} environment, we get a really +% ^^A awful page break. Perhaps we should add a way to allow a page break +% ^^A in a function environment... % The behavior of \cs{str_range_ignore_spaces:nnn} is similar, but spaces % are removed before starting the job. The input % \begin{verbatim} @@ -682,7 +686,7 @@ % \end{verbatim} % will print four instances of |bcde|, four instances of |bc e| and eight % instances of |bcde|. -% \end{function} +% ^^A\end{function} % % \section{String manipulation} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index 149c5771882..01deeba0bee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 02e08827b44..d5803a0bc45 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 77444e6d13c..d0325848e36 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % @@ -353,7 +353,8 @@ % % \section{Token list conditionals} % -% \begin{function}[EXP,pTF]{\tl_if_blank:n, \tl_if_blank:V, \tl_if_blank:o} +% \begin{function}[EXP,pTF, updated = 2019-09-04] +% {\tl_if_blank:n, \tl_if_blank:e, \tl_if_blank:V, \tl_if_blank:o} % \begin{syntax} % \cs{tl_if_blank_p:n} \Arg{token list} % \cs{tl_if_blank:nTF} \Arg{token list} \Arg{true code} \Arg{false code} @@ -551,6 +552,25 @@ % receives the \meta{item} as |#1|. See also \cs{tl_map_function:nN}. % \end{function} % +% \begin{function}[rEXP, added = 2019-09-02] +% {\tl_map_tokens:Nn, \tl_map_tokens:cn, \tl_map_tokens:nn} +% \begin{syntax} +% \cs{tl_map_tokens:Nn} \meta{tl~var} \Arg{code} +% \cs{tl_map_tokens:nn} \meta{tokens} \Arg{code} +% \end{syntax} +% Analogue of \cs{tl_map_function:NN} which maps several tokens +% instead of a single function. The \meta{code} receives each item in +% the \meta{tl~var} or \meta{tokens} as two trailing brace groups. For +% instance, +% \begin{verbatim} +% \tl_map_tokens:Nn \l_my_tl { \prg_replicate:nn { 2 } } +% \end{verbatim} +% expands to twice each item in the \meta{sequence}: for each item in +% |\l_my_tl| the function \cs{prg_replicate:nn} receives |2| and +% \meta{item} as its two arguments. The function +% \cs{tl_map_inline:Nn} is typically faster but is not expandable. +% \end{function} +% % \begin{function}[updated = 2012-06-29] % {\tl_map_variable:NNn, \tl_map_variable:cNn} % \begin{syntax} @@ -1065,12 +1085,11 @@ % Leaves in the input stream the items from the \meta{start index} to the % \meta{end index} inclusive. Spaces and braces are preserved between % the items returned (but never at either end of the list). -% % Here \meta{start index} and \meta{end index} should be integer denotations. % For describing in detail the functions' behavior, let $m$ and $n$ be the start % and end index respectively. If either is $0$, the result is empty. A positive -% index means `start counting from the left end', a negative index means -% `start counting from the right end'. Let $l$ be the count of the token list. +% index means `start counting from the left end', and a negative index means +% `from the right end'. Let $l$ be the count of the token list. % % The \emph{actual start point} is determined as $M=m$ if~$m>0$ and as $M=l+m+1$ % if~$m<0$. Similarly the \emph{actual end point} is $N=n$ if~$n>0$ and $N=l+n+1$ @@ -1110,16 +1129,17 @@ % \begin{verbatim} % \tl_range:nnn { abcd~{e{}}f } { 2 } { 4 } % \end{verbatim} -% will discard the space after `d`. +% will discard the space after `d'. % -% If we want to get the items from the third to the last, the call +% If we want to get the items from, say, the third to the last in a token +% list |<tl>|, the call % is |\tl_range:nnn { <tl> } { 3 } { -1 }|. Similarly, for discarding % the last item, we can do |\tl_range:nnn { <tl> } { 1 } { -2 }|. % -% The behavior of \cs{tl_range:Nnn} is exactly the same, acting on the -% contents of the tl variable. +%^^A The behavior of \cs{tl_range:Nnn} is exactly the same, acting on the +%^^A contents of the tl variable. % -% For improved performance, see \cs{tl_range_braced:nnn} and +% For better performance, see \cs{tl_range_braced:nnn} and % \cs{tl_range_unbraced:nnn}. % \begin{texnote} % The result is returned within the \tn{unexpanded} @@ -2033,7 +2053,7 @@ \fi: } \prg_generate_conditional_variant:Nnn \tl_if_blank:n - { V , o } { p , T , F , TF } + { e , V , o } { p , T , F , TF } % \end{macrocode} % \end{macro} % \end{macro} @@ -2408,6 +2428,31 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\tl_map_tokens:nn} +% \begin{macro}{\tl_map_tokens:Nn, \tl_map_tokens:cn} +% \begin{macro}{\@@_map_tokens:nn} +% Much like the function mapping. +% \begin{macrocode} +\cs_new:Npn \tl_map_tokens:nn #1#2 + { + \@@_map_tokens:nn {#2} #1 + \q_recursion_tail + \prg_break_point:Nn \tl_map_break: { } + } +\cs_new:Npn \tl_map_tokens:Nn + { \exp_args:No \tl_map_tokens:nn } +\cs_generate_variant:Nn \tl_map_tokens:Nn { c } +\cs_new:Npn \@@_map_tokens:nn #1#2 + { + \quark_if_recursion_tail_break:nN {#2} \tl_map_break: + \use:n {#1} {#2} + \@@_map_tokens:nn {#1} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\tl_map_variable:nNn} % \begin{macro}{\tl_map_variable:NNn, \tl_map_variable:cNn} % \begin{macro}{\@@_map_variable:Nnn} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index 9b9946a4f8c..489baa08e3f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index fbaa4659352..55845d76457 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-08-25} +% \date{Released 2019-09-05} % % \maketitle % |