diff options
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3regex.dtx')
-rw-r--r-- | macros/latex/contrib/l3kernel/l3regex.dtx | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx index 92861173b6..b2443a4b27 100644 --- a/macros/latex/contrib/l3kernel/l3regex.dtx +++ b/macros/latex/contrib/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-04-20} +% \date{Released 2023-05-05} % % \maketitle % @@ -3536,7 +3536,7 @@ \@@_compile_cs_aux:Nn } { - \@@_quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } } + \@@_quark_if_nil:NF #1 { \flag_ensure_raised:n { @@_cs } } \@@_use_none_delimit_by_q_recursion_stop:w } } @@ -3558,7 +3558,7 @@ { \@@_quark_if_nil:NF #1 { - \flag_raise_if_clear:n { @@_cs } + \flag_ensure_raised:n { @@_cs } \@@_use_i_delimit_by_q_recursion_stop:nw } \@@_use_none_delimit_by_q_recursion_stop:w @@ -6938,6 +6938,9 @@ % \end{macro} % % \begin{macro}{\@@_group_end_extract_seq:N} +% \begin{macro}{\@@_extract_seq:N} +% \begin{macro}{\@@_extract_seq:NNn} +% \begin{macro}{\@@_extract_seq_loop:Nw} % The end-points of submatches are stored as entries of two arrays % from \cs{l_@@_min_submatch_int} to \cs{l_@@_submatch_int} % (exclusive). Extract the relevant ranges into \cs{g_@@_internal_tl}, @@ -6977,12 +6980,28 @@ { \int_use:N \l_@@_added_end_int } } \group_end: - \cs_set_eq:NN \@@_tmp:w \@@_extract_map_loop:w - \seq_set_from_function:NnN #1 - { \@@_extract_map:N } \exp_not:n + \@@_extract_seq:N #1 + } +\cs_gset_protected:Npn \@@_extract_seq:N #1 + { + \seq_clear:N #1 + \cs_set_eq:NN \@@_tmp:w \@@_extract_seq_loop:Nw + \exp_after:wN \@@_extract_seq:NNn + \exp_after:wN #1 + \g_@@_internal_tl \use_none:nnn + } +\cs_new_protected:Npn \@@_extract_seq:NNn #1#2#3 + { #3 #2 #1 \prg_do_nothing: } +\cs_new_protected:Npn \@@_extract_seq_loop:Nw #1#2 \@@_tmp:w #3 + { + \seq_put_right:No #1 {#2} + #3 \@@_extract_seq_loop:Nw #1 \prg_do_nothing: } % \end{macrocode} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}[EXP]{\@@_extract_seq_aux:n, \@@_extract_seq_aux:ww} % The \texttt{:n} auxiliary builds one item of the sequence of @@ -7090,35 +7109,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP] -% { -% \@@_extract_map:N, -% \@@_extract_map_aux:NNn, -% \@@_extract_map_loop:w -% } -% This receives a |seq| internal function and maps it over all items -% in \cs{g_@@_internal_tl}. This token list takes the form -% \cs{@@_tmp:w} |{}| \meta{item_1} \cs{@@_tmp:w} |{}| \meta{item_2} -% \ldots{} \cs{@@_tmp:w}, and the calling code has set \cs{@@_tmp:w} -% equal to \cs{@@_extract_map_loop:w}. The loop is otherwise pretty -% standard, with \cs{prg_do_nothing:} to avoid losing braces. -% \begin{macrocode} -\cs_new:Npn \@@_extract_map:N #1 - { - \exp_after:wN \@@_extract_map_aux:NNn - \exp_after:wN #1 - \g_@@_internal_tl \use_none:nnn - } -\cs_new:Npn \@@_extract_map_aux:NNn #1#2#3 - { #3 #2 #1 \prg_do_nothing: } -\cs_new:Npn \@@_extract_map_loop:w #1#2 \@@_tmp:w #3 - { - \exp_after:wN #1 \exp_after:wN {#2} - #3 \@@_extract_map_loop:w #1 \prg_do_nothing: - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_extract:, \@@_extract_aux:w} % Our task here is to store the list of end-points of submatches, and % store them in appropriate array entries, from |