From 88ad42f78998b5210fa58a05e2e7750f897b2550 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 6 Feb 2012 01:22:10 +0000 Subject: l3kernel 3287 git-svn-id: svn://tug.org/texlive/trunk@25306 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 27 ++-- Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 6 +- Master/texmf-dist/tex/latex/l3kernel/l3file.sty | 69 ++++++++- Master/texmf-dist/tex/latex/l3kernel/l3int.sty | 2 +- Master/texmf-dist/tex/latex/l3kernel/l3io.sty | 41 +++++- Master/texmf-dist/tex/latex/l3kernel/l3prg.sty | 2 +- Master/texmf-dist/tex/latex/l3kernel/l3tl.sty | 14 +- Master/texmf-dist/tex/latex/l3kernel/l3token.sty | 174 ++++++++++++++++------- 8 files changed, 253 insertions(+), 82 deletions(-) (limited to 'Master/texmf-dist/tex/latex/l3kernel') diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 4c96696adb5..fd93024f965 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -59,23 +59,24 @@ } \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2012/01/19} -\def\ExplFileVersion{3209} +\def\ExplFileDate{2012/01/31} +\def\ExplFileVersion{3287} \RequirePackage{etex} \reserveinserts{32} -\RequirePackage{calc} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\newcommand* \l@expl@check@declarations@bool { 0 } -\newcommand* \l@expl@log@functions@bool { 0 } -\newcommand* \l@expl@native@drivers@bool { 0 } -\DeclareOption { check-declarations } - { \def \l@expl@check@declarations@bool { 1 } } -\DeclareOption { log-functions } - { \def \l@expl@log@functions@bool { 1 } } -\DeclareOption { native-drivers } - { \def \l@expl@native@drivers@bool { 1 } } +\newcommand \expl@create@bool@option [ 2 ] + { + \DeclareOption {#1} { \renewcommand* #2 { 1 } } + \DeclareOption { #1 = true } { \renewcommand* #2 { 1 } } + \DeclareOption { #1 = false } { \renewcommand* #2 { 0 } } + \newcommand* #2 { 0 } + } +\expl@create@bool@option { check-declarations } \l@expl@check@declarations@bool +\expl@create@bool@option { log-functions } \l@expl@log@functions@bool +\expl@create@bool@option { native-drivers } \l@expl@native@drivers@bool \ProcessOptions \relax +\let \expl@create@bool@option \@undefined \ifodd \l@expl@native@drivers@bool \relax \else \RequirePackage { color , graphics } @@ -265,6 +266,7 @@ \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } } \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } } \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } } + \char_set_catcode:nn { 36 } { \char_value_catcode:n { 36 } } \char_set_catcode:nn { 38 } { \char_value_catcode:n { 38 } } \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } } \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } } @@ -279,6 +281,7 @@ \char_set_catcode_ignore:n { 9 } % tab \char_set_catcode_ignore:n { 32 } % space \char_set_catcode_other:n { 34 } % double quote + \char_set_catcode_math_toggle:n { 36 } % dollar \char_set_catcode_alignment:n { 38 } % ampersand \char_set_catcode_letter:n { 58 } % colon \char_set_catcode_math_superscript:n { 94 } % circumflex diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index d27ec84831e..33821fa37f4 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -6,6 +6,7 @@ %% %% l3doc.dtx (with options: `class') %% +%% %% EXPERIMENTAL CODE %% %% Do not distribute this file without also distributing the @@ -13,6 +14,7 @@ %% %% Do not distribute a modified version of this file. %% +%% %% File: l3doc.dtx Copyright (C) 1990-2011 The LaTeX3 project %% %% It may be distributed and/or modified under the conditions of the @@ -45,12 +47,12 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{expl3,xparse} +\RequirePackage{expl3,xparse,calc} \let \filenameOld \ExplFileName \let \filedateOld \ExplFileDate \let \fileversionOld \ExplFileVersion \let \filedescriptionOld \ExplFileDescription -\GetIdInfo$Id: l3doc.dtx 2990 2011-11-23 02:32:59Z bruno $ +\GetIdInfo$Id: l3doc.dtx 3255 2012-01-28 20:31:12Z joseph $ {L3 Experimental documentation class} \ProvidesExplClass {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty index 2ae16bd987d..f79666e640a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3file.dtx 3158 2012-01-09 00:47:42Z bruno $ +\GetIdInfo$Id: l3file.dtx 3287 2012-01-31 22:08:14Z joseph $ {L3 Experimental file operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -60,14 +60,26 @@ \seq_new:N \l_file_internal_saved_path_seq \seq_new:N \l_file_internal_seq \ior_new:N \g_file_internal_ior -\cs_new_protected:Npn \file_add_path:nN #1#2 +\cs_new_protected:Npn \file_add_path:nN #1 { - \ior_open:Nn \g_file_internal_ior {#1} + \group_begin: + \tl_to_str_active_safe:Nx \l_file_internal_name_tl {#1} + \tl_if_in:NnT \l_file_internal_name_tl { ~ } + { + \msg_kernel_error:nnx { io } { space-in-file-name } + { \l_file_internal_name_tl } + } + \exp_args:NNo \group_end: + \file_add_path_aux:nN \l_file_internal_name_tl + } +\cs_new_protected:Npn \file_add_path_aux:nN #1#2 + { + \ior_open_unsafe:Nn \g_file_internal_ior {#1} \ior_if_eof:NTF \g_file_internal_ior { \file_add_path_search:nN {#1} #2 } { \ior_close:N \g_file_internal_ior - \tl_set:Nx #2 {#1} + \tl_set:Nn #2 {#1} } } \cs_new_protected:Npn \file_add_path_search:nN #1#2 @@ -82,7 +94,7 @@ } \seq_map_inline:Nn \l_file_search_path_seq { - \ior_open:Nn \g_file_internal_ior { ##1 #1 } + \ior_open_unsafe:Nn \g_file_internal_ior { ##1 #1 } \ior_if_eof:NF \g_file_internal_ior { \tl_set:Nx #2 { ##1 #1 } @@ -112,6 +124,53 @@ \seq_gpop:NN \g_file_stack_seq \g_file_current_name_tl } } +\cs_new_protected:Npn \file_split_path_name_ext:nNNN #1 + { + \group_begin: + \tl_to_str_active_safe:Nx \l_file_internal_name_tl {#1} + \tl_if_in:NnT \l_file_internal_name_tl { ~ } + { + \msg_kernel_error:nnx { io } { space-in-file-name } + { \l_file_internal_name_tl } + } + \exp_args:NNo \group_end: + \file_split_path_name_ext_aux:nNNN \l_file_internal_name_tl + } +\cs_new_protected:Npn \file_split_path_name_ext_aux:nNNN #1#2#3#4 + { + \tl_clear:N #2 + \tl_clear:N #3 + \file_split_path:wNNN #1 / \q_nil / \q_stop #2#3#4 + } +\cs_new_protected:Npn \file_split_path:wNNN #1 / #2 / #3 \q_stop #4 + { + \quark_if_nil:nTF {#2} + { \file_split_name_ext:wNN #1 . \q_nil . \q_stop } + { + \tl_put_right:Nn #4 { #1 / } + \file_split_path:wNNN #2 / #3 \q_stop #4 + } + } +\cs_new_protected:Npn \file_split_name_ext:wNN #1 . #2 . #3 \q_stop #4#5 + { + \quark_if_nil:nTF {#2} + { + \tl_if_empty:NTF #4 + { + \tl_set:Nn #4 {#1} + \tl_clear:N #5 + } + { \tl_set:Nn #5 {#1} } + } + { + \tl_put_right:Nx #4 + { + \tl_if_empty:NF #4 { . } + #1 + } + \file_split_name_ext:wNN #2 . #3 \q_stop #4#5 + } + } \cs_new_protected:Npn \file_path_include:n #1 { \seq_if_in:NnF \l_file_search_path_seq {#1} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty index 9f85bb04e58..492cc028025 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3int.dtx 3139 2012-01-07 19:53:09Z bruno $ +\GetIdInfo$Id: l3int.dtx 3216 2012-01-21 04:03:53Z bruno $ {L3 Experimental integers} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty index 16312914578..47f29f44e8a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3io.dtx 3160 2012-01-09 02:33:23Z bruno $ +\GetIdInfo$Id: l3io.dtx 3245 2012-01-28 02:58:37Z bruno $ {L3 Experimental input-output operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -81,6 +81,8 @@ \prop_put:Nnn \g_iow_streams_prop { 1 } { LaTeX2e~reserved } \prop_put:Nnn \g_iow_streams_prop { 2 } { LaTeX2e~reserved } \prop_put:Nnn \g_ior_streams_prop { 0 } { LaTeX2e~reserved } +\tl_new:N \l_ior_internal_tl +\tl_new:N \l_iow_internal_tl \int_new:N \l_iow_stream_int \cs_new_eq:NN \l_ior_stream_int \l_iow_stream_int \cs_set_eq:NN \iow_raw_new:N \newwrite @@ -92,6 +94,32 @@ \cs_new_protected:Npn \iow_new:N #1 { \cs_new_eq:NN #1 \c_term_iow } \cs_generate_variant:Nn \iow_new:N { c } \cs_new_protected:Npn \ior_open:Nn #1#2 + { + \group_begin: + \tl_to_str_active_safe:Nx \l_ior_internal_tl {#2} + \tl_if_in:NnT \l_ior_internal_tl { ~ } + { + \msg_kernel_error:nnx { io } { space-in-file-name } + { \l_ior_internal_tl } + } + \exp_args:NNNo \group_end: + \ior_open_unsafe:Nn #1 \l_ior_internal_tl + } +\cs_generate_variant:Nn \ior_open:Nn { c } +\cs_new_protected:Npn \iow_open:Nn #1#2 + { + \group_begin: + \tl_to_str_active_safe:Nx \l_iow_internal_tl {#2} + \tl_if_in:NnT \l_iow_internal_tl { ~ } + { + \msg_kernel_error:nnx { io } { space-in-file-name } + { \l_iow_internal_tl } + } + \exp_args:NNNo \group_end: + \iow_open_unsafe:Nn #1 \l_iow_internal_tl + } +\cs_generate_variant:Nn \iow_open:Nn { c } +\cs_new_protected:Npn \ior_open_unsafe:Nn #1#2 { \ior_close:N #1 \int_set:Nn \l_ior_stream_int \c_sixteen @@ -104,7 +132,7 @@ \tex_openin:D #1#2 \scan_stop: } } -\cs_new_protected:Npn \iow_open:Nn #1#2 +\cs_new_protected:Npn \iow_open_unsafe:Nn #1#2 { \iow_close:N #1 \int_set:Nn \l_iow_stream_int \c_sixteen @@ -117,8 +145,6 @@ \tex_immediate:D \tex_openout:D #1#2 \scan_stop: } } -\cs_generate_variant:Nn \ior_open:Nn { c } -\cs_generate_variant:Nn \iow_open:Nn { c } \cs_new_protected:Npn \iow_alloc_write:n #1 { \prop_if_in:NnF \g_iow_streams_prop {#1} @@ -464,7 +490,6 @@ { \etex_readline:D #1 to #2 } \cs_new_protected:Npn \ior_str_gto:NN #1#2 { \tex_global:D \etex_readline:D #1 to #2 } -\tl_new:N \l_ior_internal_tl \cs_new_protected_nopar:Npn \ior_map_inline:nn { \ior_map_inline_aux:Nnn \ior_to:NN } \cs_new_protected_nopar:Npn \ior_str_map_inline:nn @@ -497,6 +522,12 @@ \ior_map_inline_loop:NNN #1#2#3 } } +\msg_kernel_new:nnnn { io } { space-in-file-name } + { Space~in~file~name~'#1'. } + { + Spaces~are~not~permitted~in~files~loaded~by~LaTeX: \\ + Further~errors~may~follow! + } %% %% %% End of file `l3io.sty'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty index c0dc6c71502..8689a2970f1 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3prg.dtx 3122 2011-12-31 20:57:36Z joseph $ +\GetIdInfo$Id: l3prg.dtx 3250 2012-01-28 04:54:49Z bruno $ {L3 Experimental control structures} %% \ProvidesExplPackage diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty index 4dc5ec2b65a..a3c773c37b4 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3tl.dtx 3158 2012-01-09 00:47:42Z bruno $ +\GetIdInfo$Id: l3tl.dtx 3286 2012-01-31 21:57:22Z joseph $ {L3 Experimental token lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -602,6 +602,18 @@ { \exp_after:wN \c_zero \exp_after:wN \prg_return_false: } \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi: } +\cs_new_protected:Npn \tl_to_str_active_safe:Nx #1#2 + { + \group_begin: + \seq_map_inline:Nn \l_char_active_seq + { \cs_set_nopar:Npx ##1 { \token_to_str:N ##1 } } + \use:x + { + \group_end: + \tl_set:Nn \exp_not:N #1 {#2} + } + \tl_set:Nx #1 { \tl_to_str:N #1 } + } \cs_new_protected:Npn \tl_show:N #1 { \cs_show:N #1 } \cs_generate_variant:Nn \tl_show:N { c } \cs_new_eq:NN \tl_show:n \etex_showtokens:D diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty index e634c9d27c8..3a615eaef75 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty @@ -13,7 +13,7 @@ %% %% Do not distribute a modified version of this file. %% -%% File: l3token.dtx Copyright (C) 2005-2011 The LaTeX3 Project +%% File: l3token.dtx Copyright (C) 2005-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -46,9 +46,8 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3token.dtx 3123 2011-12-31 21:51:51Z joseph $ +\GetIdInfo$Id: l3token.dtx 3234 2012-01-25 12:55:06Z joseph $ {L3 Experimental token manipulation} -%% \begin{function}[EXP,pTF]{\token_if_protected_long_macro:N} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: @@ -166,6 +165,26 @@ \char_set_catcode_active:N \* \tl_const:Nn \c_catcode_active_tl { \exp_not:N * } \group_end: +\seq_new:N \l_char_active_seq +\use:n + { + \group_begin: + \char_set_catcode_active:N \" + \char_set_catcode_active:N \$ + \char_set_catcode_active:N \& + \char_set_catcode_active:N \^ + \char_set_catcode_active:N \_ + \char_set_catcode_active:N \~ + \use:nn + { + \group_end: + \seq_set_from_clist:Nn \l_char_active_seq + } + } + { { " , $ , & , ^ , _ , ~ } } +\seq_new:N \l_char_special_seq +\seq_set_from_clist:Nn \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 @@ -277,100 +296,145 @@ { \prg_return_false: } } \group_begin: - \char_set_lccode:nn { `\T } { `\T } - \char_set_lccode:nn { `\F } { `\F } - \char_set_lccode:nn { `\X } { `\n } - \char_set_lccode:nn { `\Y } { `\t } - \char_set_lccode:nn { `\Z } { `\d } - \char_set_lccode:nn { `\? } { `\\ } - \tl_map_inline:nn { \X \Y \Z \M \C \H \A \R \O \U \S \K \I \P \L \G \P \E } + \char_set_lccode:nn { `T } { `T } + \char_set_lccode:nn { `F } { `F } + \char_set_lccode:nn { `X } { `n } + \char_set_lccode:nn { `Y } { `t } + \char_set_lccode:nn { `Z } { `d } + \tl_map_inline:nn { A C E G H I K L M O P R S U X Y Z R " } { \char_set_catcode:nn { `#1 } \c_twelve } \tl_to_lowercase:n { \group_end: \prg_new_conditional:Npnn \token_if_chardef:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_chardef_aux:w - \token_to_meaning:N #1 ?CHAR" \q_stop + \str_if_eq_return:xx + { + \exp_after:wN \token_if_chardef_aux:w + \token_to_meaning:N #1 CHAR" \q_stop + } + { \token_to_str:N \char } } - \cs_new:Npn \token_if_chardef_aux:w #1 ?CHAR" #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } \prg_new_conditional:Npnn \token_if_mathchardef:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_mathchardef_aux:w - \token_to_meaning:N #1 ?MAYHCHAR" \q_stop + \str_if_eq_return:xx + { + \exp_after:wN \token_if_chardef_aux:w + \token_to_meaning:N #1 CHAR" \q_stop + } + { \token_to_str:N \mathchar } } - \cs_new:Npn \token_if_mathchardef_aux:w #1 ?MAYHCHAR" #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } - \prg_new_conditional:Npnn \token_if_int_register:N #1 { p , T , F , TF } + \cs_new:Npn \token_if_chardef_aux: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_countdef:D #1 + \if_meaning:w \tex_dimen:D #1 \prg_return_false: \else: - \exp_after:wN \token_if_int_register_aux:w - \token_to_meaning:N #1 ?COUXY \q_stop + \if_meaning:w \tex_dimendef:D #1 + \prg_return_false: + \else: + \str_if_eq_return:xx + { + \exp_after:wN \token_if_dim_register_aux:w + \token_to_meaning:N #1 ZIMEX \q_stop + } + { \token_to_str:N \ } + \fi: \fi: } - \cs_new:Npn \token_if_int_register_aux:w #1 ?COUXY #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } - \prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF } + \cs_new:Npn \token_if_dim_register_aux:w #1 ZIMEX #2 \q_stop { #1 ~ } + \prg_new_conditional:Npnn \token_if_int_register:N #1 { p , T , F , TF } { - \if_meaning:w \tex_skipdef:D #1 + % \token_if_chardef:NTF #1 { \prg_return_true: } + % { + % \token_if_mathchardef:NTF #1 { \prg_return_true: } + % { + \if_meaning:w \tex_count:D #1 \prg_return_false: \else: - \exp_after:wN \token_if_skip_register_aux:w - \token_to_meaning:N #1?SKIP\q_stop + \if_meaning:w \tex_countdef:D #1 + \prg_return_false: + \else: + \str_if_eq_return:xx + { + \exp_after:wN \token_if_int_register_aux:w + \token_to_meaning:N #1 COUXY \q_stop + } + { \token_to_str:N \ } + \fi: \fi: + % } + % } } - \cs_new:Npn \token_if_skip_register_aux:w #1 ?SKIP #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } - \prg_new_conditional:Npnn \token_if_dim_register:N #1 { p , T , F , TF } + \cs_new:Npn \token_if_int_register_aux:w #1 COUXY #2 \q_stop { #1 ~ } + \prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF } { - \if_meaning:w \tex_dimendef:D #1 - \c_false_bool + \if_meaning:w \tex_skip:D #1 + \prg_return_false: \else: - \exp_after:wN \token_if_dim_register_aux:w - \token_to_meaning:N #1 ?ZIMEX \q_stop + \if_meaning:w \tex_skipdef:D #1 + \prg_return_false: + \else: + \str_if_eq_return:xx + { + \exp_after:wN \token_if_skip_register_aux:w + \token_to_meaning:N #1 SKIP \q_stop + } + { \token_to_str:N \ } + \fi: \fi: } - \cs_new:Npn \token_if_dim_register_aux:w #1 ?ZIMEX #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } + \cs_new:Npn \token_if_skip_register_aux: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_toksdef:D #1 + \if_meaning:w \tex_toks:D #1 \prg_return_false: \else: - \exp_after:wN \token_if_toks_register_aux:w - \token_to_meaning:N #1 ?YOKS \q_stop + \if_meaning:w \tex_toksdef:D #1 + \prg_return_false: + \else: + \str_if_eq_return:xx + { + \exp_after:wN \token_if_toks_register_aux: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 - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } + \cs_new:Npn \token_if_toks_register_aux:w #1 YOKS #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_protected_macro:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_protected_macro_aux:w - \token_to_meaning:N #1 ?PROYECYEZ~MACRO \q_stop + \str_if_eq_return:xx + { + \exp_after:wN \token_if_protected_macro_aux:w + \token_to_meaning:N #1 PROYECYEZ~MACRO \q_stop + } + { \token_to_str:N \ } } \cs_new:Npn \token_if_protected_macro_aux:w - #1 ?PROYECYEZ~MACRO #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } + #1 PROYECYEZ~MACRO #2 \q_stop { #1 ~ } \prg_new_conditional:Npnn \token_if_long_macro:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_long_macro_aux:w - \token_to_meaning:N #1 ?LOXG~MACRO \q_stop + \str_if_eq_return:xx + { + \exp_after:wN \token_if_long_macro_aux:w + \token_to_meaning:N #1 LOXG~MACRO \q_stop + } + { \token_to_str:N \ } } - \cs_new:Npn \token_if_long_macro_aux:w #1 ?LOXG~MACRO #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } \prg_new_conditional:Npnn \token_if_protected_long_macro:N #1 { p , T , F , TF } { - \exp_after:wN \token_if_protected_long_macro_aux:w - \token_to_meaning:N #1 ?PROYECYEZ?LOXG~MACRO \q_stop + \str_if_eq_return:xx + { + \exp_after:wN \token_if_long_macro_aux:w + \token_to_meaning:N #1 LOXG~MACRO \q_stop + } + { \token_to_str:N \protected \token_to_str:N \ } } - \cs_new:Npn \token_if_protected_long_macro_aux:w - #1 ?PROYECYEZ?LOXG~MACRO #2 \q_stop - { \tl_if_empty:nTF {#1} { \prg_return_true: } { \prg_return_false: } } + \cs_new:Npn \token_if_long_macro_aux:w #1 LOXG~MACRO #2 \q_stop { #1 ~ } } \tex_chardef:D \c_token_A_int = `A ~ % \group_begin: -- cgit v1.2.3