diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3token.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3token.dtx | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index 586097d48a8..9699b2492eb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3token.dtx 5893 2015-08-26 16:16:52Z mittelba $ +\GetIdInfo$Id: l3token.dtx 6040 2015-09-23 12:41:32Z joseph $ {L3 Experimental token manipulation} %</driver|package> %<*driver> @@ -1049,7 +1049,7 @@ { \group_begin: \char_set_lccode:nn { 0 } {#1} - \tl_to_lowercase:n + \tex_lowercase:D { \group_end: \@@_set_catcode:Nn ^^@ } {#2} } \tex_catcode:D \c_zero = \c_thirteen @@ -1068,7 +1068,7 @@ { \group_begin: \char_set_lccode:nn { 0 } { `#1 } - \tl_to_lowercase:n + \tex_lowercase:D { \group_end: \seq_if_in:NnF \l_char_active_seq { ^^@ } @@ -1605,25 +1605,22 @@ % cannot contain |ma|, regardless of the escape character, even if % the escape character is |m|\ldots{} % -% Both |ma| and |:| must be of category code $12$ (other), and we -% achieve using the standard lowercasing technique. +% Both |ma| and |:| must be of category code $12$ (other), so are +% detokenized. % % \begin{macrocode} -\group_begin: -\char_set_catcode_other:N \M -\char_set_catcode_other:N \A -\char_set_lccode:nn { `\; } { `\: } -\char_set_lccode:nn { `\T } { `\T } -\char_set_lccode:nn { `\F } { `\F } -\tl_to_lowercase:n +\use:x { - \group_end: - \prg_new_conditional:Npnn \token_if_macro:N #1 { p , T , F , TF } + \prg_new_conditional:Npnn \exp_not:N \token_if_macro:N ##1 + { p , T , F , TF } { - \exp_after:wN \@@_if_macro_p:w - \token_to_meaning:N #1 MA; \q_stop + \exp_not:N \exp_after:wN \exp_not:N \@@_if_macro_p:w + \exp_not:N \token_to_meaning:N ##1 \tl_to_str:n { ma : } + \exp_not:N \q_stop } - \cs_new:Npn \@@_if_macro_p:w #1 MA #2 ; #3 \q_stop + \cs_new:Npn \exp_not:N \@@_if_macro_p:w + ##1 \tl_to_str:n { ma } ##2 \c_colon_str ##3 \exp_not:N \q_stop + } { \if_int_compare:w \__str_if_eq_x:nn { #2 } { cro } = \c_zero \prg_return_true: @@ -1631,7 +1628,6 @@ \prg_return_false: \fi: } - } % \end{macrocode} % \end{macro} % \end{macro} @@ -1710,7 +1706,7 @@ % We convert the token list to lower case and restore the catcode and % lowercase code changes. % \begin{macrocode} -\tl_to_lowercase:n +\tex_lowercase:D { \group_end: % \end{macrocode} @@ -1900,7 +1896,7 @@ } \cs_new:Npn \@@_if_long_macro:w #1 LOXG~MACRO #2 \q_stop { #1 ~ } % \end{macrocode} -% Finally the \cs{tl_to_lowercase:n} ends! +% Finally the \cs{tex_lowercase:D} ends! % \begin{macrocode} } % \end{macrocode} @@ -1959,30 +1955,32 @@ % is not a primitive. % % \begin{macrocode} -\tex_chardef:D \c_token_A_int = `A ~ % -\group_begin: -\char_set_catcode_other:N \; -\char_set_lccode:nn { `\; } { `\: } -\char_set_lccode:nn { `\T } { `\T } -\char_set_lccode:nn { `\F } { `\F } -\tl_to_lowercase:n { - \group_end: - \prg_new_conditional:Npnn \token_if_primitive:N #1 { p , T , F , TF } - { - \token_if_macro:NTF #1 - \prg_return_false: - { - \exp_after:wN \@@_if_primitive:NNw - \token_to_meaning:N #1 ; ; ; \q_stop #1 - } - } - \cs_new:Npn \@@_if_primitive:NNw #1#2 #3 ; #4 \q_stop - { - \tl_if_empty:oTF { \@@_if_primitive_space:w #3 ~ } - { \@@_if_primitive_loop:N #3 ; \q_stop } - { \@@_if_primitive_nullfont:N } - } -} +\tex_chardef:D \c_@@_A_int = `A ~ % +\use:x + { + \prg_new_conditional:Npnn \exp_not:N \token_if_primitive:N ##1 + { p , T , F , TF } + { + \exp_not:N \token_if_macro:NTF ##1 + \exp_not:N \prg_return_false: + { + \exp_not:N \exp_after:wN \exp_not:N \@@_if_primitive:NNw + \exp_not:N \token_to_meaning:N ##1 + \tl_to_str:n { : : : } \exp_not:N \q_stop ##1 + } + } + \cs_new:Npn \exp_not:N \@@_if_primitive:NNw + ##1##2 ##3 \c_colon_str ##4 \exp_not:N \q_stop + { + \exp_not:N \tl_if_empty:oTF + { \exp_not:N \@@_if_primitive_space:w ##3 ~ } + { + \exp_not:N \@@_if_primitive_loop:N ##3 + \c_colon_str \exp_not:N \q_stop + } + { \exp_not:N \@@_if_primitive_nullfont:N } + } + } \cs_new:Npn \@@_if_primitive_space:w #1 ~ { } \cs_new:Npn \@@_if_primitive_nullfont:N #1 { @@ -1994,7 +1992,7 @@ } \cs_new:Npn \@@_if_primitive_loop:N #1 { - \if_int_compare:w `#1 < \c_token_A_int % + \if_int_compare:w `#1 < \c_@@_A_int % \exp_after:wN \@@_if_primitive:Nw \exp_after:wN #1 \else: |