diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3token.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3token.dtx | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3token.dtx b/Master/texmf-dist/source/latex/expl3/l3token.dtx index 3c283052e6f..6c48ab422d4 100644 --- a/Master/texmf-dist/source/latex/expl3/l3token.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3token.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3token.dtx 1550 2009-09-22 06:06:25Z joseph $ +\GetIdInfo$Id: l3token.dtx 1857 2010-03-21 21:32:09Z joseph $ {L3 Experimental token investigation and manipulation} %\iffalse %<*driver> @@ -773,7 +773,7 @@ % \char_show_value_catcode:n } % \begin{macrocode} \cs_new_eq:NN \char_set_catcode:w \tex_catcode:D -\cs_new_nopar:Npn \char_set_catcode:nn #1#2 { +\cs_new_protected_nopar:Npn \char_set_catcode:nn #1#2 { \char_set_catcode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_nopar:Npn \char_value_catcode:w { \int_use:N \tex_catcode:D } @@ -798,22 +798,22 @@ % \char_make_other:N , \char_make_active:N , % \char_make_comment:N , \char_make_invalid:N } % \begin{macrocode} -\cs_new_nopar:Npn \char_make_escape:N #1 { \char_set_catcode:nn {`#1} {\c_zero} } -\cs_new_nopar:Npn \char_make_begin_group:N #1 { \char_set_catcode:nn {`#1} {\c_one} } -\cs_new_nopar:Npn \char_make_end_group:N #1 { \char_set_catcode:nn {`#1} {\c_two} } -\cs_new_nopar:Npn \char_make_math_shift:N #1 { \char_set_catcode:nn {`#1} {\c_three} } -\cs_new_nopar:Npn \char_make_alignment:N #1 { \char_set_catcode:nn {`#1} {\c_four} } -\cs_new_nopar:Npn \char_make_end_line:N #1 { \char_set_catcode:nn {`#1} {\c_five} } -\cs_new_nopar:Npn \char_make_parameter:N #1 { \char_set_catcode:nn {`#1} {\c_six} } -\cs_new_nopar:Npn \char_make_math_superscript:N #1 { \char_set_catcode:nn {`#1} {\c_seven} } -\cs_new_nopar:Npn \char_make_math_subscript:N #1 { \char_set_catcode:nn {`#1} {\c_eight} } -\cs_new_nopar:Npn \char_make_ignore:N #1 { \char_set_catcode:nn {`#1} {\c_nine} } -\cs_new_nopar:Npn \char_make_space:N #1 { \char_set_catcode:nn {`#1} {\c_ten} } -\cs_new_nopar:Npn \char_make_letter:N #1 { \char_set_catcode:nn {`#1} {\c_eleven} } -\cs_new_nopar:Npn \char_make_other:N #1 { \char_set_catcode:nn {`#1} {\c_twelve} } -\cs_new_nopar:Npn \char_make_active:N #1 { \char_set_catcode:nn {`#1} {\c_thirteen} } -\cs_new_nopar:Npn \char_make_comment:N #1 { \char_set_catcode:nn {`#1} {\c_fourteen} } -\cs_new_nopar:Npn \char_make_invalid:N #1 { \char_set_catcode:nn {`#1} {\c_fifteen} } +\cs_new_protected_nopar:Npn \char_make_escape:N #1 { \char_set_catcode:nn {`#1} {\c_zero} } +\cs_new_protected_nopar:Npn \char_make_begin_group:N #1 { \char_set_catcode:nn {`#1} {\c_one} } +\cs_new_protected_nopar:Npn \char_make_end_group:N #1 { \char_set_catcode:nn {`#1} {\c_two} } +\cs_new_protected_nopar:Npn \char_make_math_shift:N #1 { \char_set_catcode:nn {`#1} {\c_three} } +\cs_new_protected_nopar:Npn \char_make_alignment:N #1 { \char_set_catcode:nn {`#1} {\c_four} } +\cs_new_protected_nopar:Npn \char_make_end_line:N #1 { \char_set_catcode:nn {`#1} {\c_five} } +\cs_new_protected_nopar:Npn \char_make_parameter:N #1 { \char_set_catcode:nn {`#1} {\c_six} } +\cs_new_protected_nopar:Npn \char_make_math_superscript:N #1 { \char_set_catcode:nn {`#1} {\c_seven} } +\cs_new_protected_nopar:Npn \char_make_math_subscript:N #1 { \char_set_catcode:nn {`#1} {\c_eight} } +\cs_new_protected_nopar:Npn \char_make_ignore:N #1 { \char_set_catcode:nn {`#1} {\c_nine} } +\cs_new_protected_nopar:Npn \char_make_space:N #1 { \char_set_catcode:nn {`#1} {\c_ten} } +\cs_new_protected_nopar:Npn \char_make_letter:N #1 { \char_set_catcode:nn {`#1} {\c_eleven} } +\cs_new_protected_nopar:Npn \char_make_other:N #1 { \char_set_catcode:nn {`#1} {\c_twelve} } +\cs_new_protected_nopar:Npn \char_make_active:N #1 { \char_set_catcode:nn {`#1} {\c_thirteen} } +\cs_new_protected_nopar:Npn \char_make_comment:N #1 { \char_set_catcode:nn {`#1} {\c_fourteen} } +\cs_new_protected_nopar:Npn \char_make_invalid:N #1 { \char_set_catcode:nn {`#1} {\c_fifteen} } % \end{macrocode} % \end{macro} % @@ -826,22 +826,22 @@ % \char_make_other:n , \char_make_active:n , % \char_make_comment:n , \char_make_invalid:n } % \begin{macrocode} -\cs_new_nopar:Npn \char_make_escape:n #1 { \char_set_catcode:nn {#1} {\c_zero} } -\cs_new_nopar:Npn \char_make_begin_group:n #1 { \char_set_catcode:nn {#1} {\c_one} } -\cs_new_nopar:Npn \char_make_end_group:n #1 { \char_set_catcode:nn {#1} {\c_two} } -\cs_new_nopar:Npn \char_make_math_shift:n #1 { \char_set_catcode:nn {#1} {\c_three} } -\cs_new_nopar:Npn \char_make_alignment:n #1 { \char_set_catcode:nn {#1} {\c_four} } -\cs_new_nopar:Npn \char_make_end_line:n #1 { \char_set_catcode:nn {#1} {\c_five} } -\cs_new_nopar:Npn \char_make_parameter:n #1 { \char_set_catcode:nn {#1} {\c_six} } -\cs_new_nopar:Npn \char_make_math_superscript:n #1 { \char_set_catcode:nn {#1} {\c_seven} } -\cs_new_nopar:Npn \char_make_math_subscript:n #1 { \char_set_catcode:nn {#1} {\c_eight} } -\cs_new_nopar:Npn \char_make_ignore:n #1 { \char_set_catcode:nn {#1} {\c_nine} } -\cs_new_nopar:Npn \char_make_space:n #1 { \char_set_catcode:nn {#1} {\c_ten} } -\cs_new_nopar:Npn \char_make_letter:n #1 { \char_set_catcode:nn {#1} {\c_eleven} } -\cs_new_nopar:Npn \char_make_other:n #1 { \char_set_catcode:nn {#1} {\c_twelve} } -\cs_new_nopar:Npn \char_make_active:n #1 { \char_set_catcode:nn {#1} {\c_thirteen} } -\cs_new_nopar:Npn \char_make_comment:n #1 { \char_set_catcode:nn {#1} {\c_fourteen} } -\cs_new_nopar:Npn \char_make_invalid:n #1 { \char_set_catcode:nn {#1} {\c_fifteen} } +\cs_new_protected_nopar:Npn \char_make_escape:n #1 { \char_set_catcode:nn {#1} {\c_zero} } +\cs_new_protected_nopar:Npn \char_make_begin_group:n #1 { \char_set_catcode:nn {#1} {\c_one} } +\cs_new_protected_nopar:Npn \char_make_end_group:n #1 { \char_set_catcode:nn {#1} {\c_two} } +\cs_new_protected_nopar:Npn \char_make_math_shift:n #1 { \char_set_catcode:nn {#1} {\c_three} } +\cs_new_protected_nopar:Npn \char_make_alignment:n #1 { \char_set_catcode:nn {#1} {\c_four} } +\cs_new_protected_nopar:Npn \char_make_end_line:n #1 { \char_set_catcode:nn {#1} {\c_five} } +\cs_new_protected_nopar:Npn \char_make_parameter:n #1 { \char_set_catcode:nn {#1} {\c_six} } +\cs_new_protected_nopar:Npn \char_make_math_superscript:n #1 { \char_set_catcode:nn {#1} {\c_seven} } +\cs_new_protected_nopar:Npn \char_make_math_subscript:n #1 { \char_set_catcode:nn {#1} {\c_eight} } +\cs_new_protected_nopar:Npn \char_make_ignore:n #1 { \char_set_catcode:nn {#1} {\c_nine} } +\cs_new_protected_nopar:Npn \char_make_space:n #1 { \char_set_catcode:nn {#1} {\c_ten} } +\cs_new_protected_nopar:Npn \char_make_letter:n #1 { \char_set_catcode:nn {#1} {\c_eleven} } +\cs_new_protected_nopar:Npn \char_make_other:n #1 { \char_set_catcode:nn {#1} {\c_twelve} } +\cs_new_protected_nopar:Npn \char_make_active:n #1 { \char_set_catcode:nn {#1} {\c_thirteen} } +\cs_new_protected_nopar:Npn \char_make_comment:n #1 { \char_set_catcode:nn {#1} {\c_fourteen} } +\cs_new_protected_nopar:Npn \char_make_invalid:n #1 { \char_set_catcode:nn {#1} {\c_fifteen} } % \end{macrocode} % \end{macro} % @@ -856,11 +856,11 @@ % Math codes. % \begin{macrocode} \cs_new_eq:NN \char_set_mathcode:w \tex_mathcode:D -\cs_new_nopar:Npn \char_set_mathcode:nn #1#2 { +\cs_new_protected_nopar:Npn \char_set_mathcode:nn #1#2 { \char_set_mathcode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_protected_nopar:Npn \char_gset_mathcode:w { \pref_global:D \tex_mathcode:D } -\cs_new_nopar:Npn \char_gset_mathcode:nn #1#2 { +\cs_new_protected_nopar:Npn \char_gset_mathcode:nn #1#2 { \char_gset_mathcode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_nopar:Npn \char_value_mathcode:w { \int_use:N \tex_mathcode:D } @@ -879,7 +879,7 @@ % \char_show_value_lccode:w, \char_show_value_lccode:n} % \begin{macrocode} \cs_new_eq:NN \char_set_lccode:w \tex_lccode:D -\cs_new_nopar:Npn \char_set_lccode:nn #1#2{ +\cs_new_protected_nopar:Npn \char_set_lccode:nn #1#2{ \char_set_lccode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_nopar:Npn \char_value_lccode:w {\int_use:N\tex_lccode:D} @@ -896,7 +896,7 @@ % \char_show_value_uccode:w, \char_show_value_uccode:n } % \begin{macrocode} \cs_new_eq:NN \char_set_uccode:w \tex_uccode:D -\cs_new_nopar:Npn \char_set_uccode:nn #1#2{ +\cs_new_protected_nopar:Npn \char_set_uccode:nn #1#2{ \char_set_uccode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_nopar:Npn \char_value_uccode:w {\int_use:N\tex_uccode:D} @@ -913,7 +913,7 @@ % \char_show_value_sfcode:w, \char_show_value_sfcode:n} % \begin{macrocode} \cs_new_eq:NN \char_set_sfcode:w \tex_sfcode:D -\cs_new_nopar:Npn \char_set_sfcode:nn #1#2 { +\cs_new_protected_nopar:Npn \char_set_sfcode:nn #1#2 { \char_set_sfcode:w #1 = \intexpr_eval:w #2\intexpr_eval_end: } \cs_new_nopar:Npn \char_value_sfcode:w { \int_use:N \tex_sfcode:D } @@ -933,7 +933,7 @@ % Creates a new token. (Will: why can't this just be % "\cs_new_eq:NN \token_new:Nn \cs_gnew_eq:NN"? Seriously, that doesn't work!) % \begin{macrocode} -\cs_new_nopar:Npn \token_new:Nn #1#2 {\cs_gnew_eq:NN #1#2} +\cs_new_protected_nopar:Npn \token_new:Nn #1#2 {\cs_gnew_eq:NN #1#2} % \end{macrocode} % \end{macro} % @@ -1513,8 +1513,8 @@ % input stream which |\l_peek_token| is set equal to. % |\peek_gafter:NN| does the same globally to |\g_peek_token|. % \begin{macrocode} -\cs_new_nopar:Npn \peek_after:NN {\tex_futurelet:D \l_peek_token } -\cs_new_nopar:Npn \peek_gafter:NN { +\cs_new_protected_nopar:Npn \peek_after:NN {\tex_futurelet:D \l_peek_token } +\cs_new_protected_nopar:Npn \peek_gafter:NN { \pref_global:D \tex_futurelet:D \g_peek_token } % \end{macrocode} @@ -1554,8 +1554,8 @@ % Two dedicated token list variables that store the true and false % cases. % \begin{macrocode} -\tl_new:Nn \l_peek_true_tl {} -\tl_new:Nn \l_peek_false_tl {} +\tl_new:N \l_peek_true_tl +\tl_new:N \l_peek_false_tl % \end{macrocode} % \end{macro} % \end{macro} @@ -1572,7 +1572,7 @@ % We also use this token list variable for storing the token we want % to compare. This turns out to be useful. % \begin{macrocode} -\tl_new:Nn \l_peek_search_tl {} +\tl_new:N \l_peek_search_tl % \end{macrocode} % \end{macro} % @@ -1582,18 +1582,18 @@ % \item the special token we're looking for. % \end{arguments} % \begin{macrocode} -\cs_new: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} - \tl_set:Nx \l_peek_true_tl {\exp_not:n{\group_align_safe_end: #3}} - \tl_set:Nx \l_peek_false_tl {\exp_not:n{\group_align_safe_end: #4}} + \tl_set:Nn \l_peek_true_tl { \group_align_safe_end: #3 } + \tl_set:Nn \l_peek_false_tl { \group_align_safe_end: #4 } \group_align_safe_begin: \peek_after:NN #1 } -\cs_new:Npn \peek_token_generic:NNT #1#2#3 { +\cs_new_protected:Npn \peek_token_generic:NNT #1#2#3 { \peek_token_generic:NNTF #1#2 {#3} {} } -\cs_new:Npn \peek_token_generic:NNF #1#2#3 { +\cs_new_protected:Npn \peek_token_generic:NNF #1#2#3 { \peek_token_generic:NNTF #1#2 {} {#3} } % \end{macrocode} @@ -1604,12 +1604,12 @@ % stream we might as well do it the same way for all characters so % we define this as little differently from above. % \begin{macrocode} -\cs_new:Npn \peek_token_remove_generic:NNTF #1#2#3#4 { +\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} - \tl_set:Nx \l_peek_true_aux_tl { \exp_not:n{ #3 } } + \tl_set:Nn \l_peek_true_aux_tl {#3} \tl_set_eq:NN \l_peek_true_tl \c_peek_true_remove_next_tl - \tl_set:Nx \l_peek_false_tl {\exp_not:n{\group_align_safe_end: #4}} + \tl_set:Nn \l_peek_false_tl {\group_align_safe_end: #4} \group_align_safe_begin: \peek_after:NN #1 } @@ -1627,8 +1627,8 @@ % Two token list variables to help with removing the character from % the input stream. % \begin{macrocode} -\tl_new:Nn \l_peek_true_aux_tl {} -\tl_new:Nn \c_peek_true_remove_next_tl {\group_align_safe_end: +\tl_new:N \l_peek_true_aux_tl +\tl_const:Nn \c_peek_true_remove_next_tl {\group_align_safe_end: \tex_afterassignment:D \l_peek_true_aux_tl \cs_set_eq:NN \peek_tmp:w } % \end{macrocode} @@ -1713,7 +1713,7 @@ \peek_def_aux_ii:nnnnn {#1} {#2} {#3} {#4} { T } \peek_def_aux_ii:nnnnn {#1} {#2} {#3} {#4} { F } } -\cs_new_nopar:Npn \peek_def_aux_ii:nnnnn #1#2#3#4#5 { +\cs_new_protected_nopar:Npn \peek_def_aux_ii: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 } @@ -1864,7 +1864,7 @@ \cs_new_nopar:Npn \peek_ignore_spaces_aux: { \peek_after:NN \peek_ignore_spaces_execute_branches: } -\cs_new_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_aux: \cs_set_eq:NN \peek_tmp:w |