diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3token.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3token.sty | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty index a95678f3d6c..c4b3a28e6a5 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3token.dtx 4251 2012-11-01 16:30:06Z joseph $ +\GetIdInfo$Id: l3token.dtx 4384 2012-12-20 15:47:56Z bruno $ {L3 Experimental token manipulation} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -573,54 +573,56 @@ { \__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_nopar:Npn \__peek_execute_branches_meaning: { - \if_catcode:w - \exp_not:N \l_peek_token \exp_not:N \l__peek_search_token + \if_meaning:w \l_peek_token \l__peek_search_token \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: } -\cs_new_nopar:Npn \__peek_execute_branches_meaning: +\cs_new_nopar:Npn \__peek_execute_branches_catcode: + { \if_catcode:w \__peek_execute_branches_catcode_aux: } +\cs_new_nopar:Npn \__peek_execute_branches_charcode: + { \if_charcode:w \__peek_execute_branches_catcode_aux: } +\cs_new_nopar:Npn \__peek_execute_branches_catcode_aux: { - \if_meaning:w \l_peek_token \l__peek_search_token + \if_catcode:w \exp_not:N \l_peek_token \scan_stop: + \exp_after:wN \exp_after:wN + \exp_after:wN \__peek_execute_branches_catcode_auxii:N + \exp_after:wN \exp_not:N + \else: + \exp_after:wN \__peek_execute_branches_catcode_auxiii: + \fi: + } +\cs_new:Npn \__peek_execute_branches_catcode_auxii:N #1 + { + \exp_not:N #1 + \exp_after:wN \exp_not:N \l__peek_search_tl \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: + #1 } -\cs_new_nopar:Npn \__peek_execute_branches_charcode: +\cs_new_nopar:Npn \__peek_execute_branches_catcode_auxiii: { - \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 } - { - \exp_after:wN \__peek_execute_branches_charcode_aux:NN - \l__peek_search_tl - } - } -\cs_new:Npn \__peek_execute_branches_charcode_aux:NN #1#2 - { - \if:w \exp_not:N #1 \exp_not:N #2 + \exp_not:N \l_peek_token + \exp_after:wN \exp_not:N \l__peek_search_tl \exp_after:wN \__peek_true:w \else: \exp_after:wN \__peek_false:w \fi: - #2 } \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 - } - { \__peek_execute_branches: } + \if_meaning:w \l_peek_token \c_space_token + \tex_afterassignment:D \__peek_ignore_spaces_execute_branches_aux: + \exp_after:wN \cs_set_eq:NN + \exp_after:wN \__peek_tmp:w + \else: + \exp_after:wN \__peek_execute_branches: + \fi: } \cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches_aux: { \peek_after:Nw \__peek_ignore_spaces_execute_branches: } |