diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-23 17:15:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-23 17:15:00 +0000 |
commit | 134349701bddf7cbbacf6030c6b9f9838aff96fa (patch) | |
tree | ec1140c46e1c0347a671a6fa3cf8af5a79e95f93 /Master/texmf-dist/tex/latex/l3kernel/l3token.sty | |
parent | f7855c12c18bb97b7b9e49ab685ee558d8c0b47b (diff) |
l3kernel 3990 (17jul12)
git-svn-id: svn://tug.org/texlive/trunk@27108 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3token.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3token.sty | 385 |
1 files changed, 176 insertions, 209 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty index cd05ac7b262..bac0b7a8832 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty @@ -46,17 +46,17 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3token.dtx 3491 2012-03-04 06:13:18Z bruno $ +\GetIdInfo$Id: l3token.dtx 3986 2012-07-15 19:23:51Z joseph $ {L3 Experimental token manipulation} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\package_check_loaded_expl: +\__expl_package_check: \cs_new_protected:Npn \char_set_catcode:nn #1#2 - { \tex_catcode:D #1 = \int_eval:w #2 \int_eval_end: } + { \tex_catcode:D #1 = \__int_eval:w #2 \__int_eval_end: } \cs_new:Npn \char_value_catcode:n #1 - { \tex_the:D \tex_catcode:D \int_eval:w #1\int_eval_end: } + { \tex_the:D \tex_catcode:D \__int_eval:w #1\__int_eval_end: } \cs_new_protected:Npn \char_show_value_catcode:n #1 - { \tex_showthe:D \tex_catcode:D \int_eval:w #1 \int_eval_end: } + { \tex_showthe:D \tex_catcode:D \__int_eval:w #1 \__int_eval_end: } \cs_new_protected:Npn \char_set_catcode_escape:N #1 { \char_set_catcode:nn { `#1 } \c_zero } \cs_new_protected:Npn \char_set_catcode_group_begin:N #1 @@ -122,29 +122,29 @@ \cs_new_protected:Npn \char_set_catcode_invalid:n #1 { \char_set_catcode:nn {#1} \c_fifteen } \cs_new_protected:Npn \char_set_mathcode:nn #1#2 - { \tex_mathcode:D #1 = \int_eval:w #2 \int_eval_end: } + { \tex_mathcode:D #1 = \__int_eval:w #2 \__int_eval_end: } \cs_new:Npn \char_value_mathcode:n #1 - { \tex_the:D \tex_mathcode:D \int_eval:w #1\int_eval_end: } + { \tex_the:D \tex_mathcode:D \__int_eval:w #1\__int_eval_end: } \cs_new_protected:Npn \char_show_value_mathcode:n #1 - { \tex_showthe:D \tex_mathcode:D \int_eval:w #1 \int_eval_end: } + { \tex_showthe:D \tex_mathcode:D \__int_eval:w #1 \__int_eval_end: } \cs_new_protected:Npn \char_set_lccode:nn #1#2 - { \tex_lccode:D #1 = \int_eval:w #2 \int_eval_end: } + { \tex_lccode:D #1 = \__int_eval:w #2 \__int_eval_end: } \cs_new:Npn \char_value_lccode:n #1 - { \tex_the:D \tex_lccode:D \int_eval:w #1\int_eval_end: } + { \tex_the:D \tex_lccode:D \__int_eval:w #1\__int_eval_end: } \cs_new_protected:Npn \char_show_value_lccode:n #1 - { \tex_showthe:D \tex_lccode:D \int_eval:w #1 \int_eval_end: } + { \tex_showthe:D \tex_lccode:D \__int_eval:w #1 \__int_eval_end: } \cs_new_protected:Npn \char_set_uccode:nn #1#2 - { \tex_uccode:D #1 = \int_eval:w #2 \int_eval_end: } + { \tex_uccode:D #1 = \__int_eval:w #2 \__int_eval_end: } \cs_new:Npn \char_value_uccode:n #1 - { \tex_the:D \tex_uccode:D \int_eval:w #1\int_eval_end: } + { \tex_the:D \tex_uccode:D \__int_eval:w #1\__int_eval_end: } \cs_new_protected:Npn \char_show_value_uccode:n #1 - { \tex_showthe:D \tex_uccode:D \int_eval:w #1 \int_eval_end: } + { \tex_showthe:D \tex_uccode:D \__int_eval:w #1 \__int_eval_end: } \cs_new_protected:Npn \char_set_sfcode:nn #1#2 - { \tex_sfcode:D #1 = \int_eval:w #2 \int_eval_end: } + { \tex_sfcode:D #1 = \__int_eval:w #2 \__int_eval_end: } \cs_new:Npn \char_value_sfcode:n #1 - { \tex_the:D \tex_sfcode:D \int_eval:w #1\int_eval_end: } + { \tex_the:D \tex_sfcode:D \__int_eval:w #1\__int_eval_end: } \cs_new_protected:Npn \char_show_value_sfcode:n #1 - { \tex_showthe:D \tex_sfcode:D \int_eval:w #1 \int_eval_end: } + { \tex_showthe:D \tex_sfcode:D \__int_eval:w #1 \__int_eval_end: } \cs_new_protected:Npn \token_new:Nn #1#2 { \cs_new_eq:NN #1 #2 } \cs_new_eq:NN \c_group_begin_token { \cs_new_eq:NN \c_group_end_token } @@ -178,13 +178,13 @@ \use:nn { \group_end: - \seq_set_from_clist:Nn \l_char_active_seq + \seq_set_split:Nnn \l_char_active_seq { } } } - { { " , $ , & , ^ , _ , ~ } } %$ + { { " $ & ^ _ ~ } } %$ \seq_new:N \l_char_special_seq -\seq_set_from_clist:Nn \l_char_special_seq - { \ , \" , \# , \$ , \% , \& , \\ , \^ , \_ , \{ , \} , \~ } +\seq_set_split:Nnn \l_char_special_seq { } + { \ \" \# \$ \% \& \\ \^ \_ \{ \} \~ } \prg_new_conditional:Npnn \token_if_group_begin:N #1 { p , T , F , TF } { \if_catcode:w \exp_not:N #1 \c_group_begin_token @@ -269,10 +269,10 @@ \group_end: \prg_new_conditional:Npnn \token_if_macro:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_macro_p_aux:w + \exp_after:wN \__token_if_macro_p:w \token_to_meaning:N #1 MA; \q_stop } - \cs_new:Npn \token_if_macro_p_aux:w #1 MA #2 ; #3 \q_stop + \cs_new:Npn \__token_if_macro_p:w #1 MA #2 ; #3 \q_stop { \if_int_compare:w \pdftex_strcmp:D { #2 } { cro } = \c_zero \prg_return_true: @@ -288,12 +288,15 @@ } \prg_new_conditional:Npnn \token_if_expandable:N #1 { p , T , F , TF } { - \cs_if_exist:NTF #1 - { - \exp_after:wN \if_meaning:w \exp_not:N #1 #1 - \prg_return_false: \else: \prg_return_true: \fi: - } - { \prg_return_false: } + \exp_after:wN \if_meaning:w \exp_not:N #1 #1 + \prg_return_false: + \else: + \if_cs_exist:N #1 + \prg_return_true: + \else: + \prg_return_false: + \fi: + \fi: } \group_begin: \char_set_lccode:nn { `T } { `T } @@ -308,23 +311,23 @@ \group_end: \prg_new_conditional:Npnn \token_if_chardef:N #1 { p , T , F , TF } { - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_chardef_aux:w + \exp_after:wN \__token_if_chardef:w \token_to_meaning:N #1 CHAR" \q_stop } { \token_to_str:N \char } } \prg_new_conditional:Npnn \token_if_mathchardef:N #1 { p , T , F , TF } { - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_chardef_aux:w + \exp_after:wN \__token_if_chardef:w \token_to_meaning:N #1 CHAR" \q_stop } { \token_to_str:N \mathchar } } - \cs_new:Npn \token_if_chardef_aux:w #1 CHAR" #2 \q_stop { #1 CHAR } + \cs_new:Npn \__token_if_chardef:w #1 CHAR" #2 \q_stop { #1 CHAR } \prg_new_conditional:Npnn \token_if_dim_register:N #1 { p , T , F , TF } { \if_meaning:w \tex_dimen:D #1 @@ -333,16 +336,16 @@ \if_meaning:w \tex_dimendef:D #1 \prg_return_false: \else: - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_dim_register_aux:w + \exp_after:wN \__token_if_dim_register:w \token_to_meaning:N #1 ZIMEX \q_stop } { \token_to_str:N \ } \fi: \fi: } - \cs_new:Npn \token_if_dim_register_aux:w #1 ZIMEX #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_dim_register:w #1 ZIMEX #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_int_register:N #1 { p , T , F , TF } { % \token_if_chardef:NTF #1 { \prg_return_true: } @@ -355,9 +358,9 @@ \if_meaning:w \tex_countdef:D #1 \prg_return_false: \else: - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_int_register_aux:w + \exp_after:wN \__token_if_int_register:w \token_to_meaning:N #1 COUXY \q_stop } { \token_to_str:N \ } @@ -366,7 +369,7 @@ % } % } } - \cs_new:Npn \token_if_int_register_aux:w #1 COUXY #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_int_register:w #1 COUXY #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_muskip_register:N #1 { p , T , F , TF } { \if_meaning:w \tex_muskip:D #1 @@ -375,16 +378,16 @@ \if_meaning:w \tex_muskipdef:D #1 \prg_return_false: \else: - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_muskip_register_aux:w + \exp_after:wN \__token_if_muskip_register:w \token_to_meaning:N #1 MUSKIP \q_stop } { \token_to_str:N \ } \fi: \fi: } - \cs_new:Npn \token_if_muskip_register_aux:w #1 MUSKIP #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_muskip_register:w #1 MUSKIP #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF } { \if_meaning:w \tex_skip:D #1 @@ -393,16 +396,16 @@ \if_meaning:w \tex_skipdef:D #1 \prg_return_false: \else: - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_skip_register_aux:w + \exp_after:wN \__token_if_skip_register:w \token_to_meaning:N #1 SKIP \q_stop } { \token_to_str:N \ } \fi: \fi: } - \cs_new:Npn \token_if_skip_register_aux:w #1 SKIP #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_skip_register:w #1 SKIP #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_toks_register:N #1 { p , T , F , TF } { \if_meaning:w \tex_toks:D #1 @@ -411,33 +414,33 @@ \if_meaning:w \tex_toksdef:D #1 \prg_return_false: \else: - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_toks_register_aux:w + \exp_after:wN \__token_if_toks_register:w \token_to_meaning:N #1 YOKS \q_stop } { \token_to_str:N \ } \fi: \fi: } - \cs_new:Npn \token_if_toks_register_aux:w #1 YOKS #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_toks_register:w #1 YOKS #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_protected_macro:N #1 { p , T , F , TF } { - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_protected_macro_aux:w + \exp_after:wN \__token_if_protected_macro:w \token_to_meaning:N #1 PROYECYEZ~MACRO \q_stop } { \token_to_str:N \ } } - \cs_new:Npn \token_if_protected_macro_aux:w + \cs_new:Npn \__token_if_protected_macro:w #1 PROYECYEZ~MACRO #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_long_macro:N #1 { p , T , F , TF } { - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_long_macro_aux:w + \exp_after:wN \__token_if_long_macro:w \token_to_meaning:N #1 LOXG~MACRO \q_stop } { \token_to_str:N \ } @@ -445,14 +448,14 @@ \prg_new_conditional:Npnn \token_if_protected_long_macro:N #1 { p , T , F , TF } { - \str_if_eq_return:xx + \__str_if_eq_x_return:nn { - \exp_after:wN \token_if_long_macro_aux:w + \exp_after:wN \__token_if_long_macro:w \token_to_meaning:N #1 LOXG~MACRO \q_stop } { \token_to_str:N \protected \token_to_str:N \ } } - \cs_new:Npn \token_if_long_macro_aux:w #1 LOXG~MACRO #2 \q_stop { #1 ~ } + \cs_new:Npn \__token_if_long_macro:w #1 LOXG~MACRO #2 \q_stop { #1 ~ } } \tex_chardef:D \c_token_A_int = `A ~ % \group_begin: @@ -467,19 +470,19 @@ \token_if_macro:NTF #1 \prg_return_false: { - \exp_after:wN \token_if_primitive_aux:NNw + \exp_after:wN \__token_if_primitive:NNw \token_to_meaning:N #1 ; ; ; \q_stop #1 } } - \cs_new:Npn \token_if_primitive_aux:NNw #1#2 #3 ; #4 \q_stop + \cs_new:Npn \__token_if_primitive:NNw #1#2 #3 ; #4 \q_stop { - \tl_if_empty:oTF { \token_if_primitive_aux_space:w #3 ~ } - { \token_if_primitive_aux_loop:N #3 ; \q_stop } - { \token_if_primitive_aux_nullfont:N } + \tl_if_empty:oTF { \__token_if_primitive_space:w #3 ~ } + { \__token_if_primitive_loop:N #3 ; \q_stop } + { \__token_if_primitive_nullfont:N } } } -\cs_new:Npn \token_if_primitive_aux_space:w #1 ~ { } -\cs_new:Npn \token_if_primitive_aux_nullfont:N #1 +\cs_new:Npn \__token_if_primitive_space:w #1 ~ { } +\cs_new:Npn \__token_if_primitive_nullfont:N #1 { \if_meaning:w \tex_nullfont:D #1 \prg_return_true: @@ -487,25 +490,25 @@ \prg_return_false: \fi: } -\cs_new:Npn \token_if_primitive_aux_loop:N #1 +\cs_new:Npn \__token_if_primitive_loop:N #1 { - \if_num:w `#1 < \c_token_A_int % - \exp_after:wN \token_if_primitive_auxii:Nw + \if_int_compare:w `#1 < \c_token_A_int % + \exp_after:wN \__token_if_primitive:Nw \exp_after:wN #1 \else: - \exp_after:wN \token_if_primitive_aux_loop:N + \exp_after:wN \__token_if_primitive_loop:N \fi: } -\cs_new:Npn \token_if_primitive_auxii:Nw #1 #2 \q_stop +\cs_new:Npn \__token_if_primitive:Nw #1 #2 \q_stop { \if:w : #1 - \exp_after:wN \token_if_primitive_aux_undefined:N + \exp_after:wN \__token_if_primitive_undefined:N \else: \prg_return_false: \exp_after:wN \use_none:n \fi: } -\cs_new:Npn \token_if_primitive_aux_undefined:N #1 +\cs_new:Npn \__token_if_primitive_undefined:N #1 { \if_cs_exist:N #1 \prg_return_true: @@ -515,32 +518,32 @@ } \cs_new_eq:NN \l_peek_token ? \cs_new_eq:NN \g_peek_token ? -\cs_new_eq:NN \l_peek_search_token ? -\tl_new:N \l_peek_search_tl -\cs_new_nopar:Npn \peek_true:w { } -\cs_new_nopar:Npn \peek_true_aux:w { } -\cs_new_nopar:Npn \peek_false:w { } -\cs_new:Npn \peek_tmp:w { } +\cs_new_eq:NN \l__peek_search_token ? +\tl_new:N \l__peek_search_tl +\cs_new_nopar:Npn \__peek_true:w { } +\cs_new_nopar:Npn \__peek_true_aux:w { } +\cs_new_nopar:Npn \__peek_false:w { } +\cs_new:Npn \__peek_tmp:w { } \cs_new_protected_nopar:Npn \peek_after:Nw { \tex_futurelet:D \l_peek_token } \cs_new_protected_nopar:Npn \peek_gafter:Nw { \tex_global:D \tex_futurelet:D \g_peek_token } -\cs_new_protected:Npn \peek_true_remove:w +\cs_new_protected:Npn \__peek_true_remove:w { \group_align_safe_end: - \tex_afterassignment:D \peek_true_aux:w - \cs_set_eq:NN \peek_tmp:w + \tex_afterassignment:D \__peek_true_aux:w + \cs_set_eq:NN \__peek_tmp:w } -\cs_new_protected:Npn \peek_token_generic:NNTF #1#2#3#4 +\cs_new_protected:Npn \__peek_token_generic:NNTF #1#2#3#4 { - \cs_set_eq:NN \l_peek_search_token #2 - \tl_set:Nn \l_peek_search_tl {#2} - \cs_set_nopar:Npx \peek_true:w + \cs_set_eq:NN \l__peek_search_token #2 + \tl_set:Nn \l__peek_search_tl {#2} + \cs_set_nopar:Npx \__peek_true:w { \exp_not:N \group_align_safe_end: \exp_not:n {#3} } - \cs_set_nopar:Npx \peek_false:w + \cs_set_nopar:Npx \__peek_false:w { \exp_not:N \group_align_safe_end: \exp_not:n {#4} @@ -548,17 +551,17 @@ \group_align_safe_begin: \peek_after:Nw #1 } -\cs_new_protected:Npn \peek_token_generic:NNT #1#2#3 - { \peek_token_generic:NNTF #1 #2 {#3} { } } -\cs_new_protected:Npn \peek_token_generic:NNF #1#2#3 - { \peek_token_generic:NNTF #1 #2 { } {#3} } -\cs_new_protected:Npn \peek_token_remove_generic:NNTF #1#2#3#4 - { - \cs_set_eq:NN \l_peek_search_token #2 - \tl_set:Nn \l_peek_search_tl {#2} - \cs_set_eq:NN \peek_true:w \peek_true_remove:w - \cs_set_nopar:Npx \peek_true_aux:w { \exp_not:n {#3} } - \cs_set_nopar:Npx \peek_false:w +\cs_new_protected:Npn \__peek_token_generic:NNT #1#2#3 + { \__peek_token_generic:NNTF #1 #2 {#3} { } } +\cs_new_protected:Npn \__peek_token_generic:NNF #1#2#3 + { \__peek_token_generic:NNTF #1 #2 { } {#3} } +\cs_new_protected:Npn \__peek_token_remove_generic:NNTF #1#2#3#4 + { + \cs_set_eq:NN \l__peek_search_token #2 + \tl_set:Nn \l__peek_search_tl {#2} + \cs_set_eq:NN \__peek_true:w \__peek_true_remove:w + \cs_set_nopar:Npx \__peek_true_aux:w { \exp_not:n {#3} } + \cs_set_nopar:Npx \__peek_false:w { \exp_not:N \group_align_safe_end: \exp_not:n {#4} @@ -566,28 +569,28 @@ \group_align_safe_begin: \peek_after:Nw #1 } -\cs_new_protected:Npn \peek_token_remove_generic:NNT #1#2#3 - { \peek_token_remove_generic:NNTF #1 #2 {#3} { } } -\cs_new_protected:Npn \peek_token_remove_generic:NNF #1#2#3 - { \peek_token_remove_generic:NNTF #1 #2 { } {#3} } -\cs_new_nopar:Npn \peek_execute_branches_catcode: +\cs_new_protected:Npn \__peek_token_remove_generic:NNT #1#2#3 + { \__peek_token_remove_generic:NNTF #1 #2 {#3} { } } +\cs_new_protected:Npn \__peek_token_remove_generic:NNF #1#2#3 + { \__peek_token_remove_generic:NNTF #1 #2 { } {#3} } +\cs_new_nopar:Npn \__peek_execute_branches_catcode: { \if_catcode:w - \exp_not:N \l_peek_token \exp_not:N \l_peek_search_token - \exp_after:wN \peek_true:w + \exp_not:N \l_peek_token \exp_not:N \l__peek_search_token + \exp_after:wN \__peek_true:w \else: - \exp_after:wN \peek_false:w + \exp_after:wN \__peek_false:w \fi: } -\cs_new_nopar:Npn \peek_execute_branches_meaning: +\cs_new_nopar:Npn \__peek_execute_branches_meaning: { - \if_meaning:w \l_peek_token \l_peek_search_token - \exp_after:wN \peek_true:w + \if_meaning:w \l_peek_token \l__peek_search_token + \exp_after:wN \__peek_true:w \else: - \exp_after:wN \peek_false:w + \exp_after:wN \__peek_false:w \fi: } -\cs_new_nopar:Npn \peek_execute_branches_charcode: +\cs_new_nopar:Npn \__peek_execute_branches_charcode: { \bool_if:nTF { @@ -595,107 +598,107 @@ || \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || \token_if_eq_meaning_p:NN \l_peek_token \c_space_token } - { \peek_false:w } + { \__peek_false:w } { - \exp_after:wN \peek_execute_branches_charcode_aux:NN - \l_peek_search_tl + \exp_after:wN \__peek_execute_branches_charcode_aux:NN + \l__peek_search_tl } } -\cs_new:Npn \peek_execute_branches_charcode_aux:NN #1#2 +\cs_new:Npn \__peek_execute_branches_charcode_aux:NN #1#2 { \if:w \exp_not:N #1 \exp_not:N #2 - \exp_after:wN \peek_true:w + \exp_after:wN \__peek_true:w \else: - \exp_after:wN \peek_false:w + \exp_after:wN \__peek_false:w \fi: #2 } -\cs_new_protected_nopar:Npn \peek_ignore_spaces_execute_branches: +\cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches: { \token_if_eq_meaning:NNTF \l_peek_token \c_space_token { - \tex_afterassignment:D \peek_ignore_spaces_execute_branches_aux: - \cs_set_eq:NN \peek_tmp:w + \tex_afterassignment:D \__peek_ignore_spaces_execute_branches_aux: + \cs_set_eq:NN \__peek_tmp:w } - { \peek_execute_branches: } + { \__peek_execute_branches: } } -\cs_new_protected_nopar:Npn \peek_ignore_spaces_execute_branches_aux: - { \peek_after:Nw \peek_ignore_spaces_execute_branches: } +\cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches_aux: + { \peek_after:Nw \__peek_ignore_spaces_execute_branches: } \group_begin: - \cs_set:Npn \peek_def:nnnn #1#2#3#4 + \cs_set:Npn \__peek_def:nnnn #1#2#3#4 { - \peek_def_aux:nnnnn {#1} {#2} {#3} {#4} { TF } - \peek_def_aux:nnnnn {#1} {#2} {#3} {#4} { T } - \peek_def_aux:nnnnn {#1} {#2} {#3} {#4} { F } + \__peek_def:nnnnn {#1} {#2} {#3} {#4} { TF } + \__peek_def:nnnnn {#1} {#2} {#3} {#4} { T } + \__peek_def:nnnnn {#1} {#2} {#3} {#4} { F } } - \cs_set:Npn \peek_def_aux:nnnnn #1#2#3#4#5 + \cs_set:Npn \__peek_def:nnnnn #1#2#3#4#5 { \cs_new_nopar:cpx { #1 #5 } { \tl_if_empty:nF {#2} - { \exp_not:n { \cs_set_eq:NN \peek_execute_branches: #2 } } + { \exp_not:n { \cs_set_eq:NN \__peek_execute_branches: #2 } } \exp_not:c { #3 #5 } \exp_not:n {#4} } } - \peek_def:nnnn { peek_catcode:N } + \__peek_def:nnnn { peek_catcode:N } { } - { peek_token_generic:NN } - { \peek_execute_branches_catcode: } - \peek_def:nnnn { peek_catcode_ignore_spaces:N } - { \peek_execute_branches_catcode: } - { peek_token_generic:NN } - { \peek_ignore_spaces_execute_branches: } - \peek_def:nnnn { peek_catcode_remove:N } + { __peek_token_generic:NN } + { \__peek_execute_branches_catcode: } + \__peek_def:nnnn { peek_catcode_ignore_spaces:N } + { \__peek_execute_branches_catcode: } + { __peek_token_generic:NN } + { \__peek_ignore_spaces_execute_branches: } + \__peek_def:nnnn { peek_catcode_remove:N } { } - { peek_token_remove_generic:NN } - { \peek_execute_branches_catcode: } - \peek_def:nnnn { peek_catcode_remove_ignore_spaces:N } - { \peek_execute_branches_catcode: } - { peek_token_remove_generic:NN } - { \peek_ignore_spaces_execute_branches: } - \peek_def:nnnn { peek_charcode:N } + { __peek_token_remove_generic:NN } + { \__peek_execute_branches_catcode: } + \__peek_def:nnnn { peek_catcode_remove_ignore_spaces:N } + { \__peek_execute_branches_catcode: } + { __peek_token_remove_generic:NN } + { \__peek_ignore_spaces_execute_branches: } + \__peek_def:nnnn { peek_charcode:N } { } - { peek_token_generic:NN } - { \peek_execute_branches_charcode: } - \peek_def:nnnn { peek_charcode_ignore_spaces:N } - { \peek_execute_branches_charcode: } - { peek_token_generic:NN } - { \peek_ignore_spaces_execute_branches: } - \peek_def:nnnn { peek_charcode_remove:N } + { __peek_token_generic:NN } + { \__peek_execute_branches_charcode: } + \__peek_def:nnnn { peek_charcode_ignore_spaces:N } + { \__peek_execute_branches_charcode: } + { __peek_token_generic:NN } + { \__peek_ignore_spaces_execute_branches: } + \__peek_def:nnnn { peek_charcode_remove:N } { } - { peek_token_remove_generic:NN } - { \peek_execute_branches_charcode: } - \peek_def:nnnn { peek_charcode_remove_ignore_spaces:N } - { \peek_execute_branches_charcode: } - { peek_token_remove_generic:NN } - { \peek_ignore_spaces_execute_branches: } - \peek_def:nnnn { peek_meaning:N } + { __peek_token_remove_generic:NN } + { \__peek_execute_branches_charcode: } + \__peek_def:nnnn { peek_charcode_remove_ignore_spaces:N } + { \__peek_execute_branches_charcode: } + { __peek_token_remove_generic:NN } + { \__peek_ignore_spaces_execute_branches: } + \__peek_def:nnnn { peek_meaning:N } { } - { peek_token_generic:NN } - { \peek_execute_branches_meaning: } - \peek_def:nnnn { peek_meaning_ignore_spaces:N } - { \peek_execute_branches_meaning: } - { peek_token_generic:NN } - { \peek_ignore_spaces_execute_branches: } - \peek_def:nnnn { peek_meaning_remove:N } + { __peek_token_generic:NN } + { \__peek_execute_branches_meaning: } + \__peek_def:nnnn { peek_meaning_ignore_spaces:N } + { \__peek_execute_branches_meaning: } + { __peek_token_generic:NN } + { \__peek_ignore_spaces_execute_branches: } + \__peek_def:nnnn { peek_meaning_remove:N } { } - { peek_token_remove_generic:NN } - { \peek_execute_branches_meaning: } - \peek_def:nnnn { peek_meaning_remove_ignore_spaces:N } - { \peek_execute_branches_meaning: } - { peek_token_remove_generic:NN } - { \peek_ignore_spaces_execute_branches: } + { __peek_token_remove_generic:NN } + { \__peek_execute_branches_meaning: } + \__peek_def:nnnn { peek_meaning_remove_ignore_spaces:N } + { \__peek_execute_branches_meaning: } + { __peek_token_remove_generic:NN } + { \__peek_ignore_spaces_execute_branches: } \group_end: \exp_args:Nno \use:nn - { \cs_new:Npn \token_get_prefix_arg_replacement_aux:wN #1 } + { \cs_new:Npn \__peek_get_prefix_arg_replacement:wN #1 } { \tl_to_str:n { macro : } #2 -> #3 \q_stop #4 } { #4 {#1} {#2} {#3} } \cs_new:Npn \token_get_prefix_spec:N #1 { \token_if_macro:NTF #1 { - \exp_after:wN \token_get_prefix_arg_replacement_aux:wN + \exp_after:wN \__peek_get_prefix_arg_replacement:wN \token_to_meaning:N #1 \q_stop \use_i:nnn } { \scan_stop: } @@ -704,7 +707,7 @@ { \token_if_macro:NTF #1 { - \exp_after:wN \token_get_prefix_arg_replacement_aux:wN + \exp_after:wN \__peek_get_prefix_arg_replacement:wN \token_to_meaning:N #1 \q_stop \use_ii:nnn } { \scan_stop: } @@ -713,47 +716,11 @@ { \token_if_macro:NTF #1 { - \exp_after:wN \token_get_prefix_arg_replacement_aux:wN + \exp_after:wN \__peek_get_prefix_arg_replacement:wN \token_to_meaning:N #1 \q_stop \use_iii:nnn } { \scan_stop: } } -\group_begin: - \char_set_catcode_active:N \^^@ - \cs_set:Npn \char_tmp:NN #1#2 - { - \cs_new:Npn #1 ##1 - { - \char_set_catcode_active:n { `##1 } - \group_begin: - \char_set_lccode:nn { `\^^@ } { `##1 } - \tl_to_lowercase:n { \group_end: #2 ^^@ } - } - } - \char_tmp:NN \char_set_active:Npn \cs_set:Npn - \char_tmp:NN \char_set_active:Npx \cs_set:Npx - \char_tmp:NN \char_gset_active:Npn \cs_gset:Npn - \char_tmp:NN \char_gset_active:Npx \cs_gset:Npx - \char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN - \char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN -\group_end: -\cs_new_protected_nopar:Npn \peek_execute_branches_N_type: - { - \bool_if:nTF - { - \token_if_eq_catcode_p:NN \l_peek_token \c_group_begin_token || - \token_if_eq_catcode_p:NN \l_peek_token \c_group_end_token || - \token_if_eq_meaning_p:NN \l_peek_token \c_space_token - } - { \peek_false:w } - { \peek_true:w } - } -\cs_new_protected_nopar:Npn \peek_N_type:TF - { \peek_token_generic:NNTF \peek_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:T - { \peek_token_generic:NNT \peek_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:F - { \peek_token_generic:NNF \peek_execute_branches_N_type: \scan_stop: } %% %% %% End of file `l3token.sty'. |