diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx index b6d28da057f..4ceef260a99 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx @@ -388,8 +388,8 @@ \group_begin: \group_align_safe_begin: \@@_setup:n {#1} - \@@_i:n {#1} - \@@_ii:n {#1} + \@@_a:n {#1} + \@@_b:n {#1} \group_align_safe_end: \group_end: } @@ -467,34 +467,34 @@ % \cs{str_tail:n} \Arg{token} is non-empty, because the % escape character is printable. % -% \begin{macro}[int]{\@@_i:n} +% \begin{macro}[int]{\@@_a:n} % We read tokens one by one using \tn{futurelet}. % While performing the loop, we keep track of the number of % true begin-group characters minus the number of % true end-group characters in \cs{l_@@_nesting_int}. % This reaches $-1$ when we read the closing brace. % \begin{macrocode} -\cs_new_protected:Npn \@@_i:n #1 +\cs_new_protected:Npn \@@_a:n #1 { \int_set:Nn \tex_escapechar:D { 92 } \int_zero:N \l_@@_normal_int \int_zero:N \l_@@_index_int \int_zero:N \l_@@_nesting_int - \if_false: { \fi: \@@_i_loop:w #1 } + \if_false: { \fi: \@@_a_loop:w #1 } \int_decr:N \l_@@_index_int } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_loop:w} +% \begin{macro}[int]{\@@_a_loop:w} % Read one character and check its type. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_loop:w - { \tex_futurelet:D \l_@@_token \@@_i_type:w } +\cs_new_protected_nopar:Npn \@@_a_loop:w + { \tex_futurelet:D \l_@@_token \@@_a_type:w } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_type:w} +% \begin{macro}[int]{\@@_a_type:w} % At this point, \cs{l_@@_token} holds the meaning % of the following token. We store in \cs{l_@@_type_int} % the meaning of the token ahead: @@ -511,7 +511,7 @@ % over \cs{l_@@_token} if it matches with one of the % character tokens (hence is not a primitive conditional). % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_type:w +\cs_new_protected_nopar:Npn \@@_a_type:w { \l_@@_type_int = \if_meaning:w \l_@@_token \c_space_token @@ -528,25 +528,25 @@ \fi: \fi: \if_case:w \l_@@_type_int - \exp_after:wN \@@_i_space:w - \or: \exp_after:wN \@@_i_bgroup:w - \or: \exp_after:wN \@@_i_safe:N - \else: \exp_after:wN \@@_i_egroup:w + \exp_after:wN \@@_a_space:w + \or: \exp_after:wN \@@_a_bgroup:w + \or: \exp_after:wN \@@_a_safe:N + \else: \exp_after:wN \@@_a_egroup:w \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_space:w} -% \begin{macro}[aux]{\@@_i_space_test:w} +% \begin{macro}[int]{\@@_a_space:w} +% \begin{macro}[aux]{\@@_a_space_test:w} % In this branch, the following token's meaning is a blank space. % Apply \tn{string} to that token: if it is a control sequence % the result starts with the escape character; otherwise it is % a true blank space, whose string representation is also a blank space. -% We test for that in \cs{@@_i_space_test:w}, +% We test for that in \cs{@@_a_space_test:w}, % after grabbing as \cs{l_@@_char_token} the first character % of the string representation. -% Also, since \cs{@@_i_store:} expects the special token to be +% Also, since \cs{@@_a_store:} expects the special token to be % stored in the relevant \tn{toks} register, we do that. The extra % \cs{exp_not:n} is unnecessary of course, but it makes the treatment % of all tokens more homogeneous. @@ -559,30 +559,30 @@ % so that the second pass does not need to test the meaning of tokens, % only strings. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_space:w +\cs_new_protected_nopar:Npn \@@_a_space:w { - \tex_afterassignment:D \@@_i_space_test:w + \tex_afterassignment:D \@@_a_space_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l_@@_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \@@_i_space_test:w +\cs_new_protected_nopar:Npn \@@_a_space_test:w { \if_meaning:w \l_@@_char_token \c_space_token \tex_toks:D \l_@@_index_int { \exp_not:n { ~ } } - \@@_i_store: + \@@_a_store: \else: \int_incr:N \l_@@_normal_int \fi: - \@@_i_loop:w + \@@_a_loop:w } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}[int]{\@@_i_bgroup:w, \@@_i_egroup:w} -% \begin{macro}[aux]{\@@_i_group:nw} -% \begin{macro}[aux]{\@@_i_group_test:w} +% \begin{macro}[int]{\@@_a_bgroup:w, \@@_a_egroup:w} +% \begin{macro}[aux]{\@@_a_group:nw} +% \begin{macro}[aux]{\@@_a_group_test:w} % The token might be either a true character token with % catcode $1$ or $2$, or it could be a control sequence. % The only tricky case is if the character code happens @@ -598,40 +598,40 @@ \group_begin: \char_set_catcode_group_begin:N \^^@ \char_set_catcode_group_end:N \^^E - \cs_new_protected_nopar:Npn \@@_i_bgroup:w - { \@@_i_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } + \cs_new_protected_nopar:Npn \@@_a_bgroup:w + { \@@_a_group:nw { \exp_after:wN ^^@ \if_false: ^^E \fi: } } \char_set_catcode_group_begin:N \^^B \char_set_catcode_group_end:N \^^@ - \cs_new_protected_nopar:Npn \@@_i_egroup:w - { \@@_i_group:nw { \if_false: ^^B \fi: ^^@ } } + \cs_new_protected_nopar:Npn \@@_a_egroup:w + { \@@_a_group:nw { \if_false: ^^B \fi: ^^@ } } \group_end: -\cs_new_protected:Npn \@@_i_group:nw #1 +\cs_new_protected:Npn \@@_a_group:nw #1 { \tex_lccode:D \c_zero = \@@_extract_charcode: \scan_stop: \tl_to_lowercase:n { \tex_toks:D \l_@@_index_int {#1} } \if_int_compare:w \tex_lccode:D \c_zero = \tex_escapechar:D \int_set:Nn \tex_escapechar:D { 139 - \tex_escapechar:D } \fi: - \tex_afterassignment:D \@@_i_group_test:w + \tex_afterassignment:D \@@_a_group_test:w \exp_after:wN \cs_set_eq:NN \exp_after:wN \l_@@_char_token \token_to_str:N } -\cs_new_protected_nopar:Npn \@@_i_group_test:w +\cs_new_protected_nopar:Npn \@@_a_group_test:w { \if_charcode:w \l_@@_token \l_@@_char_token - \@@_i_store: + \@@_a_store: \else: \int_incr:N \l_@@_normal_int \fi: - \@@_i_loop:w + \@@_a_loop:w } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % -% \begin{macro}[int]{\@@_i_store:} +% \begin{macro}[int]{\@@_a_store:} % This function is called each time we meet a special token; % at this point, the \tn{toks} register \cs{l_@@_index_int} % holds a token list which expands to the given special token. @@ -661,7 +661,7 @@ % Finally, we check whether we reached the last closing brace, in which % case we stop by disabling the looping function (locally). % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_i_store: +\cs_new_protected_nopar:Npn \@@_a_store: { \tex_advance:D \l_@@_nesting_int \l_@@_type_int \if_int_compare:w \tex_lccode:D \c_zero = \c_thirty_two @@ -672,14 +672,14 @@ \int_incr:N \l_@@_index_int \int_zero:N \l_@@_normal_int \if_int_compare:w \l_@@_nesting_int = \c_minus_one - \cs_set_eq:NN \@@_i_loop:w \scan_stop: + \cs_set_eq:NN \@@_a_loop:w \scan_stop: \fi: } % \end{macrocode} % \end{macro} % -% \begin{macro}[int]{\@@_i_safe:N} -% \begin{macro}[aux]{\@@_i_cs:ww} +% \begin{macro}[int]{\@@_a_safe:N} +% \begin{macro}[aux]{\@@_a_cs:ww} % This should be the simplest case: since the upcoming token is safe, % we can simply grab it in a second pass. However, other branches of % the code must pass their tokens through \tn{string}, hence we do it @@ -698,7 +698,7 @@ % all characters after the last space should be counted in the % following sequence of \enquote{normal} tokens. % \begin{macrocode} -\cs_new_protected:Npn \@@_i_safe:N #1 +\cs_new_protected:Npn \@@_a_safe:N #1 { \if_charcode:w \scan_stop: @@ -706,11 +706,11 @@ \scan_stop: \int_incr:N \l_@@_normal_int \else: - \@@_cs_space_count:NN \@@_i_cs:ww #1 + \@@_cs_space_count:NN \@@_a_cs:ww #1 \fi: - \@@_i_loop:w + \@@_a_loop:w } -\cs_new_protected:Npn \@@_i_cs:ww #1; #2; +\cs_new_protected:Npn \@@_a_cs:ww #1; #2; { \if_int_compare:w #1 > \c_zero \tex_skip:D \l_@@_index_int @@ -731,32 +731,32 @@ % All the necessary information is stored in \tn{skip} % and \tn{toks} registers. % -% \begin{macro}[int]{\@@_ii:n} -% \begin{macro}[int, EXP]{\@@_ii_loop:w} +% \begin{macro}[int]{\@@_b:n} +% \begin{macro}[int, EXP]{\@@_b_loop:w} % Start the loop with the index $0$. No need for an end-marker: % the loop will stop by itself when the last index is read. % We will repeatedly oscillate between reading long stretches % of normal tokens, and reading special tokens. % \begin{macrocode} -\cs_new_protected:Npn \@@_ii:n #1 +\cs_new_protected:Npn \@@_b:n #1 { \tl_gset:Nx \g_@@_result_tl { - \@@_ii_loop:w 0; #1 + \@@_b_loop:w 0; #1 \__prg_break_point: } } -\cs_new:Npn \@@_ii_loop:w #1; +\cs_new:Npn \@@_b_loop:w #1; { - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \__int_value:w \tex_skip:D #1 ; #1 ; } % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_normals:ww} -% \begin{macro}[aux, EXP]{\@@_ii_normal:wwN} +% \begin{macro}[int, EXP]{\@@_b_normals:ww} +% \begin{macro}[aux, EXP]{\@@_b_normal:wwN} % The first argument is the number of normal tokens which remain % to be read, and the second argument is the index in the array % produced in the first step. @@ -768,23 +768,23 @@ % rather than \cs{exp_not:N} because |#3| could be \cs{s__tl}, % hence must be hidden behind braces in the result. % \begin{macrocode} -\cs_new:Npn \@@_ii_normals:ww #1; +\cs_new:Npn \@@_b_normals:ww #1; { \if_int_compare:w #1 = \c_zero - \@@_ii_special:w + \@@_b_special:w \fi: - \@@_ii_normal:wwN #1; + \@@_b_normal:wwN #1; } -\cs_new:Npn \@@_ii_normal:wwN #1; #2; #3 +\cs_new:Npn \@@_b_normal:wwN #1; #2; #3 { \exp_not:n { \exp_not:n { #3 } } \s__tl \if_charcode:w \scan_stop: \exp_after:wN \use_none:n \token_to_str:N #3 \prg_do_nothing: \scan_stop: - \exp_after:wN \@@_ii_char:Nww + \exp_after:wN \@@_b_char:Nww \else: - \exp_after:wN \@@_ii_cs:Nww + \exp_after:wN \@@_b_cs:Nww \fi: #3 #1; #2; } @@ -792,10 +792,10 @@ % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_char:Nww} +% \begin{macro}[int, EXP]{\@@_b_char:Nww} % If the normal token we grab is a character, leave % \meta{catcode} \meta{charcode} followed by \cs{s__tl} -% in the input stream, and call \cs{@@_ii_normals:ww} +% in the input stream, and call \cs{@@_b_normals:ww} % with its first argument decremented. % \begin{macrocode} \group_begin: @@ -805,7 +805,7 @@ \char_set_uccode:nn { `? } { `D } \tl_to_uppercase:n { - \cs_new:Npn \@@_ii_char:Nww #1 + \cs_new:Npn \@@_b_char:Nww #1 { \if_meaning:w #1 \c_undefined:D ? \else: \if_catcode:w #1 \c_catcode_other_token C \else: @@ -818,7 +818,7 @@ 6 \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \__int_value:w `#1 \s__tl - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \int_use:N \__int_eval:w \c_minus_one + } } @@ -826,21 +826,21 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_cs:Nww} -% \begin{macro}[aux, EXP]{\@@_ii_cs_test:ww} +% \begin{macro}[int, EXP]{\@@_b_cs:Nww} +% \begin{macro}[aux, EXP]{\@@_b_cs_test:ww} % If the token we grab is a control sequence, leave % |0 -1| (as category code and character code) in the input stream, % followed by \cs{s__tl}, -% and call \cs{@@_ii_normals:ww} with updated arguments. +% and call \cs{@@_b_normals:ww} with updated arguments. % \begin{macrocode} -\cs_new:Npn \@@_ii_cs:Nww #1 +\cs_new:Npn \@@_b_cs:Nww #1 { 0 -1 \s__tl - \@@_cs_space_count:NN \@@_ii_cs_test:ww #1 + \@@_cs_space_count:NN \@@_b_cs_test:ww #1 } -\cs_new:Npn \@@_ii_cs_test:ww #1 ; #2 ; #3 ; #4 ; +\cs_new:Npn \@@_b_cs_test:ww #1 ; #2 ; #3 ; #4 ; { - \exp_after:wN \@@_ii_normals:ww + \exp_after:wN \@@_b_normals:ww \int_use:N \__int_eval:w \if_int_compare:w #1 = \c_zero #3 @@ -855,9 +855,9 @@ % \end{macro} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_ii_special:w} -% \begin{macro}[aux, EXP]{\@@_ii_special_char:wN} -% \begin{macro}[aux, EXP]{\@@_ii_special_space:w} +% \begin{macro}[int, EXP]{\@@_b_special:w} +% \begin{macro}[aux, EXP]{\@@_b_special_char:wN} +% \begin{macro}[aux, EXP]{\@@_b_special_space:w} % Here, |#1| is the current index in the array built in the first pass. % Check now whether we reached the end (we shouldn't keep the trailing % end-group character that marked the end of the token list in the @@ -865,12 +865,12 @@ % Unpack the \tn{toks} register: when \texttt{x}-expanding again, % we will get the special token. % Then leave the category code in the input stream, followed by -% the character code, and call \cs{@@_ii_loop:w} with the next index. +% the character code, and call \cs{@@_b_loop:w} with the next index. % \begin{macrocode} \group_begin: \char_set_catcode_other:N A - \cs_new:Npn \@@_ii_special:w - \fi: \@@_ii_normal:wwN 0 ; #1 ; + \cs_new:Npn \@@_b_special:w + \fi: \@@_b_normal:wwN 0 ; #1 ; { \fi: \if_int_compare:w #1 = \l_@@_index_int @@ -884,23 +884,23 @@ \else: 2 \fi: \if_int_odd:w \etex_gluestretch:D \tex_skip:D #1 \exp_stop_f: - \exp_after:wN \@@_ii_special_char:wN \int_use:N + \exp_after:wN \@@_b_special_char:wN \int_use:N \else: - \exp_after:wN \@@_ii_special_space:w \int_use:N + \exp_after:wN \@@_b_special_space:w \int_use:N \fi: \__int_eval:w \c_one + #1 \exp_after:wN ; \token_to_str:N } \group_end: -\cs_new:Npn \@@_ii_special_char:wN #1 ; #2 +\cs_new:Npn \@@_b_special_char:wN #1 ; #2 { \__int_value:w `#2 \s__tl - \@@_ii_loop:w #1 ; + \@@_b_loop:w #1 ; } -\cs_new:Npn \@@_ii_special_space:w #1 ; ~ +\cs_new:Npn \@@_b_special_space:w #1 ; ~ { 32 \s__tl - \@@_ii_loop:w #1 ; + \@@_b_loop:w #1 ; } % \end{macrocode} % \end{macro} |