diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3regex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3regex.dtx | 258 |
1 files changed, 129 insertions, 129 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index 3d342960ac9..87dfcec47b1 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 2023-08-29} +% \date{Released 2023-10-10} % % \maketitle % @@ -1158,24 +1158,24 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_toks_put_left:Nx} -% \begin{macro}{\@@_toks_put_right:Nx, \@@_toks_put_right:Nn} +% \begin{macro}{\@@_toks_put_left:Ne} +% \begin{macro}{\@@_toks_put_right:Ne, \@@_toks_put_right:Nn} % During the building phase we wish to add \texttt{x}-expanded % material to \tn{toks}, either to the left or to the right. The % expansion is done \enquote{by hand} for optimization (these % operations are used quite a lot). The \texttt{Nn} version of -% \cs{@@_toks_put_right:Nx} is provided because it is more +% \cs{@@_toks_put_right:Ne} is provided because it is more % efficient than \texttt{x}-expanding with \cs{exp_not:n}. % \begin{macrocode} -\cs_new_protected:Npn \@@_toks_put_left:Nx #1#2 +\cs_new_protected:Npn \@@_toks_put_left:Ne #1#2 { - \cs_set_nopar:Npx \@@_tmp:w { #2 } + \cs_set_nopar:Npe \@@_tmp:w { #2 } \tex_toks:D #1 \exp_after:wN \exp_after:wN \exp_after:wN { \exp_after:wN \@@_tmp:w \tex_the:D \tex_toks:D #1 } } -\cs_new_protected:Npn \@@_toks_put_right:Nx #1#2 +\cs_new_protected:Npn \@@_toks_put_right:Ne #1#2 { - \cs_set_nopar:Npx \@@_tmp:w {#2} + \cs_set_nopar:Npe \@@_tmp:w {#2} \tex_toks:D #1 \exp_after:wN { \tex_the:D \tex_toks:D \exp_after:wN #1 \@@_tmp:w } } @@ -1541,7 +1541,7 @@ { \int_compare:nNnTF \l_@@_curr_catcode_int = 0 { - \__kernel_tl_set:Nx \l_@@_internal_a_tl + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \scan_stop: \@@_curr_cs_to_str: \scan_stop: } \tl_if_in:noTF { \scan_stop: #1 \scan_stop: } \l_@@_internal_a_tl @@ -1568,7 +1568,7 @@ \@@_build_for_cs:n {#1} \bool_set_eq:NN \l_@@_saved_success_bool \g_@@_success_bool - \exp_args:Nx \@@_match_cs:n { \@@_curr_cs_to_str: } + \exp_args:Ne \@@_match_cs:n { \@@_curr_cs_to_str: } \if_meaning:w \c_true_bool \g_@@_success_bool \group_insert_after:N \@@_break_true:w \fi: @@ -1729,9 +1729,9 @@ \cs_set:Npn \@@_escape_escaped:N ##1 { #2 } \cs_set:Npn \@@_escape_raw:N ##1 { #3 } \@@_standard_escapechar: - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \__kernel_str_to_other_fast:n {#4} } - \tl_put_right:Nx \l_@@_internal_a_tl + \tl_put_right:Ne \l_@@_internal_a_tl { \exp_after:wN \@@_escape_loop:N \g_@@_internal_tl \scan_stop: \prg_break_point: @@ -1797,17 +1797,17 @@ \prg_break: } \cs_new:cpn { @@_escape_~:w } { } -\cs_new:cpx { @@_escape_/a:w } +\cs_new:cpe { @@_escape_/a:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^G } -\cs_new:cpx { @@_escape_/t:w } +\cs_new:cpe { @@_escape_/t:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^I } -\cs_new:cpx { @@_escape_/n:w } +\cs_new:cpe { @@_escape_/n:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^J } -\cs_new:cpx { @@_escape_/f:w } +\cs_new:cpe { @@_escape_/f:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^L } -\cs_new:cpx { @@_escape_/r:w } +\cs_new:cpe { @@_escape_/r:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^M } -\cs_new:cpx { @@_escape_/e:w } +\cs_new:cpe { @@_escape_/e:w } { \exp_not:N \@@_escape_raw:N \iow_char:N \^^[ } % \end{macrocode} % \end{macro} @@ -2421,7 +2421,7 @@ } { } \if_int_compare:w \l_@@_group_level_int > \c_zero_int - \msg_error:nnx { regex } { missing-rparen } + \msg_error:nne { regex } { missing-rparen } { \int_use:N \l_@@_group_level_int } \prg_replicate:nn { \l_@@_group_level_int } @@ -2440,7 +2440,7 @@ \fi: \tl_build_put_right:Nn \l_@@_build_tl { \if_false: { \fi: } } \tl_build_end:N \l_@@_build_tl - \exp_args:NNNx + \exp_args:NNNe \group_end: \tl_set:Nn \l_@@_internal_regex { \l_@@_build_tl } } @@ -2550,7 +2550,7 @@ \tl_build_put_right:Nn \l_@@_build_tl { \@@_class:NnnnN \c_true_bool { \if_false: } \fi: } } - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \if_int_compare:w \l_@@_catcodes_int < \c_@@_all_catcodes_int @@ -2567,19 +2567,19 @@ % \end{macro} % % \begin{macro} -% {\@@_compile_abort_tokens:n, \@@_compile_abort_tokens:x} +% {\@@_compile_abort_tokens:n, \@@_compile_abort_tokens:e} % This function places the collected tokens back in the input stream, % each as a raw character. Spaces are not preserved. % \begin{macrocode} \cs_new_protected:Npn \@@_compile_abort_tokens:n #1 { - \use:x + \use:e { \exp_args:No \tl_map_function:nN { \tl_to_str:n {#1} } \@@_compile_raw:N } } -\cs_generate_variant:Nn \@@_compile_abort_tokens:n { x } +\cs_generate_variant:Nn \@@_compile_abort_tokens:n { e } % \end{macrocode} % \end{macro} % @@ -2617,7 +2617,7 @@ % \end{macro} % % \begin{macro}{\@@_compile_quantifier_none:} -% \begin{macro}{\@@_compile_quantifier_abort:xNN} +% \begin{macro}{\@@_compile_quantifier_abort:eNN} % Those functions are called whenever there is no quantifier, or a % braced construction is invalid (equivalent to no quantifier, and % whatever characters were grabbed are left raw). @@ -2627,11 +2627,11 @@ \tl_build_put_right:Nn \l_@@_build_tl { \if_false: { \fi: } { 1 } { 0 } \c_false_bool } } -\cs_new_protected:Npn \@@_compile_quantifier_abort:xNN #1#2#3 +\cs_new_protected:Npn \@@_compile_quantifier_abort:eNN #1#2#3 { \@@_compile_quantifier_none: - \msg_warning:nnxx { regex } { invalid-quantifier } {#1} {#3} - \@@_compile_abort_tokens:x {#1} + \msg_warning:nnee { regex } { invalid-quantifier } {#1} {#3} + \@@_compile_abort_tokens:e {#1} #2 #3 } % \end{macrocode} @@ -2703,7 +2703,7 @@ { \@@_get_digits:NTFw \l_@@_internal_a_int { \@@_compile_quantifier_braced_auxi:w } - { \@@_compile_quantifier_abort:xNN { \c_left_brace_str } } + { \@@_compile_quantifier_abort:eNN { \c_left_brace_str } } } \cs_new_protected:Npn \@@_compile_quantifier_braced_auxi:w #1#2 { @@ -2722,7 +2722,7 @@ } } { - \@@_compile_quantifier_abort:xNN + \@@_compile_quantifier_abort:eNN { \c_left_brace_str \int_use:N \l_@@_internal_a_int } #1 #2 } @@ -2735,7 +2735,7 @@ { \int_use:N \l_@@_internal_a_int } { -1 } } { - \@@_compile_quantifier_abort:xNN + \@@_compile_quantifier_abort:eNN { \c_left_brace_str \int_use:N \l_@@_internal_a_int , } #1 #2 } @@ -2746,7 +2746,7 @@ { \if_int_compare:w \l_@@_internal_a_int > \l_@@_internal_b_int - \msg_error:nnxx { regex } { backwards-quantifier } + \msg_error:nnee { regex } { backwards-quantifier } { \int_use:N \l_@@_internal_a_int } { \int_use:N \l_@@_internal_b_int } \int_zero:N \l_@@_internal_b_int @@ -2758,7 +2758,7 @@ { \int_use:N \l_@@_internal_b_int } } { - \@@_compile_quantifier_abort:xNN + \@@_compile_quantifier_abort:eNN { \c_left_brace_str \int_use:N \l_@@_internal_a_int , @@ -2780,7 +2780,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compile_raw_error:N #1 { - \msg_error:nnx { regex } { bad-escape } {#1} + \msg_error:nne { regex } { bad-escape } {#1} \@@_compile_raw:N #1 } % \end{macrocode} @@ -2839,9 +2839,9 @@ \@@_if_end_range:NNTF #2 #3 { \if_int_compare:w `#1 > `#3 \exp_stop_f: - \msg_error:nnxx { regex } { range-backwards } {#1} {#3} + \msg_error:nnee { regex } { range-backwards } {#1} {#3} \else: - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \if_int_compare:w `#1 = `#3 \exp_stop_f: \@@_item_equal:n @@ -2853,9 +2853,9 @@ \fi: } { - \msg_warning:nnxx { regex } { range-missing-end } + \msg_warning:nnee { regex } { range-missing-end } {#1} { \c_backslash_str #3 } - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \@@_item_equal:n { \int_value:w `#1 \exp_stop_f: } \@@_item_equal:n { \int_value:w `- \exp_stop_f: } @@ -2873,7 +2873,7 @@ % \cs{@@_prop_.:}, which matches any character or control % sequence, and refuses $-2$ (end-marker). % \begin{macrocode} -\cs_new_protected:cpx { @@_compile_.: } +\cs_new_protected:cpe { @@_compile_.: } { \exp_not:N \@@_if_in_class:TF { \@@_compile_raw:N . } @@ -2904,9 +2904,9 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2 { - \cs_new_protected:cpx { @@_compile_/#1: } + \cs_new_protected:cpe { @@_compile_/#1: } { \@@_compile_one:n \exp_not:c { @@_prop_#1: } } - \cs_new_protected:cpx { @@_compile_/#2: } + \cs_new_protected:cpe { @@_compile_/#2: } { \@@_compile_one:n { \@@_item_reverse:n { \exp_not:c { @@_prop_#1: } } } @@ -2967,8 +2967,8 @@ } } } -\exp_args:Nx \@@_tmp:w { \iow_char:N \^ } { \@@_A_test: } -\exp_args:Nx \@@_tmp:w { \iow_char:N \$ } { \@@_Z_test: } +\exp_args:Ne \@@_tmp:w { \iow_char:N \^ } { \@@_A_test: } +\exp_args:Ne \@@_tmp:w { \iow_char:N \$ } { \@@_Z_test: } % \end{macrocode} % \end{macro} % \end{macro} @@ -3117,11 +3117,11 @@ { : { \@@_compile_class_posix:NNNNw } = { - \msg_warning:nnx { regex } + \msg_warning:nne { regex } { posix-unsupported } { = } } . { - \msg_warning:nnx { regex } + \msg_warning:nne { regex } { posix-unsupported } { . } } } @@ -3133,12 +3133,12 @@ \@@_two_if_eq:NNNNTF #5 #6 \@@_compile_special:N ^ { \bool_set_false:N \l_@@_internal_bool - \__kernel_tl_set:Nx \l_@@_internal_a_tl { \if_false: } \fi: + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \if_false: } \fi: \@@_compile_class_posix_loop:w } { \bool_set_true:N \l_@@_internal_bool - \__kernel_tl_set:Nx \l_@@_internal_a_tl { \if_false: } \fi: + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \if_false: } \fi: \@@_compile_class_posix_loop:w #5 #6 } } @@ -3163,9 +3163,9 @@ } } { - \msg_warning:nnx { regex } { posix-unknown } + \msg_warning:nne { regex } { posix-unknown } { \l_@@_internal_a_tl } - \@@_compile_abort_tokens:x + \@@_compile_abort_tokens:e { [: \bool_if:NF \l_@@_internal_bool { ^ } \l_@@_internal_a_tl :] @@ -3173,9 +3173,9 @@ } } { - \msg_error:nnxx { regex } { posix-missing-close } + \msg_error:nnee { regex } { posix-missing-close } { [: \l_@@_internal_a_tl } { #2 #4 } - \@@_compile_abort_tokens:x { [: \l_@@_internal_a_tl } + \@@_compile_abort_tokens:e { [: \l_@@_internal_a_tl } #1 #2 #3 #4 } } @@ -3213,7 +3213,7 @@ \if_int_compare:w \l_@@_group_level_int > \c_zero_int \tl_build_put_right:Nn \l_@@_build_tl { \if_false: { \fi: } } \tl_build_end:N \l_@@_build_tl - \exp_args:NNNx + \exp_args:NNNe \group_end: \tl_build_put_right:Nn \l_@@_build_tl { \l_@@_build_tl } \int_set_eq:NN \l_@@_catcodes_int \l_@@_default_catcodes_int @@ -3252,7 +3252,7 @@ \cs_if_exist_use:cF { @@_compile_special_group_\token_to_str:N #4 :w } { - \msg_warning:nnx { regex } { special-group-unknown } + \msg_warning:nne { regex } { special-group-unknown } { (? #4 } \@@_compile_group_begin:N \@@_group:nnnN \@@_compile_raw:N ? #3 #4 @@ -3321,7 +3321,7 @@ { \@@_item_caseless_range:nn } } { - \msg_warning:nnx { regex } { unknown-option } { (?i #2 } + \msg_warning:nne { regex } { unknown-option } { (?i #2 } \@@_compile_raw:N ( \@@_compile_raw:N ? \@@_compile_raw:N i @@ -3340,7 +3340,7 @@ { \@@_item_caseful_range:nn } } { - \msg_warning:nnx { regex } { unknown-option } { (?-#2#4 } + \msg_warning:nne { regex } { unknown-option } { (?-#2#4 } \@@_compile_raw:N ( \@@_compile_raw:N ? \@@_compile_raw:N - @@ -3379,7 +3379,7 @@ } { \cs_if_exist_use:cF { @@_compile_c_#2:w } } { - \msg_error:nnx { regex } { c-missing-category } {#2} + \msg_error:nne { regex } { c-missing-category } {#2} #1 #2 } } @@ -3453,7 +3453,7 @@ { \@@_compile_c_lbrack_end: } } { - \msg_error:nnx { regex } { c-missing-rbrack } {#2} + \msg_error:nne { regex } { c-missing-rbrack } {#2} \@@_compile_c_lbrack_end: #1 #2 } @@ -3534,12 +3534,12 @@ { \@@_compile_end: \flag_clear:n { @@_cs } - \__kernel_tl_set:Nx \l_@@_internal_a_tl + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \exp_after:wN \@@_compile_cs_aux:Nn \l_@@_internal_regex \q_@@_nil \q_@@_nil \q_@@_recursion_stop } - \exp_args:Nx \@@_compile_one:n + \exp_args:Ne \@@_compile_one:n { \flag_if_raised:nTF { @@_cs } { \@@_item_cs:n { \exp_not:o \l_@@_internal_regex } } @@ -3622,7 +3622,7 @@ \@@_two_if_eq:NNNNTF #2 #3 \@@_compile_special:N \c_left_brace_str { \tl_set:Nn \l_@@_internal_b_tl {#1} - \__kernel_tl_set:Nx \l_@@_internal_a_tl { \if_false: } \fi: + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \if_false: } \fi: \@@_compile_u_loop:NN } { @@ -3665,7 +3665,7 @@ } { \if_false: { \fi: } - \msg_error:nnx { regex } { u-missing-rbrace } {#2} + \msg_error:nne { regex } { u-missing-rbrace } {#2} \l_@@_internal_b_tl #1 #2 } @@ -3691,7 +3691,7 @@ \group_begin: \cs_set:Npn \@@_group:nnnN { \@@_group_no_capture:nnnN } \cs_set:Npn \@@_group_resetting:nnnN { \@@_group_no_capture:nnnN } - \exp_args:NNx + \exp_args:NNe \group_end: \@@_compile_ur:n { \use:c { \l_@@_internal_a_tl } } } @@ -3756,12 +3756,12 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compile_u_in_cs: { - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \exp_args:No \__kernel_str_to_other_fast:n { \l_@@_internal_a_tl } } - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \tl_map_function:NN \g_@@_internal_tl \@@_compile_u_in_cs_aux:n @@ -3786,7 +3786,7 @@ { \tl_analysis_map_inline:Nn \l_@@_internal_a_tl { - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \@@_class:NnnnN \c_true_bool { @@ -4096,7 +4096,7 @@ \cs_new_protected:Npn \@@_show_one:n #1 { \int_incr:N \l_@@_show_lines_int - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \exp_not:N \iow_newline: \seq_map_function:NN \l_@@_show_prefix_seq \use:n @@ -4113,7 +4113,7 @@ % second argument in a deeper level of nesting. % \begin{macrocode} \cs_new_protected:Npn \@@_show_push:n #1 - { \seq_put_right:Nx \l_@@_show_prefix_seq { #1 ~ } } + { \seq_put_right:Ne \l_@@_show_prefix_seq { #1 ~ } } \cs_new_protected:Npn \@@_show_pop: { \seq_pop_right:NN \l_@@_show_prefix_seq \l_@@_internal_a_tl } \cs_new_protected:Npn \@@_show_scope:nn #1#2 @@ -4186,7 +4186,7 @@ \bool_if:NTF #1 { Match } { Don't~match } \@@_msg_repeated:nnN {#3} {#4} #5 } - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \exp_not:o \l_@@_internal_a_tl } } } @@ -4367,7 +4367,7 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_case_build:n, \@@_case_build:x, \@@_case_build_aux:Nn, \@@_case_build_loop:n} +% \begin{macro}{\@@_case_build:n, \@@_case_build:e, \@@_case_build_aux:Nn, \@@_case_build_loop:n} % See \cs{@@_build:n}, but with a loop. % \begin{macrocode} \cs_new_protected:Npn \@@_case_build:n #1 @@ -4375,7 +4375,7 @@ \@@_case_build_aux:Nn \c_true_bool {#1} \int_gzero:N \g_@@_case_int } -\cs_generate_variant:Nn \@@_case_build:n { x } +\cs_generate_variant:Nn \@@_case_build:n { e } \cs_new_protected:Npn \@@_case_build_aux:Nn #1#2 { \@@_standard_escapechar: @@ -4386,7 +4386,7 @@ { \@@_action_start_wildcard:N #1 } % \@@_build_new_state: - \@@_toks_put_left:Nx \l_@@_left_state_int + \@@_toks_put_left:Ne \l_@@_left_state_int { \@@_action_submatch:nN { 0 } < } \@@_push_lr_states: \int_zero:N \l_@@_case_max_group_int @@ -4410,7 +4410,7 @@ } \seq_pop:NN \l_@@_right_state_seq \l_@@_internal_a_tl \int_set:Nn \l_@@_right_state_int \l_@@_internal_a_tl - \@@_toks_put_left:Nx \l_@@_right_state_int + \@@_toks_put_left:Ne \l_@@_right_state_int { \@@_action_submatch:nN { 0 } > \int_gset:Nn \g_@@_case_int @@ -4498,9 +4498,9 @@ % differing usage later on. Both functions could be optimized. % \begin{macrocode} \cs_new_protected:Npn \@@_build_transition_left:NNN #1#2#3 - { \@@_toks_put_left:Nx #2 { #1 { \int_eval:n { #3 - #2 } } } } + { \@@_toks_put_left:Ne #2 { #1 { \int_eval:n { #3 - #2 } } } } \cs_new_protected:Npn \@@_build_transition_right:nNn #1#2#3 - { \@@_toks_put_right:Nx #2 { #1 { \int_eval:n { #3 - #2 } } } } + { \@@_toks_put_right:Ne #2 { #1 { \int_eval:n { #3 - #2 } } } } % \end{macrocode} % \end{macro} % @@ -4529,7 +4529,7 @@ \cs_new_protected:Npn \@@_build_transitions_lazyness:NNNNN #1#2#3#4#5 { \@@_build_new_state: - \@@_toks_put_right:Nx \l_@@_left_state_int + \@@_toks_put_right:Ne \l_@@_left_state_int { \if_meaning:w \c_true_bool #1 #2 { \int_eval:n { #3 - \l_@@_left_state_int } } @@ -4557,7 +4557,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_class:NnnnN #1#2#3#4#5 { - \cs_set:Npx \@@_tests_action_cost:n ##1 + \cs_set:Npe \@@_tests_action_cost:n ##1 { \exp_not:n { \exp_not:n {#2} } \bool_if:NTF #1 @@ -4791,8 +4791,8 @@ \cs_new_protected:Npn \@@_group_submatches:nNN #1#2#3 { \if_int_compare:w #1 > - \c_one_int - \@@_toks_put_left:Nx #2 { \@@_action_submatch:nN {#1} < } - \@@_toks_put_left:Nx #3 { \@@_action_submatch:nN {#1} > } + \@@_toks_put_left:Ne #2 { \@@_action_submatch:nN {#1} < } + \@@_toks_put_left:Ne #3 { \@@_action_submatch:nN {#1} > } \fi: } % \end{macrocode} @@ -4953,7 +4953,7 @@ \cs_new_protected:Npn \@@_assertion:Nn #1#2 { \@@_build_new_state: - \@@_toks_put_right:Nx \l_@@_left_state_int + \@@_toks_put_right:Ne \l_@@_left_state_int { \exp_not:n {#2} \@@_break_point:TF @@ -5005,7 +5005,7 @@ \cs_new_protected:Npn \@@_command_K: { \@@_build_new_state: - \@@_toks_put_right:Nx \l_@@_left_state_int + \@@_toks_put_right:Ne \l_@@_left_state_int { \@@_action_submatch:nN { 0 } < \bool_set_true:N \l_@@_fresh_thread_bool @@ -5347,7 +5347,7 @@ \fi: \int_set_eq:NN \l_@@_start_pos_int \l_@@_success_pos_int \bool_set_false:N \l_@@_match_success_bool - \tl_set:Nx \l_@@_curr_submatches_tl + \tl_set:Ne \l_@@_curr_submatches_tl { \prg_replicate:nn { 2 * \l_@@_capturing_group_int } { 0 , } } \int_set_eq:NN \l_@@_max_thread_int \l_@@_min_thread_int \@@_store_state:n { \l_@@_min_state_int } @@ -5423,10 +5423,10 @@ \tl_set:Nn \l_@@_curr_token_tl {#1} \int_set:Nn \l_@@_curr_char_int {#2} \int_set:Nn \l_@@_curr_catcode_int { "#3 } - \tl_build_put_right:Nx \l_@@_matched_analysis_tl + \tl_build_put_right:Ne \l_@@_matched_analysis_tl { \exp_not:o \l_@@_curr_analysis_tl } \tl_set:Nn \l_@@_curr_analysis_tl { { {#1} {#2} #3 } } - \use:x + \use:e { \int_set_eq:NN \l_@@_max_thread_int \l_@@_min_thread_int \int_step_function:nnN @@ -5539,7 +5539,7 @@ { \@@_action_free_aux:nn { < \l_@@_step_int } } \cs_new_protected:Npn \@@_action_free_aux:nn #1#2 { - \use:x + \use:e { \int_add:Nn \l_@@_curr_state_int {#2} \exp_not:n @@ -5569,7 +5569,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_action_cost:n #1 { - \exp_args:Nx \@@_store_state:n + \exp_args:Ne \@@_store_state:n { \int_eval:n { \l_@@_curr_state_int + #1 } } } % \end{macrocode} @@ -5627,7 +5627,7 @@ } \cs_new_protected:Npn \@@_action_submatch_aux:w #1 ; #2#3 { - \tl_set:Nx \l_@@_curr_submatches_tl + \tl_set:Ne \l_@@_curr_submatches_tl { \prg_replicate:nn { #2 \if_meaning:w > #3 + \l_@@_capturing_group_int \fi: } @@ -5844,7 +5844,7 @@ % % \subsubsection{Framework} % -% \begin{macro}{\@@_replacement:n, \@@_replacement:x} +% \begin{macro}{\@@_replacement:n, \@@_replacement:e} % \begin{macro}{\@@_replacement_apply:Nn, \@@_replacement_set:n} % The replacement text is built incrementally. We keep track in % \cs{l_@@_balance_int} of the balance of explicit begin- and @@ -5882,25 +5882,25 @@ {#2} \prg_do_nothing: \prg_do_nothing: \if_int_compare:w \l_@@_replacement_csnames_int > \c_zero_int - \msg_error:nnx { regex } { replacement-missing-rbrace } + \msg_error:nne { regex } { replacement-missing-rbrace } { \int_use:N \l_@@_replacement_csnames_int } - \tl_build_put_right:Nx \l_@@_build_tl + \tl_build_put_right:Ne \l_@@_build_tl { \prg_replicate:nn \l_@@_replacement_csnames_int \cs_end: } \fi: \seq_if_empty:NF \l_@@_replacement_category_seq { - \msg_error:nnx { regex } { replacement-missing-rparen } + \msg_error:nne { regex } { replacement-missing-rparen } { \seq_count:N \l_@@_replacement_category_seq } \seq_clear:N \l_@@_replacement_category_seq } - \tl_gput_right:Nx \g_@@_balance_tl + \tl_gput_right:Ne \g_@@_balance_tl { + \int_use:N \l_@@_balance_int } \tl_build_end:N \l_@@_build_tl \exp_args:NNo \group_end: #1 \l_@@_build_tl } -\cs_generate_variant:Nn \@@_replacement:n { x } +\cs_generate_variant:Nn \@@_replacement:n { e } \cs_new_protected:Npn \@@_replacement_set:n #1 { \cs_set:Npn \@@_replacement_do_one_match:n ##1 @@ -5927,7 +5927,7 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_case_replacement:n, \@@_case_replacement:x} +% \begin{macro}{\@@_case_replacement:n, \@@_case_replacement:e} % \begin{macrocode} \tl_new:N \g_@@_case_replacement_tl \tl_new:N \g_@@_case_balance_tl @@ -5947,7 +5947,7 @@ \exp_args:No \@@_replacement_set:n { \g_@@_case_replacement_tl \fi: } } -\cs_generate_variant:Nn \@@_case_replacement:n { x } +\cs_generate_variant:Nn \@@_case_replacement:n { e } \cs_new_protected:Npn \@@_case_replacement_aux:n #1 { \tl_gput_right:Nn \g_@@_case_replacement_tl { \or: #1 } @@ -6458,7 +6458,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_replacement_error:NNN #1#2#3 { - \msg_error:nnx { regex } { replacement-#1 } {#3} + \msg_error:nne { regex } { replacement-#1 } {#3} #2 #3 } % \end{macrocode} @@ -6502,7 +6502,7 @@ \cs_new_protected:Npn \regex_const:Nn #1#2 { \@@_compile:n {#2} - \tl_const:Nx #1 { \exp_not:o \l_@@_internal_regex } + \tl_const:Ne #1 { \exp_not:o \l_@@_internal_regex } } % \end{macrocode} % \end{macro} @@ -6516,8 +6516,8 @@ % Then show the variable with some appropriate text. The auxiliary % \cs{@@_show:N} is defined in a different section. % \begin{macrocode} -\cs_new_protected:Npn \regex_show:n { \@@_show:Nn \msg_show:nnxxxx } -\cs_new_protected:Npn \regex_log:n { \@@_show:Nn \msg_log:nnxxxx } +\cs_new_protected:Npn \regex_show:n { \@@_show:Nn \msg_show:nneeee } +\cs_new_protected:Npn \regex_log:n { \@@_show:Nn \msg_log:nneeee } \cs_new_protected:Npn \@@_show:Nn #1#2 { \@@_compile:n {#2} @@ -6526,8 +6526,8 @@ { \tl_to_str:n {#2} } { } { \l_@@_internal_a_tl } { } } -\cs_new_protected:Npn \regex_show:N { \@@_show:NN \msg_show:nnxxxx } -\cs_new_protected:Npn \regex_log:N { \@@_show:NN \msg_log:nnxxxx } +\cs_new_protected:Npn \regex_show:N { \@@_show:NN \msg_show:nneeee } +\cs_new_protected:Npn \regex_log:N { \@@_show:NN \msg_log:nneeee } \cs_new_protected:Npn \@@_show:NN #1#2 { \__kernel_chk_tl_type:NnnT #2 { regex } @@ -6663,15 +6663,15 @@ { \int_if_odd:nTF { \tl_count:n {#1} } { - \msg_error:nnxxxx { regex } { case-odd } + \msg_error:nneeee { regex } { case-odd } { \token_to_str:N \regex_replace_case_once:nN(TF) } { code } { \tl_count:n {#1} } { \tl_to_str:n {#1} } \use_ii:nn } { \@@_replace_once_aux:nnN - { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } - { \@@_replacement:x { \tl_item:nn {#1} { 2 * \g_@@_case_int } } } + { \@@_case_build:e { \@@_tl_odd_items:n {#1} } } + { \@@_replacement:e { \tl_item:nn {#1} { 2 * \g_@@_case_int } } } #2 \bool_if:NTF \g_@@_success_bool } @@ -6695,15 +6695,15 @@ { \int_if_odd:nTF { \tl_count:n {#1} } { - \msg_error:nnxxxx { regex } { case-odd } + \msg_error:nneeee { regex } { case-odd } { \token_to_str:N \regex_replace_case_all:nN(TF) } { code } { \tl_count:n {#1} } { \tl_to_str:n {#1} } \use_ii:nn } { \@@_replace_all_aux:nnN - { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } - { \@@_case_replacement:x { \@@_tl_even_items:n {#1} } } + { \@@_case_build:e { \@@_tl_odd_items:n {#1} } } + { \@@_case_replacement:e { \@@_tl_even_items:n {#1} } } #2 \bool_if:NTF \g_@@_success_bool } @@ -6857,14 +6857,14 @@ { \int_if_odd:nTF { \tl_count:n {#1} } { - \msg_error:nnxxxx { regex } { case-odd } + \msg_error:nneeee { regex } { case-odd } { \token_to_str:N \regex_match_case:nn(TF) } { code } { \tl_count:n {#1} } { \tl_to_str:n {#1} } \use_ii:nn } { \@@_if_match:nn - { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } + { \@@_case_build:e { \@@_tl_odd_items:n {#1} } } {#2} \bool_if:NTF \g_@@_success_bool } @@ -7001,7 +7001,7 @@ \flag_clear:n { @@_begin } \flag_clear:n { @@_end } \cs_set_eq:NN \@@_tmp:w \scan_stop: - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \int_step_function:nnN { \l_@@_min_submatch_int } { \l_@@_submatch_int - 1 } \@@_extract_seq_aux:n @@ -7012,12 +7012,12 @@ \int_set:Nn \l_@@_added_end_int { \flag_height:n { @@_end } } \tex_afterassignment:D \@@_extract_check:w - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \g_@@_internal_tl \if_false: { \fi: } } \int_compare:nNnT { \l_@@_added_begin_int + \l_@@_added_end_int } > 0 { - \msg_error:nnxxx { regex } { result-unbalanced } + \msg_error:nneee { regex } { result-unbalanced } { splitting~or~extracting~submatches } { \int_use:N \l_@@_added_begin_int } { \int_use:N \l_@@_added_end_int } @@ -7087,17 +7087,17 @@ % In \cs{@@_group_end_extract_seq:N} we had to expand % \cs{g_@@_internal_tl} to turn \cs{if_false:} constructions into % actual begin-group and end-group tokens. This is done with a -% \cs{__kernel_tl_gset:Nx} assignment, and \cs{@@_extract_check:w} is +% \cs{__kernel_tl_gset:Ne} assignment, and \cs{@@_extract_check:w} is % run immediately after this assignment ends, thanks to the % \tn{afterassignment} primitive. If all of the items were properly % balanced (enough begin-group tokens before end-group tokens, so |}{| % is not) then \cs{@@_extract_check:w} is called just before the -% closing brace of the \cs{__kernel_tl_gset:Nx} (thanks to our sneaky +% closing brace of the \cs{__kernel_tl_gset:Ne} (thanks to our sneaky % \cs{if_false:} |{| \cs{fi:} |}| construction), and finds that there % is nothing left to expand. If any of the items is unbalanced, the % assignment gets ended early by an extra end-group token, and our % check finds more tokens needing to be expanded in a new -% \cs{__kernel_tl_gset:Nx} assignment. We need to add a begin-group +% \cs{__kernel_tl_gset:Ne} assignment. We need to add a begin-group % and an end-group tokens to the unbalanced item, namely to the last % item found so far, which we reach through a loop. % \begin{macrocode} @@ -7113,7 +7113,7 @@ \int_incr:N \l_@@_added_begin_int \int_incr:N \l_@@_added_end_int \tex_afterassignment:D \@@_extract_check:w - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \exp_after:wN \@@_extract_check_loop:w \g_@@_internal_tl @@ -7234,7 +7234,7 @@ \@@_replacement_balance_one_match:n { \l_@@_zeroth_submatch_int } } - \__kernel_tl_set:Nx \l_@@_internal_a_tl + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \@@_replacement_do_one_match:n { \l_@@_zeroth_submatch_int } @@ -7283,7 +7283,7 @@ { \l_@@_submatch_int - 1 } \@@_replacement_balance_one_match:n } - \__kernel_tl_set:Nx \l_@@_internal_a_tl + \__kernel_tl_set:Ne \l_@@_internal_a_tl { \int_step_function:nnnN { \l_@@_min_submatch_int } @@ -7327,7 +7327,7 @@ \@@_group_end_replace_try: \int_compare:nNnT { \l_@@_added_begin_int + \l_@@_added_end_int } > 0 { - \msg_error:nnxxx { regex } { result-unbalanced } + \msg_error:nneee { regex } { result-unbalanced } { replacing } { \int_use:N \l_@@_added_begin_int } { \int_use:N \l_@@_added_end_int } } @@ -7337,7 +7337,7 @@ \cs_new_protected:Npn \@@_group_end_replace_try: { \tex_afterassignment:D \@@_group_end_replace_check:w - \__kernel_tl_gset:Nx \g_@@_internal_tl + \__kernel_tl_gset:Ne \g_@@_internal_tl { \prg_replicate:nn { \l_@@_added_begin_int } { { \if_false: } \fi: } \l_@@_internal_a_tl @@ -7592,11 +7592,11 @@ % \cs{@@_replacement:n}, which as usual defines % \cs{@@_replacement_do_one_match:n} to insert the tokens from the % start of the match attempt to the beginning of the match, followed -% by the replacement text. The \cs{use:x} expands for instance the +% by the replacement text. The \cs{use:e} expands for instance the % trailing \cs{@@_query_range:nn} down to a sequence of % \cs{@@_reinsert_item:n} \Arg{tokens} where \meta{tokens} % \texttt{o}-expand to a single token that we want to insert. After -% \texttt{x}-expansion, \cs{use:x} does \cs{use:n}, so we have +% \texttt{e}-expansion, \cs{use:e} does \cs{use:n}, so we have % \cs{exp_after:wN} \cs{l_@@_peek_true_tl} \cs{exp:w} \ldots{} % \cs{exp_end:}. This is set up such as to obtain % \cs{l_@@_peek_true_tl} followed by the replaced tokens (possibly @@ -7615,7 +7615,7 @@ \cs_set_eq:NN \@@_replacement_exp_not:N \@@_peek_replacement_token:n \cs_set_eq:NN \@@_replacement_exp_not:V \@@_peek_replacement_var:N \exp_args:No \@@_replacement:n { \l_@@_replacement_tl } - \use:x + \use:e { \exp_not:n { \exp_after:wN \l_@@_peek_true_tl \exp:w } \@@_replacement_do_one_match:n @@ -7736,7 +7736,7 @@ % % Messages for the preparsing phase. % \begin{macrocode} -\use:x +\use:e { \msg_new:nnn { regex } { trailing-backslash } { Trailing~'\iow_char:N\\'~in~regex~or~replacement. } @@ -8107,20 +8107,20 @@ % be merged. % % \begin{macro} -% {\@@_trace_push:nnN, \@@_trace_pop:nnN, \@@_trace:nnx} +% {\@@_trace_push:nnN, \@@_trace_pop:nnN, \@@_trace:nne} % Here |#1| is the module name (\texttt{regex}) and |#2| is % typically~1. If the module's current tracing level is less than % |#2| show nothing, otherwise write |#3| to the terminal. % \begin{macrocode} \cs_new_protected:Npn \@@_trace_push:nnN #1#2#3 - { \@@_trace:nnx {#1} {#2} { entering~ \token_to_str:N #3 } } + { \@@_trace:nne {#1} {#2} { entering~ \token_to_str:N #3 } } \cs_new_protected:Npn \@@_trace_pop:nnN #1#2#3 - { \@@_trace:nnx {#1} {#2} { leaving~ \token_to_str:N #3 } } -\cs_new_protected:Npn \@@_trace:nnx #1#2#3 + { \@@_trace:nne {#1} {#2} { leaving~ \token_to_str:N #3 } } +\cs_new_protected:Npn \@@_trace:nne #1#2#3 { \int_compare:nNnF { \int_use:c { g_@@_trace_#1_int } } < {#2} - { \iow_term:x { Trace:~#3 } } + { \iow_term:e { Trace:~#3 } } } % \end{macrocode} % \end{macro} @@ -8143,7 +8143,7 @@ \l_@@_min_state_int { \l_@@_max_state_int - 1 } { - \@@_trace:nnx { regex } {#1} + \@@_trace:nne { regex } {#1} { \iow_char:N \\toks ##1 = { \@@_toks_use:w ##1 } } } } |