From 3cc0c51eddc31f37b82f651016191bf3575f3aac Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Dec 2011 22:32:04 +0000 Subject: l3kernel 3036 (11dec11) git-svn-id: svn://tug.org/texlive/trunk@24822 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 4 +- Master/texmf-dist/tex/latex/l3kernel/l3basics.sty | 7 +- .../texmf-dist/tex/latex/l3kernel/l3bootstrap.sty | 2 +- Master/texmf-dist/tex/latex/l3kernel/l3box.sty | 25 ++- Master/texmf-dist/tex/latex/l3kernel/l3clist.sty | 174 ++++++++++----------- Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 4 +- Master/texmf-dist/tex/latex/l3kernel/l3expan.sty | 18 ++- Master/texmf-dist/tex/latex/l3kernel/l3fp.sty | 2 +- Master/texmf-dist/tex/latex/l3kernel/l3int.sty | 46 +----- Master/texmf-dist/tex/latex/l3kernel/l3io.sty | 45 ++---- Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty | 44 ++++-- Master/texmf-dist/tex/latex/l3kernel/l3msg.sty | 148 +++++++++++++++--- Master/texmf-dist/tex/latex/l3kernel/l3prg.sty | 49 +++--- Master/texmf-dist/tex/latex/l3kernel/l3prop.sty | 70 ++++----- Master/texmf-dist/tex/latex/l3kernel/l3quark.sty | 19 ++- Master/texmf-dist/tex/latex/l3kernel/l3seq.sty | 170 +++++++++----------- Master/texmf-dist/tex/latex/l3kernel/l3skip.sty | 9 +- Master/texmf-dist/tex/latex/l3kernel/l3tl.sty | 155 +++++++++--------- 18 files changed, 535 insertions(+), 456 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 e1ef050b2bb..b54a9d1255f 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -48,8 +48,8 @@ \RequirePackage{l3names} \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2011/11/19} -\def\ExplFileVersion{2966} +\def\ExplFileDate{2011/12/07} +\def\ExplFileVersion{3036} \RequirePackage{etex} \reserveinserts{32} \RequirePackage{calc} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty index 745f2e3421a..c9e56e990e1 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3basics.dtx 2915 2011-10-15 21:21:08Z bruno $ +\GetIdInfo$Id: l3basics.dtx 3023 2011-12-04 07:25:04Z bruno $ {L3 Experimental basic definitions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -122,7 +122,7 @@ \cs_set_protected:Npn \use:x #1 { \group_begin: - \cs_set:Npx \cs_tmp:w {#1} + \cs_set_nopar:Npx \cs_tmp:w {#1} \exp_after:wN \group_end: \cs_tmp:w @@ -749,6 +749,9 @@ \if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero \prg_return_true: \else: \prg_return_false: \fi: } +\cs_new_eq:NN \prg_break_point:n \use:n +\cs_new:Npn \prg_map_break: #1 \prg_break_point:n #2 { #2 } +\cs_new:Npn \prg_map_break:n #1 #2 \prg_break_point:n #3 { #3 #1 } \cs_new_eq:NN \c_luatex_is_engine_bool \luatex_if_engine_p: \cs_new_eq:NN \c_pdftex_is_engine_bool \pdftex_if_engine_p: \cs_new_eq:NN \c_xetex_is_engine_bool \xetex_if_engine_p: diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty b/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty index e00b99f0852..9c0033a0958 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty @@ -94,7 +94,7 @@ {\def\ExplFileDate{#2}} \protected\def\GetIdInfoAuxSVN#1\relax#2-#3-#4\relax#5Z\relax {\def\ExplFileDate{#2/#3/#4}} -\GetIdInfo$Id: l3bootstrap.dtx 2798 2011-09-10 15:42:13Z will $ +\GetIdInfo$Id: l3bootstrap.dtx 3006 2011-11-25 13:29:59Z joseph $ {L3 experimental bootstrap code} \ProvidesPackage{l3bootstrap} [% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty index 817e1982e4f..acf0671deb3 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3box.dtx 2960 2011-11-15 08:50:21Z joseph $ +\GetIdInfo$Id: l3box.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental boxes} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -146,8 +146,29 @@ \cs_new_eq:NN \c_empty_box \voidb@x \cs_new_eq:NN \l_tmpa_box \@tempboxa \box_new:N \l_tmpb_box -\cs_new_eq:NN \box_show:N \tex_showbox:D +\cs_new_protected:Npn \box_show:N #1 + { + \cs_if_exist:NTF #1 + { \tex_showbox:D \use:n {#1} } + { + \msg_kernel_error:nnx { kernel } { variable-not-defined } + { \token_to_str:N #1 } + } + } \cs_generate_variant:Nn \box_show:N { c } +\cs_new_protected:Npn \box_show:Nnn #1#2#3 + { + \group_begin: + \int_set:Nn \tex_showboxbreadth:D {#2} + \int_set:Nn \tex_showboxdepth:D {#3} + \int_set_eq:NN \tex_tracingonline:D \c_one + \box_show:N #1 + \group_end: + } +\cs_generate_variant:Nn \box_show:Nnn { c } +\cs_new_protected:Npn \box_show_full:N #1 + { \box_show:Nnn #1 { \c_max_int } { \c_max_int } } +\cs_generate_variant:Nn \box_show_full:N { c } \cs_new_protected:Npn \hbox:n { \tex_hbox:D \scan_stop: } \cs_new_protected:Npn \hbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_hbox:D {#2} } \cs_new_protected:Npn \hbox_gset:Nn { \tex_global:D \hbox_set:Nn } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty index ded66383b4a..3dd557d6b8a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty @@ -47,12 +47,12 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3clist.dtx 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3clist.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental comma separated lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: -\tl_new:N \l_clist_tmpa_tl +\tl_new:N \l_clist_tmpa_clist \cs_new_protected:Npn \clist_tmp:w { } \cs_new_eq:NN \clist_new:N \tl_new:N \cs_new_eq:NN \clist_new:c \tl_new:c @@ -108,25 +108,24 @@ { \exp_args:No \clist_trim_spaces_generic_aux_ii:nn { \use_none:n #1 } } \cs_new:Npn \clist_trim_spaces_generic_aux_ii:nn #1 #2 { #2 {#1} } \cs_new:Npn \clist_trim_spaces:n #1 - { - \clist_trim_spaces_aux:n { } \q_mark #1 , - \q_recursion_tail, \q_recursion_stop - } -\cs_new:Npn \clist_trim_spaces_aux:n #1 { \clist_trim_spaces_generic:nw - { \clist_trim_spaces_aux_ii:nn {#1} } + { \clist_trim_spaces_aux:nn { } } + \q_mark #1 , + \q_recursion_tail, \q_recursion_stop } -\cs_new:Npn \clist_trim_spaces_aux_ii:nn #1 #2 +\cs_new:Npn \clist_trim_spaces_aux:nn #1 #2 { \quark_if_recursion_tail_stop:n {#2} \tl_if_empty:nTF {#2} { - \clist_trim_spaces_aux:n {#1} \q_mark + \clist_trim_spaces_generic:nw + { \clist_trim_spaces_aux:nn {#1} } \q_mark } { #1 \exp_not:n {#2} - \clist_trim_spaces_aux:n { , } \q_mark + \clist_trim_spaces_generic:nw + { \clist_trim_spaces_aux:nn { , } } \q_mark } } \cs_new_protected:Npn \clist_set:Nn #1#2 @@ -136,27 +135,27 @@ \cs_generate_variant:Nn \clist_set:Nn { NV , No , Nx , c , cV , co , cx } \cs_generate_variant:Nn \clist_gset:Nn { NV , No , Nx , c , cV , co , cx } \cs_new_protected_nopar:Npn \clist_put_left:Nn - { \clist_put_aux:NNnnNn \tl_set_eq:NN \tl_put_left:Nx { } , } + { \clist_put_left_aux:NNNn \clist_concat:NNN \clist_set:Nn } \cs_new_protected_nopar:Npn \clist_gput_left:Nn - { \clist_put_aux:NNnnNn \tl_gset_eq:NN \tl_gput_left:Nx { } , } -\cs_new_protected:Npn \clist_put_aux:NNnnNn #1#2#3#4#5#6 + { \clist_put_left_aux:NNNn \clist_gconcat:NNN \clist_set:Nn } +\cs_new_protected:Npn \clist_put_left_aux:NNNn #1#2#3#4 { - \tl_set:Nx \l_clist_tmpa_tl { \clist_trim_spaces:n {#6} } - \clist_if_empty:NTF #5 - { #1 #5 \l_clist_tmpa_tl } - { - \tl_if_empty:NF \l_clist_tmpa_tl - { #2 #5 { #3 \exp_not:o \l_clist_tmpa_tl #4 } } - } + #2 \l_clist_tmpa_clist {#4} + #1 #3 \l_clist_tmpa_clist #3 } \cs_generate_variant:Nn \clist_put_left:Nn { NV , No , Nx } \cs_generate_variant:Nn \clist_put_left:Nn { c , cV , co , cx } \cs_generate_variant:Nn \clist_gput_left:Nn { NV , No , Nx } \cs_generate_variant:Nn \clist_gput_left:Nn { c , cV , co , cx } \cs_new_protected:Npn \clist_put_right:Nn - { \clist_put_aux:NNnnNn \tl_set_eq:NN \tl_put_right:Nx , { } } + { \clist_put_right_aux:NNNn \clist_concat:NNN \clist_set:Nn } \cs_new_protected_nopar:Npn \clist_gput_right:Nn - { \clist_put_aux:NNnnNn \tl_gset_eq:NN \tl_gput_right:Nx , { } } + { \clist_put_right_aux:NNNn \clist_gconcat:NNN \clist_gset:Nn } +\cs_new_protected:Npn \clist_put_right_aux:NNNn #1#2#3#4 + { + #2 \l_clist_tmpa_clist {#4} + #1 #3 #3 \l_clist_tmpa_clist + } \cs_generate_variant:Nn \clist_put_right:Nn { NV , No , Nx } \cs_generate_variant:Nn \clist_put_right:Nn { c , cV , co , cx } \cs_generate_variant:Nn \clist_gput_right:Nn { NV , No , Nx } @@ -287,36 +286,47 @@ \clist_if_empty:NF #1 { \exp_last_unbraced:NNo \clist_map_function_aux:Nw #2 #1 - , \q_recursion_tail , \q_recursion_stop + , \q_recursion_tail , + \prg_break_point:n { } } } \cs_new:Npn \clist_map_function_aux:Nw #1#2 , { - \quark_if_recursion_tail_stop:n {#2} + \quark_if_recursion_tail_break:n {#2} #1 {#2} \clist_map_function_aux:Nw #1 } \cs_generate_variant:Nn \clist_map_function:NN { c } -\int_new:N \g_clist_map_inline_int +\cs_new:Npn \clist_map_function:nN #1#2 + { + \clist_trim_spaces_generic:nw { \clist_map_function_n_aux:Nn #2 } + \q_mark #1, \q_recursion_tail, + \prg_break_point:n { } + } +\cs_new:Npn \clist_map_function_n_aux:Nn #1 #2 + { + \quark_if_recursion_tail_break:n {#2} + \tl_if_empty:nF {#2} { \clist_map_aux_unbrace:Nw #1 #2, } + \clist_trim_spaces_generic:nw { \clist_map_function_n_aux:Nn #1 } + \q_mark + } +\cs_new:Npn \clist_map_aux_unbrace:Nw #1 #2, { #1 {#2} } \cs_new_protected:Npn \clist_map_inline:Nn #1#2 { - \int_gincr:N \g_clist_map_inline_int - \cs_gset:cpn { clist_map_inline_ \int_use:N \g_clist_map_inline_int :n } - ##1 - {#2} - \exp_args:NNc \clist_map_function:NN #1 - { clist_map_inline_ \int_use:N \g_clist_map_inline_int :n } - \int_gdecr:N \g_clist_map_inline_int + \clist_if_empty:NF #1 + { + \int_gincr:N \g_prg_map_int + \cs_gset:cpn { clist_map_ \int_use:N \g_prg_map_int :n } ##1 {#2} + \exp_last_unbraced:Nco \clist_map_function_aux:Nw + { clist_map_ \int_use:N \g_prg_map_int :n } + #1 , \q_recursion_tail , + \prg_break_point:n { \int_gdecr:N \g_prg_map_int } + } } -\cs_new_protected:Npn \clist_map_inline:nn #1#2 +\cs_new_protected:Npn \clist_map_inline:nn #1 { - \int_gincr:N \g_clist_map_inline_int - \cs_gset:cpn { clist_map_inline_ \int_use:N \g_clist_map_inline_int :n } - ##1 - {#2} - \exp_args:Nnc \clist_map_function:nN {#1} - { clist_map_inline_ \int_use:N \g_clist_map_inline_int :n } - \int_gdecr:N \g_clist_map_inline_int + \clist_set:Nn \l_clist_tmpa_clist {#1} + \clist_map_inline:Nn \l_clist_tmpa_clist } \cs_generate_variant:Nn \clist_map_inline:Nn { c } \cs_new_protected:Npn \clist_map_variable:NNn #1#2#3 @@ -327,61 +337,39 @@ { \clist_map_variable_aux:Nnw #2 {#3} } #1 , \q_recursion_tail , \q_recursion_stop + \prg_break_point:n { } } } -\cs_new_protected:Npn \clist_map_variable_aux:Nnw #1#2#3 , - { - \quark_if_recursion_tail_stop:n {#3} - \tl_set:Nn #1 {#3} - #2 - \clist_map_variable_aux:Nnw #1 {#2} - } \cs_new_protected:Npn \clist_map_variable:nNn #1 { - \tl_set:Nx \l_clist_tmpa_tl { \clist_trim_spaces:n {#1} } - \clist_map_variable:NNn \l_clist_tmpa_tl - } -\cs_generate_variant:Nn \clist_map_variable:NNn { c } -\cs_new:Npn \clist_map_aux_unbrace:Nw #1 #2, { #1 {#2} } -\cs_new:Npn \clist_map_function:nN #1#2 - { - \clist_trim_spaces_generic:nw { \clist_map_function_n_aux:Nn #2 } - \q_mark #1, \q_recursion_tail, \q_recursion_stop + \clist_set:Nn \l_clist_tmpa_clist {#1} + \clist_map_variable:NNn \l_clist_tmpa_clist } -\cs_new:Npn \clist_map_function_n_aux:Nn #1 #2 +\cs_new_protected:Npn \clist_map_variable_aux:Nnw #1#2#3, { - \quark_if_recursion_tail_stop:n {#2} - \tl_if_empty:nF {#2} { \clist_map_aux_unbrace:Nw #1 #2, } - \clist_trim_spaces_generic:nw { \clist_map_function_n_aux:Nn #1 } - \q_mark + \tl_set:Nn #1 {#3} + \quark_if_recursion_tail_stop:N #1 + \use:n {#2} + \clist_map_variable_aux:Nnw #1 {#2} } -\cs_new_eq:NN \clist_map_break: \use_none_delimit_by_q_recursion_stop:w -\cs_new_eq:NN \clist_map_break:n \use_i_delimit_by_q_recursion_stop:nw +\cs_generate_variant:Nn \clist_map_variable:NNn { c } +\cs_new_eq:NN \clist_map_break: \prg_map_break: +\cs_new_eq:NN \clist_map_break:n \prg_map_break:n \cs_new_protected_nopar:Npn \clist_show:N #1 { - \clist_if_empty:NTF #1 - { - \iow_term:x { Comma~list~\token_to_str:N #1~is~empty } - \tl_show:n { } - } - { - \iow_term:x - { - Comma~list~\token_to_str:N #1~ - contains~the~items~(without~outer~braces): - } - \tl_set:Nx \l_clist_show_tl - { \clist_map_function:NN #1 \clist_show_aux:n } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \clist_show_aux:w \l_clist_show_tl } - } + \msg_aux_show:Nnx + #1 + { clist } + { \clist_map_function:NN #1 \msg_aux_show:n } } -\cs_new:Npn \clist_show_aux:n #1 +\cs_new_protected:Npn \clist_show:n #1 { - \iow_newline: > \c_space_tl \c_space_tl - \iow_char:N \{ \exp_not:n {#1} \iow_char:N \} + \clist_set:Nn \l_clist_tmpa_clist {#1} + \msg_aux_show:Nnx + \l_clist_tmpa_clist + { clist } + { \clist_map_function:NN \l_clist_tmpa_clist \msg_aux_show:n } } -\cs_new:Npn \clist_show_aux:w #1 > ~ { } \cs_generate_variant:Nn \clist_show:N { c } \clist_new:N \l_tmpa_clist \clist_new:N \l_tmpb_clist @@ -396,16 +384,21 @@ } } \cs_new:Npn \clist_length_aux:n #1 { +1 } -\cs_new:Npn \clist_length:n #1 +\cs_new:Npx \clist_length:n #1 { - \int_eval:n + \exp_not:N \int_eval:n { 0 - \clist_map_function_aux:Nw \clist_length_n_aux:n #1 - , \q_recursion_tail , \q_recursion_stop + \exp_not:N \clist_length_n_aux:w \c_space_tl + #1 \exp_not:n { , \q_recursion_tail , \q_recursion_stop } } } -\cs_new:Npn \clist_length_n_aux:n #1 { \tl_if_blank:nF {#1} {+1} } +\cs_new:Npx \clist_length_n_aux:w #1 , + { + \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1} + \exp_not:N \tl_if_blank:nF {#1} { + \c_one } + \exp_not:N \clist_length_n_aux:w \c_space_tl + } \cs_generate_variant:Nn \clist_length:N { c } \cs_new:Npn \clist_item:Nn #1#2 { @@ -492,6 +485,9 @@ \cs_generate_variant:Nn \clist_set_from_seq:NN { c , cc } \cs_generate_variant:Nn \clist_gset_from_seq:NN { Nc } \cs_generate_variant:Nn \clist_gset_from_seq:NN { c , cc } +\cs_new_protected:Npn \clist_const:Nn #1#2 + { \tl_const:Nx #1 { \clist_trim_spaces:n {#2} } } +\cs_generate_variant:Nn \clist_const:Nn { c , Nx , cx } \cs_new_protected:Npn \clist_trim_spaces:N #1 { \clist_set:No #1 {#1} } \cs_new_protected:Npn \clist_gtrim_spaces:N #1 { \clist_gset:No #1 {#1} } \cs_generate_variant:Nn \clist_trim_spaces:N { c } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index d86ed4560e9..a79e13d795e 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -52,7 +52,7 @@ \let \filedateOld \ExplFileDate \let \fileversionOld \ExplFileVersion \let \filedescriptionOld \ExplFileDescription -\GetIdInfo$Id: l3doc.dtx 2866 2011-10-01 05:16:55Z bruno $ +\GetIdInfo$Id: l3doc.dtx 2990 2011-11-23 02:32:59Z bruno $ {L3 Experimental documentation class} \ProvidesExplClass {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -73,6 +73,7 @@ \bool_new:N \l_doc_long_name_bool \bool_new:N \g_doc_implementation_bool \dim_new:N \l_doc_trial_width_dim +\tl_new:N \l_doc_macro_tl \int_new:N \l_doc_macro_int \int_new:N \g_doc_nested_macro_int \prop_new:N \g_doc_missing_tests_prop @@ -659,6 +660,7 @@ { unknown .code:n = { \use:c{doc_macro_opt_#1:} } } +\clist_new:N \l_doc_macro_input_clist \cs_new_nopar:Npn \doc_macro_aux:n #1 { \group_end: \clist_set:Nn \l_doc_macro_input_clist {#1} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty b/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty index def2204767c..303e369e694 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3expan.dtx 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3expan.dtx 3031 2011-12-07 05:27:05Z bruno $ {L3 Experimental argument expansion} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -102,7 +102,7 @@ { \fi: \fi: - \msg_expandable_error:n { Erroneous ~ variable ~ #2 used! } + \msg_expandable_kernel_error:nnn { kernel } { bad-var } {#2} \c_zero } \cs_new:Npn \exp_args:No #1#2 { \exp_after:wN #1 \exp_after:wN {#2} } @@ -245,6 +245,11 @@ \exp_after:wN \exp_arg_last_unbraced:nn \exp_after:wN { \tex_romannumeral:D \exp_eval_register:c {#2} } {#1} } +\cs_new_protected:Npn \::x_unbraced \::: #1#2 + { + \cs_set_nopar:Npx \l_exp_tl { \exp_not:n {#1} #2 } + \l_exp_tl + } \cs_new:Npn \exp_last_unbraced:NV #1#2 { \exp_after:wN #1 \tex_romannumeral:D \exp_eval_register:N #2 } \cs_new:Npn \exp_last_unbraced:Nv #1#2 @@ -252,6 +257,8 @@ \cs_new:Npn \exp_last_unbraced:No #1#2 { \exp_after:wN #1 #2 } \cs_new:Npn \exp_last_unbraced:Nf #1#2 { \exp_after:wN #1 \tex_romannumeral:D -`0 #2 } +\cs_new:Npn \exp_last_unbraced:Nco #1#2#3 + { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: #3 } \cs_new:Npn \exp_last_unbraced:NcV #1#2#3 { \exp_after:wN #1 @@ -266,9 +273,6 @@ } \cs_new:Npn \exp_last_unbraced:NNo #1#2#3 { \exp_after:wN #1 \exp_after:wN #2 #3 } -\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: } -\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: } -\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: } \cs_new:Npn \exp_last_unbraced:NNNV #1#2#3#4 { \exp_after:wN #1 @@ -278,6 +282,10 @@ } \cs_new:Npn \exp_last_unbraced:NNNo #1#2#3#4 { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 #4 } +\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: } +\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: } +\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: } +\cs_new_protected_nopar:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: } \cs_new:Npn \exp_last_two_unbraced:Noo #1#2#3 { \exp_after:wN \exp_last_two_unbraced_aux:noN \exp_after:wN {#3} {#2} #1 } \cs_new:Npn \exp_last_two_unbraced_aux:noN #1#2#3 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty index 6304b6d449c..3eb68b0727d 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3fp.dtx 2857 2011-09-26 19:46:31Z joseph $ +\GetIdInfo$Id: l3fp.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental floating-point operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty index 831fb50ae02..b5f57e66b05 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 2928 2011-10-22 12:32:44Z bruno $ +\GetIdInfo$Id: l3int.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental integers} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -679,6 +679,8 @@ \cs_new_nopar:Npn \int_from_roman_clean_up:w #1 Q { + 0 Q -1 } \cs_new_eq:NN \int_show:N \kernel_register_show:N \cs_new_eq:NN \int_show:c \kernel_register_show:c +\cs_new_protected:Npn \int_show:n #1 + { \tex_showthe:D \int_eval:w #1 \int_eval_end: } \int_const:Nn \c_one { 1 } \int_const:Nn \c_two { 2 } \int_const:Nn \c_three { 3 } @@ -703,48 +705,6 @@ \int_new:N \l_tmpc_int \int_new:N \g_tmpa_int \int_new:N \g_tmpb_int -\int_new:N \g_seq_nesting_depth_int -\int_new:N \g_tl_inline_level_int -\cs_new_eq:NN \int_convert_from_base_ten:nn \int_to_base:nn -\cs_new_eq:NN \int_convert_to_symbols:nnn \int_to_symbols:nnn -\cs_new_eq:NN \int_convert_to_base_ten:nn \int_from_base:nn -\cs_new_nopar:Npn \int_to_symbol:n - { - \scan_align_safe_stop: - \mode_if_math:TF - { \int_to_symbol_math:n } - { \int_to_symbol_text:n } - } -\cs_new:Npn \int_to_symbol_math:n #1 - { - \int_to_symbols:nnn {#1} { 9 } - { - { 1 } { * } - { 2 } { \dagger } - { 3 } { \ddagger } - { 4 } { \mathsection } - { 5 } { \mathparagraph } - { 6 } { \| } - { 7 } { ** } - { 8 } { \dagger \dagger } - { 9 } { \ddagger \ddagger } - } - } -\cs_new:Npn \int_to_symbol_text:n #1 - { - \int_to_symbols:nnn {#1} { 9 } - { - { 1 } { \textasteriskcentered } - { 2 } { \textdagger } - { 3 } { \textdaggerdbl } - { 4 } { \textsection } - { 5 } { \textparagraph } - { 6 } { \textbardbl } - { 7 } { \textasteriskcentered \textasteriskcentered } - { 8 } { \textdagger \textdagger } - { 9 } { \textdaggerdbl \textdaggerdbl } - } - } %% %% %% End of file `l3int.sty'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3io.sty b/Master/texmf-dist/tex/latex/l3kernel/l3io.sty index 4073a35bfa8..c074dbf0ea2 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 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3io.dtx 3005 2011-11-25 13:19:47Z bruno $ {L3 Experimental input-output operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -229,41 +229,16 @@ \cs_generate_variant:Nn \ior_close:N { c } \cs_generate_variant:Nn \iow_close:N { c } \cs_new_protected_nopar:Npn \ior_list_streams: - { - \prop_if_empty:NTF \g_ior_streams_prop - { - \iow_term:x { No~input~streams~are~open } - \tl_show:n { } - } - { - \iow_term:x { The~following~input~streams~are~in~use: } - \tl_set:Nx \l_prop_show_tl - { \prop_map_function:NN \g_ior_streams_prop \ior_show_aux:nn } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \prop_show_aux:w \l_prop_show_tl } - } - } -\cs_new:Npn \ior_show_aux:nn #1#2 - { - \iow_newline: > \c_space_tl \c_space_tl - #1 \c_space_tl \c_space_tl => \c_space_tl \c_space_tl \exp_not:n {#2} - } + { \ior_list_streams_aux:Nn \g_ior_streams_prop { ior } } \cs_new_protected_nopar:Npn \iow_list_streams: + { \ior_list_streams_aux:Nn \g_iow_streams_prop { iow } } +\cs_new_protected:Npn \ior_list_streams_aux:Nn #1#2 { - \prop_if_empty:NTF \g_iow_streams_prop - { - \iow_term:x { No~output~streams~are~open } - \tl_show:n { } - } - { - \iow_term:x { The~following~output~streams~are~in~use: } - \tl_set:Nx \l_prop_show_tl - { \prop_map_function:NN \g_iow_streams_prop \iow_show_aux:nn } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \prop_show_aux:w \l_prop_show_tl } - } + \msg_aux_use:nn { LaTeX / #2 } + { \prop_if_empty:NTF #1 { show-no-stream } { show-open-streams } } + \msg_aux_show:x + { \prop_map_function:NN #1 \msg_aux_show_unbraced:nn } } -\cs_new_eq:NN \iow_show_aux:nn \ior_show_aux:nn \msg_kernel_new:nnnn { iow } { streams-exhausted } { Output~streams~exhausted } { @@ -421,9 +396,7 @@ } \cs_new_protected_nopar:Npn \iow_wrap_special:w #1 ~ #2 ~ #3 ~ % { - \cs_if_exist:cTF { iow_wrap_#1: } - { \use:c { iow_wrap_#1: } } - { \msg_expandable_error:n {#1} } + \use:c { iow_wrap_#1: } \str_if_eq:xxTF { #2~#3 } { ~ \c_iow_wrap_marker_tl } { \iow_wrap_special:w } { \iow_wrap_loop:w #2 ~ #3 ~ } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty b/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty index cbecb20c036..7494acf9185 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty @@ -46,11 +46,17 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3luatex.dtx 2798 2011-09-10 15:42:13Z will $ +\GetIdInfo$Id: l3luatex.dtx 2995 2011-11-23 16:15:19Z bruno $ {L3 Experimental LuaTeX-specific functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: +\msg_kernel_new:nnnn { luatex } { bad-engine } + { LuaTeX~engine~not~in~use!~Ignoring~#1. } + { + The~feature~you~are~using~is~only~available\ + with~the~luaTeX~engine.~LaTeX3~ignored~`#1#2'. + } \luatex_if_engine:TF { \cs_new_eq:NN \lua_now:x \luatex_directlua:D @@ -59,13 +65,13 @@ { \cs_new:Npn \lua_now:x #1 { - \msg_expandable_error:n - { LuaTeX~ engine~ not~ in~ use!~ Ignoring~ \lua_now:x. } + \msg_expandable_kernel_error:nnn + { luatex } { bad-engine } { \lua_now:x } } \cs_new_protected:Npn \lua_shipout_x:n #1 { - \msg_expandable_error:n - { LuaTeX~ engine~ not~ in~ use!~ Ignoring~ \lua_shipout_x:n. } + \msg_expandable_kernel_error:nnn + { luatex } { bad-engine } { \lua_shipout_x:n } } } \cs_new:Npn \lua_now:n #1 @@ -97,7 +103,13 @@ } } \luatex_if_engine:F - { \cs_set_protected_nopar:Npn \cctab_new:N #1 { \lua_wrong_engine: } } + { + \cs_set_protected_nopar:Npn \cctab_new:N #1 + { + \msg_kernel_error:nnx { luatex } { bad-engine } + { \exp_not:N \cctab_new:N } + } + } \luatex_if_engine:T { \cs_set_protected_nopar:Npn \cctab_new:N #1 @@ -126,8 +138,16 @@ } \luatex_if_engine:F { - \cs_set_protected_nopar:Npn \cctab_begin:N #1 { \lua_wrong_engine: } - \cs_set_protected_nopar:Npn \cctab_end: { \lua_wrong_engine: } + \cs_set_protected_nopar:Npn \cctab_begin:N #1 + { + \msg_kernel_error:nnxx { luatex } { bad-engine } + { \exp_not:N \cctab_begin:N } {#1} + } + \cs_set_protected_nopar:Npn \cctab_end: + { + \msg_kernel_error:nnx { luatex } { bad-engine } + { \exp_not:N \cctab_end: } + } } \luatex_if_engine:T { @@ -143,7 +163,13 @@ \group_end: } \luatex_if_engine:F - { \cs_set_protected_nopar:Npn \cctab_gset:Nn #1#2 { \lua_wrong_engine: } } + { + \cs_set_protected_nopar:Npn \cctab_gset:Nn #1#2 + { + \msg_kernel_error:nnxx { luatex } { bad-engine } + { \exp_not:N \cctab_gset:Nn } { #1 {#2} } + } + } \luatex_if_engine:T { \cctab_new:N \c_code_cctab diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty index f524af018c6..d4991bc760c 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3msg.dtx 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3msg.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental messages} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -58,7 +58,7 @@ { \cs_if_exist:cT { \c_msg_text_prefix_tl #1 / #2 } { - \msg_kernel_error:nn { msg } { message-already-defined } + \msg_kernel_error:nnxx { msg } { message-already-defined } {#1} {#2} } \msg_gset:nnnn {#1} {#2} @@ -484,9 +484,8 @@ { Message~'#2'~for~module~'#1'~already~defined. } { \c_msg_coding_error_text_tl - LaTeX~was~asked~to~define~a~new~message~called~'#2' - by~the~module~'#1'~module:\\ - this~message~already~exists. + LaTeX~was~asked~to~define~a~new~message~called~'#2'\ + by~the~module~'#1':~this~message~already~exists. \c_msg_return_text_tl } \msg_kernel_new:nnnn { msg } { message-unknown } @@ -556,23 +555,42 @@ LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~% would~lead~to~an~infinite~loop! } -\cs_set_protected:Npn \msg_kernel_bug:x #1 - { - \msg_interrupt:xxx { \c_msg_kernel_bug_text_tl } - { - #1 - \msg_see_documentation_text:n { LaTeX3 } - } - { \c_msg_kernel_bug_more_text_tl } - } -\tl_const:Nn \c_msg_kernel_bug_text_tl - { This~is~a~LaTeX~bug:~check~coding! } -\tl_const:Nn \c_msg_kernel_bug_more_text_tl - { - There~is~a~coding~bug~somewhere~around~here. \\ - This~probably~needs~examining~by~an~expert. - \c_msg_return_text_tl - } +\msg_kernel_new:nnn { seq } { misused } + { A~sequence~was~misused. } +\msg_kernel_new:nnn { kernel } { bad-var } + { Erroneous~variable~#1 used! } +\msg_kernel_new:nnn { prg } { zero-step } + { Zero~step~size~for~stepwise~function~#1. } +\msg_kernel_new:nnn { seq } { show } + { + Sequence~\token_to_str:N #1~ + \seq_if_empty:NTF #1 + { is~empty } + { contains~the~items~(without~outer~braces): } + } +\msg_kernel_new:nnn { prop } { show } + { + Property~list~\token_to_str:N #1~ + \prop_if_empty:NTF #1 + { is~empty } + { contains~the~pairs~(without~outer~braces): } + } +\msg_kernel_new:nnn { clist } { show } + { + Comma~list~ + \str_if_eq:nnF {#1} { \l_clist_tmpa_clist } { \token_to_str:N #1~} + \clist_if_empty:NTF #1 + { is~empty } + { contains~the~items~(without~outer~braces): } + } +\msg_kernel_new:nnn { ior } { show-no-stream } + { No~input~streams~are~open } +\msg_kernel_new:nnn { ior } { show-open-streams } + { The~following~input~streams~are~in~use: } +\msg_kernel_new:nnn { iow } { show-no-stream } + { No~output~streams~are~open } +\msg_kernel_new:nnn { iow } { show-open-streams } + { The~following~output~streams~are~in~use: } \group_begin: \char_set_catcode_math_superscript:N \^ \char_set_lccode:nn {`^} {`\ } @@ -591,12 +609,92 @@ \exp_after:wN \exp_after:wN \exp_after:wN \c_zero } - \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } - \exp_not:N \q_stop + \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } ^ } - \cs_new:Npn \msg_expandable_error_aux:w #1 ^ #2 \q_stop { #1 } + \cs_new:Npn \msg_expandable_error_aux:w #1 ^ #2 ^ { #1 } } \group_end: +\cs_new:Npn \msg_expandable_kernel_error:nnnnnn #1#2#3#4#5#6 + { + \exp_args:Nf \msg_expandable_error:n + { + \exp_args:NNc \exp_after:wN \exp_stop_f: + { \c_msg_text_prefix_tl LaTeX / #1 / #2 } + {#3} {#4} {#5} {#6} + } + } +\cs_new:Npn \msg_expandable_kernel_error:nnnnn #1#2#3#4#5 + { + \msg_expandable_kernel_error:nnnnnn + {#1} {#2} {#3} {#4} {#5} { } + } +\cs_new:Npn \msg_expandable_kernel_error:nnnn #1#2#3#4 + { + \msg_expandable_kernel_error:nnnnnn + {#1} {#2} {#3} {#4} { } { } + } +\cs_new:Npn \msg_expandable_kernel_error:nnn #1#2#3 + { + \msg_expandable_kernel_error:nnnnnn + {#1} {#2} {#3} { } { } { } + } +\cs_new:Npn \msg_expandable_kernel_error:nn #1#2 + { + \msg_expandable_kernel_error:nnnnnn + {#1} {#2} { } { } { } { } + } +\tl_new:N \l_msg_show_tl +\cs_new_protected:Npn \msg_aux_use:nn #1#2 + { \msg_aux_use:nnxxxx {#1} {#2} { } { } { } { } } +\cs_new_protected:Npn \msg_aux_use:nnxxxx #1#2#3#4#5#6 + { + \iow_term:x + { + \use:c { \c_msg_text_prefix_tl #1 / #2 } + {#3} {#4} {#5} {#6} + } + } +\cs_new_protected:Npn \msg_aux_show:Nnx #1#2#3 + { + \cs_if_exist:NTF #1 + { + \msg_aux_use:nnxxxx { LaTeX / #2 } { show } {#1} { } { } { } + \msg_aux_show:x {#3} + } + { + \msg_kernel_error:nnx { kernel } { variable-not-defined } + { \token_to_str:N #1 } + } + } +\cs_new_protected:Npn \msg_aux_show:x #1 + { + \tl_set:Nx \l_msg_show_tl {#1} + \tl_if_empty:NT \l_msg_show_tl + { \tl_set:Nx \l_msg_show_tl { > } } + \exp_args:Nf \etex_showtokens:D + { + \exp_after:wN \exp_after:wN + \exp_after:wN \msg_aux_show:w + \exp_after:wN \l_msg_show_tl + \exp_after:wN + } + \prg_do_nothing: + } +\cs_new:Npn \msg_aux_show:w #1 > { } +\cs_new:Npn \msg_aux_show:n #1 + { + \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} } + } +\cs_new:Npn \msg_aux_show:nn #1#2 + { + \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} } + \c_space_tl \c_space_tl => \c_space_tl \c_space_tl { \exp_not:n {#2} } + } +\cs_new:Npn \msg_aux_show_unbraced:nn #1#2 + { + \iow_newline: > \c_space_tl \c_space_tl \exp_not:n {#1} + \c_space_tl \c_space_tl => \c_space_tl \c_space_tl \exp_not:n {#2} + } %% %% %% End of file `l3msg.sty'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty index 45e1aa17ddb..e86d4214429 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 2915 2011-10-15 21:21:08Z bruno $ +\GetIdInfo$Id: l3prg.dtx 3014 2011-11-27 06:55:43Z bruno $ {L3 Experimental control structures} %% \ProvidesExplPackage @@ -377,45 +377,43 @@ \cs_new:cpn { prg_replicate_first_9:n } #1 { \c_zero #1#1#1#1#1#1#1#1#1 } \cs_new:Npn \prg_stepwise_function:nnnN #1#2#3#4 { - \int_compare:nNnTF {#2} = \c_zero - { \msg_expandable_error:n { Zero~step~size~for~stepwise~function. } } - { - \int_compare:nNnTF {#2} > \c_zero - { \exp_args:Nf \prg_stepwise_function_incr:nnnN } - { \exp_args:Nf \prg_stepwise_function_decr:nnnN } - { \int_eval:n {#1} } {#2} {#3} #4 - } + \prg_stepwise_aux:nnnN {#1} {#2} {#3} #4 + \prg_break_point:n { } } -\cs_new:Npn \prg_stepwise_function_incr:nnnN #1#2#3#4 +\cs_new:Npn \prg_stepwise_aux:nnnN #1#2#3#4 { - \int_compare:nNnF {#1} > {#3} + \int_compare:nNnTF {#2} > \c_zero + { \exp_args:NNf \prg_stepwise_aux:NnnnN > } { - #4 {#1} - \exp_args:Nf \prg_stepwise_function_incr:nnnN - { \int_eval:n { #1 + #2 } } {#2} {#3} #4 + \int_compare:nNnTF {#2} = \c_zero + { + \msg_expandable_kernel_error:nnn { prg } { zero-step } {#4} + \prg_map_break: + } + { \exp_args:NNf \prg_stepwise_aux:NnnnN < } } + { \int_eval:n {#1} } {#2} {#3} #4 } -\cs_new:Npn \prg_stepwise_function_decr:nnnN #1#2#3#4 +\cs_new:Npn \prg_stepwise_aux:NnnnN #1#2#3#4#5 { - \int_compare:nNnF {#1} < {#3} + \int_compare:nNnF {#2} #1 {#4} { - #4 {#1} - \exp_args:Nf \prg_stepwise_function_decr:nnnN - { \int_eval:n { #1 + #2 } } {#2} {#3} #4 + #5 {#2} + \exp_args:NNf \prg_stepwise_aux:NnnnN + #1 { \int_eval:n { #2 + #3 } } {#3} {#4} #5 } } -\int_new:N \g_prg_stepwise_level_int \cs_new_protected:Npn \prg_stepwise_inline:nnnn { \exp_args:NNc \prg_stepwise_aux:NNnnnn \cs_gset_nopar:Npn - { g_prg_stepwise_ \int_use:N \g_prg_stepwise_level_int :n } + { g_prg_stepwise_ \int_use:N \g_prg_map_int :n } } \cs_new_protected:Npn \prg_stepwise_variable:nnnNn #1#2#3#4#5 { \exp_args:NNc \prg_stepwise_aux:NNnnnn \cs_gset_nopar:Npx - { g_prg_stepwise_ \int_use:N \g_prg_stepwise_level_int :n } + { g_prg_stepwise_ \int_use:N \g_prg_map_int :n } {#1}{#2}{#3} { \tl_set:Nn \exp_not:N #4 {##1} @@ -425,9 +423,9 @@ \cs_new_protected:Npn \prg_stepwise_aux:NNnnnn #1#2#3#4#5#6 { #1 #2 ##1 {#6} - \int_gincr:N \g_prg_stepwise_level_int - \prg_stepwise_function:nnnN {#3}{#4}{#5} #2 - \int_gdecr:N \g_prg_stepwise_level_int + \int_gincr:N \g_prg_map_int + \prg_stepwise_aux:nnnN {#3} {#4} {#5} #2 + \prg_break_point:n { \int_gdecr:N \g_prg_map_int } } \prg_new_conditional:Npnn \mode_if_vertical: { p , T , F , TF } { \if_mode_vertical: \prg_return_true: \else: \prg_return_false: \fi: } @@ -474,6 +472,7 @@ { \prg_variable_get_type_aux:w #2#3 \q_stop } } } +\int_new:N \g_prg_map_int \cs_new_protected_nopar:Npn \prg_define_quicksort:nnn #1#2#3 { \cs_set:cpx{#1_quicksort:n}##1{ \exp_not:c{#1_quicksort_start_partition:w} ##1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty index eebc40c2520..c3878515e49 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3prop.dtx 2839 2011-09-17 20:18:23Z bruno $ +\GetIdInfo$Id: l3prop.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental property lists} %% \ProvidesExplPackage @@ -62,10 +62,10 @@ \cs_new_protected:Npn \prop_gclear:c #1 { \cs_gset_eq:cN {#1} \c_empty_prop } \cs_new_protected:Npn \prop_clear_new:N #1 { \cs_if_exist:NTF #1 { \prop_clear:N #1 } { \prop_new:N #1 } } -\cs_generate_variant:Nn \prop_clear_new:N {c} +\cs_generate_variant:Nn \prop_clear_new:N { c } \cs_new_protected:Npn \prop_gclear_new:N #1 { \cs_if_exist:NTF #1 { \prop_gclear:N #1 } { \prop_new:N #1 } } -\cs_new_eq:NN \prop_gclear_new:c \prop_gclear:c +\cs_generate_variant:Nn \prop_gclear_new:N { c } \cs_new_eq:NN \prop_set_eq:NN \tl_set_eq:NN \cs_new_eq:NN \prop_set_eq:Nc \tl_set_eq:Nc \cs_new_eq:NN \prop_set_eq:cN \tl_set_eq:cN @@ -74,7 +74,7 @@ \cs_new_eq:NN \prop_gset_eq:Nc \tl_gset_eq:Nc \cs_new_eq:NN \prop_gset_eq:cN \tl_gset_eq:cN \cs_new_eq:NN \prop_gset_eq:cc \tl_gset_eq:cc -\cs_set_protected:Npn \prop_split:NnTF #1#2 +\cs_new_protected:Npn \prop_split:NnTF #1#2 { \exp_args:NNo \prop_split_aux:NnTF #1 { \tl_to_str:n {#2} } } \cs_new_protected:Npn \prop_split_aux:NnTF #1#2 { @@ -86,7 +86,7 @@ } \cs_new:Npn \prop_split_aux:nnnn #1#2#3#4 { #3 #2 } \cs_new_protected:Npn \prop_split_aux:w { } -\cs_set_protected:Npn \prop_split:Nnn #1#2#3 +\cs_new_protected:Npn \prop_split:Nnn #1#2#3 { \prop_split:NnTF #1 {#2} {#3} @@ -187,21 +187,23 @@ \exp_last_unbraced:Noo \prop_if_in_aux:nwn { \tl_to_str:n {#2} } #1 \tl_to_str:n {#2} \q_prop { } - \q_recursion_tail \q_recursion_stop + \q_recursion_tail + \prg_break_point:n { } } \cs_new:Npn \prop_if_in_aux:nwn #1 \q_prop #2 \q_prop #3 { \str_if_eq:xxTF {#1} {#2} - { \prop_if_in_aux:Nw } + { \prop_if_in_aux:N } { \prop_if_in_aux:nwn {#1} } } -\cs_new:Npn \prop_if_in_aux:Nw #1 #2 \q_recursion_stop +\cs_new:Npn \prop_if_in_aux:N #1 { \if_meaning:w \q_prop #1 \prg_return_true: \else: \prg_return_false: \fi: + \prop_map_break: } \cs_generate_variant:Nn \prop_if_in_p:Nn { NV , No } \cs_generate_variant:Nn \prop_if_in_p:Nn { c , cV , co } @@ -231,7 +233,8 @@ \cs_new_nopar:Npn \prop_map_function:NN #1#2 { \exp_last_unbraced:NNo \prop_map_function_aux:Nwn #2 - #1 \q_recursion_tail \q_prop { } \q_recursion_stop + #1 \q_recursion_tail \q_prop { } + \prg_break_point:n { } } \cs_new:Npn \prop_map_function_aux:Nwn #1 \q_prop #2 \q_prop #3 { @@ -243,47 +246,27 @@ } \cs_generate_variant:Nn \prop_map_function:NN { Nc } \cs_generate_variant:Nn \prop_map_function:NN { c , cc } -\int_new:N \g_prop_map_inline_int \cs_new_protected:Npn \prop_map_inline:Nn #1#2 { - \int_gincr:N \g_prop_map_inline_int - \cs_gset:cpn { prop_map_inline_ \int_use:N \g_prop_map_inline_int :nn } + \int_gincr:N \g_prg_map_int + \cs_gset:cpn { prop_map_inline_ \int_use:N \g_prg_map_int :nn } ##1##2 {#2} - \prop_map_function:Nc #1 - { prop_map_inline_ \int_use:N \g_prop_map_inline_int :nn } - \int_gdecr:N \g_prop_map_inline_int + \exp_last_unbraced:Nco \prop_map_function_aux:Nwn + { prop_map_inline_ \int_use:N \g_prg_map_int :nn } + #1 + \q_recursion_tail \q_prop { } + \prg_break_point:n { \int_gdecr:N \g_prg_map_int } } \cs_generate_variant:Nn \prop_map_inline:Nn { c } -\cs_new_eq:NN \prop_map_break: \use_none_delimit_by_q_recursion_stop:w -\cs_new_eq:NN \prop_map_break:n \use_i_delimit_by_q_recursion_stop:nw -\tl_new:N \l_prop_show_tl +\cs_new_eq:NN \prop_map_break: \prg_map_break: +\cs_new_eq:NN \prop_map_break:n \prg_map_break:n \cs_new_protected_nopar:Npn \prop_show:N #1 { - \prop_if_empty:NTF #1 - { - \iow_term:x { Property~list~\token_to_str:N #1~is~empty } - \tl_show:n { } - } - { - \iow_term:x - { - Property~list~\token_to_str:N #1~ - contains~the~pairs~(without~outer~braces): - } - \tl_set:Nx \l_prop_show_tl - { \prop_map_function:NN #1 \prop_show_aux:nn } - \tl_show:n \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \prop_show_aux:w \l_prop_show_tl } - } - } -\cs_new:Npn \prop_show_aux:nn #1#2 - { - \iow_newline: > \c_space_tl \c_space_tl - \iow_char:N \{ #1 \iow_char:N \} - \c_space_tl \c_space_tl => \c_space_tl \c_space_tl - \iow_char:N \{ \exp_not:n {#2} \iow_char:N \} + \msg_aux_show:Nnx + #1 + { prop } + { \prop_map_function:NN #1 \msg_aux_show:nn } } -\cs_new:Npn \prop_show_aux:w #1 > ~ { } \cs_generate_variant:Nn \prop_show:N { c } \prg_new_protected_conditional:Npnn \prop_pop:NnN #1#2#3 { T , F , TF } { @@ -312,7 +295,8 @@ \cs_new:Npn \prop_map_tokens:Nn #1#2 { \exp_last_unbraced:Nno \prop_map_tokens_aux:nwn {#2} #1 - \q_recursion_tail \q_prop { } \q_recursion_stop + \q_recursion_tail \q_prop { } + \prg_break_point:n { } } \cs_new:Npn \prop_map_tokens_aux:nwn #1 \q_prop #2 \q_prop #3 { diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty b/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty index 3ff98eab3dc..31102e00c73 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3quark.dtx 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3quark.dtx 3014 2011-11-27 06:55:43Z bruno $ {L3 Experimental quarks} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -60,13 +60,13 @@ \quark_new:N \q_recursion_stop \cs_new:Npn \quark_if_recursion_tail_stop:N #1 { - \if_meaning:w #1 \q_recursion_tail + \if_meaning:w \q_recursion_tail #1 \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: } \cs_new:Npn \quark_if_recursion_tail_stop_do:Nn #1 { - \if_meaning:w #1 \q_recursion_tail + \if_meaning:w \q_recursion_tail #1 \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw \else: \exp_after:wN \use_none:n @@ -90,6 +90,19 @@ } \cs_generate_variant:Nn \quark_if_recursion_tail_stop:n { o } \cs_generate_variant:Nn \quark_if_recursion_tail_stop_do:nn { o } +\cs_new:Npn \quark_if_recursion_tail_break:N #1 + { + \if_meaning:w \q_recursion_tail #1 + \exp_after:wN \prg_map_break: + \fi: + } +\cs_new:Npn \quark_if_recursion_tail_break:n #1 + { + \if_int_compare:w \pdftex_strcmp:D + { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero + \exp_after:wN \prg_map_break: + \fi: + } \prg_new_conditional:Nnn \quark_if_nil:N { p, T , F , TF } { \if_meaning:w \q_nil #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty index 0489e8e2378..adfb1684b43 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty @@ -46,14 +46,14 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3seq.dtx 2896 2011-10-09 20:36:50Z joseph $ +\GetIdInfo$Id: l3seq.dtx 3033 2011-12-07 10:12:21Z joseph $ {L3 Experimental sequences and stacks} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: \cs_new:Npn \seq_item:n { - \msg_expandable_error:n { A~sequence~was~used~incorrectly. } + \msg_expandable_kernel_error:nn { seq } { misused } \use_none:n } \tl_new:N \l_seq_tmpa_tl @@ -76,6 +76,38 @@ \cs_new_eq:NN \seq_gset_eq:Nc \tl_gset_eq:Nc \cs_new_eq:NN \seq_gset_eq:cN \tl_gset_eq:cN \cs_new_eq:NN \seq_gset_eq:cc \tl_gset_eq:cc +\cs_new_protected_nopar:Npn \seq_set_split:Nnn + { \seq_set_split_aux:NNnn \tl_set:Nx } +\cs_new_protected_nopar:Npn \seq_gset_split:Nnn + { \seq_set_split_aux:NNnn \tl_gset:Nx } +\cs_new_protected_nopar:Npn \seq_set_split_aux:NNnn #1 #2 #3 #4 + { + \tl_if_empty:nTF {#3} + { #1 #2 { \tl_map_function:nN {#4} \seq_wrap_item:n } } + { + \tl_set:Nn \l_seq_tmpa_tl + { + \seq_set_split_aux_i:w \prg_do_nothing: + #4 + \seq_set_split_aux_end: + } + \tl_replace_all:Nnn \l_seq_tmpa_tl { #3 } + { + \seq_set_split_aux_end: + \seq_set_split_aux_i:w \prg_do_nothing: + } + \tl_set:Nx \l_seq_tmpa_tl { \l_seq_tmpa_tl } + #1 #2 { \l_seq_tmpa_tl } + } + } +\cs_new:Npn \seq_set_split_aux_i:w #1 \seq_set_split_aux_end: + { + \exp_not:N \seq_set_split_aux_ii:w + \exp_args:No \tl_trim_spaces:n {#1} + \exp_not:N \seq_set_split_aux_end: + } +\cs_new:Npn \seq_set_split_aux_ii:w #1 \seq_set_split_aux_end: + { \seq_wrap_item:n {#1} } \cs_new_protected_nopar:Npn \seq_concat:NNN #1#2#3 { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } } \cs_new_protected_nopar:Npn \seq_gconcat:NNN #1#2#3 @@ -98,6 +130,7 @@ \cs_generate_variant:Nn \seq_gput_left:Nn { c , cV , cv , co , cx } \cs_generate_variant:Nn \seq_gput_right:Nn { NV , Nv , No , Nx } \cs_generate_variant:Nn \seq_gput_right:Nn { c , cV , cv , co , cx } +\cs_new:Npn \seq_wrap_item:n #1 { \exp_not:n { \seq_item:n {#1} } } \seq_new:N \l_seq_remove_seq \cs_new_protected:Npn \seq_remove_duplicates:N { \seq_remove_duplicates_aux:NN \seq_set_eq:NN } @@ -133,7 +166,7 @@ \tl_if_eq:NNT \l_seq_tmpa_tl \l_seq_tmpb_tl { \use_none:nn } } - \exp_not:n { \seq_item:n {##1} } + \seq_wrap_item:n {##1} } \tl_set:Nn \l_seq_tmpa_tl {#3} #1 #2 {#2} @@ -159,7 +192,7 @@ } #1 \seq_break:n { \prg_return_false: } - \seq_break_point:n { \group_end: } + \prg_break_point:n { \group_end: } } \cs_new_nopar:Npn \seq_if_in_aux: { \seq_break:n { \prg_return_true: } } \cs_generate_variant:Nn \seq_if_in:NnT { NV , Nv , No , Nx } @@ -172,7 +205,7 @@ { \seq_if_empty_err_break:N #1 \exp_after:wN \seq_get_left_aux:NnwN #1 \q_stop #2 - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_protected:Npn \seq_get_left_aux:NnwN \seq_item:n #1#2 \q_stop #3 { \tl_set:Nn #3 {#1} } @@ -185,7 +218,7 @@ { \seq_if_empty_err_break:N #2 \exp_after:wN \seq_pop_left_aux:NnwNNN #2 \q_stop #1#2#3 - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_protected:Npn \seq_pop_left_aux:NnwNNN \seq_item:n #1#2 \q_stop #3#4#5 { @@ -198,7 +231,7 @@ { \seq_if_empty_err_break:N #1 \seq_get_right_aux:NN #1#2 - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_protected_nopar:Npn \seq_get_right_aux:NN #1#2 { @@ -226,11 +259,11 @@ { \seq_if_empty_err_break:N #2 \seq_pop_right_aux_ii:NNN #1 #2 #3 - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_protected_nopar:Npn \seq_pop_right_aux_ii:NNN #1#2#3 { - \seq_push_item_def:n { \exp_not:n { \seq_item:n {##1} } } + \seq_push_item_def:n { \seq_wrap_item:n {##1} } #1 #2 { \if_false: } \fi: \exp_after:wN \exp_after:wN \exp_after:wN \seq_get_right_loop:nn \exp_after:wN \use_none:n #2 @@ -246,11 +279,10 @@ } \cs_generate_variant:Nn \seq_pop_right:NN { c } \cs_generate_variant:Nn \seq_gpop_right:NN { c } -\cs_new:Npn \seq_break: #1 \seq_break_point:n #2 {#2} -\cs_new:Npn \seq_break:n #1#2 \seq_break_point:n #3 { #3 #1 } -\cs_new_eq:NN \seq_map_break: \seq_break: -\cs_new_eq:NN \seq_map_break:n \seq_break:n -\cs_new_eq:NN \seq_break_point:n \use:n +\cs_new_eq:NN \seq_break: \prg_map_break: +\cs_new_eq:NN \seq_break:n \prg_map_break:n +\cs_new_eq:NN \seq_map_break: \prg_map_break: +\cs_new_eq:NN \seq_map_break:n \prg_map_break:n \cs_new_protected_nopar:Npn \seq_if_empty_err_break:N #1 { \if_meaning:w #1 \c_empty_tl @@ -262,7 +294,7 @@ { \exp_after:wN \seq_map_function_aux:NNn \exp_after:wN #2 #1 { ? \seq_map_break: } { } - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new:Npn \seq_map_function_aux:NNn #1#2#3 { @@ -283,21 +315,21 @@ } \cs_new_protected:Npn \seq_push_item_def_aux: { - \cs_gset_eq:cN { seq_item_ \int_use:N \g_seq_nesting_depth_int :n } + \cs_gset_eq:cN { seq_item_ \int_use:N \g_prg_map_int :n } \seq_item:n - \int_gincr:N \g_seq_nesting_depth_int + \int_gincr:N \g_prg_map_int } \cs_new_protected_nopar:Npn \seq_pop_item_def: { - \int_gdecr:N \g_seq_nesting_depth_int + \int_gdecr:N \g_prg_map_int \cs_gset_eq:Nc \seq_item:n - { seq_item_ \int_use:N \g_seq_nesting_depth_int :n } + { seq_item_ \int_use:N \g_prg_map_int :n } } \cs_new_protected:Npn \seq_map_inline:Nn #1#2 { \seq_push_item_def:n {#2} #1 - \seq_break_point:n { \seq_pop_item_def: } + \prg_break_point:n { \seq_pop_item_def: } } \cs_generate_variant:Nn \seq_map_inline:Nn { c } \cs_new_protected:Npn \seq_map_variable:NNn #1#2#3 @@ -308,7 +340,7 @@ \exp_not:n {#3} } #1 - \seq_break_point:n { \seq_pop_item_def: } + \prg_break_point:n { \seq_pop_item_def: } } \cs_generate_variant:Nn \seq_map_variable:NNn { Nc } \cs_generate_variant:Nn \seq_map_variable:NNn { c , cc } @@ -338,32 +370,13 @@ \cs_new_eq:NN \seq_pop:cN \seq_pop_left:cN \cs_new_eq:NN \seq_gpop:NN \seq_gpop_left:NN \cs_new_eq:NN \seq_gpop:cN \seq_gpop_left:cN -\tl_new:N \l_seq_show_tl \cs_new_protected_nopar:Npn \seq_show:N #1 { - \seq_if_empty:NTF #1 - { - \iow_term:x { Sequence~\token_to_str:N #1~is~empty } - \tl_show:n { } - } - { - \iow_term:x - { - Sequence~\token_to_str:N #1~ - contains~the~items~(without~outer~braces): - } - \tl_set:Nx \l_seq_show_tl - { \seq_map_function:NN #1 \seq_show_aux:n } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \seq_show_aux:w \l_seq_show_tl } - } - } -\cs_new:Npn \seq_show_aux:n #1 - { - \iow_newline: > \c_space_tl \c_space_tl - \iow_char:N \{ \exp_not:n {#1} \iow_char:N \} + \msg_aux_show:Nnx + #1 + { seq } + { \seq_map_function:NN #1 \msg_aux_show:n } } -\cs_new:Npn \seq_show_aux:w #1 > ~ { } \cs_generate_variant:Nn \seq_show:N { c } \cs_new_nopar:Npn \seq_if_empty_break_return_false:N #1 { @@ -378,14 +391,14 @@ \exp_after:wN \seq_get_left_aux:Nw #1 \q_stop #2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \prg_new_protected_conditional:Npnn \seq_get_right:NN #1#2 { T , F , TF } { \seq_if_empty_break_return_false:N #1 \seq_get_right_aux:NN #1#2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \cs_generate_variant:Nn \seq_get_left:NNT { c } \cs_generate_variant:Nn \seq_get_left:NNF { c } @@ -398,28 +411,28 @@ \seq_if_empty_break_return_false:N #1 \exp_after:wN \seq_pop_left_aux:NnwNNN #1 \q_stop \tl_set:Nn #1#2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \prg_new_protected_conditional:Npnn \seq_gpop_left:NN #1#2 { T , F , TF } { \seq_if_empty_break_return_false:N #1 \exp_after:wN \seq_pop_left_aux:NnwNNN #1 \q_stop \tl_gset:Nn #1#2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \prg_new_protected_conditional:Npnn \seq_pop_right:NN #1#2 { T , F , TF } { \seq_if_empty_break_return_false:N #1 \seq_pop_right_aux_ii:NNN \tl_set:Nx #1 #2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \prg_new_protected_conditional:Npnn \seq_gpop_right:NN #1#2 { T , F , TF } { \seq_if_empty_break_return_false:N #1 \seq_pop_right_aux_ii:NNN \tl_gset:Nx #1 #2 \prg_return_true: \seq_break: - \seq_break_point:n { } + \prg_break_point:n { } } \cs_generate_variant:Nn \seq_pop_left:NNT { c } \cs_generate_variant:Nn \seq_pop_left:NNF { c } @@ -457,14 +470,14 @@ #1 { ? \seq_break: } { } - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_nopar:Npn \seq_item_aux:nnn #1#2#3 { \use_none:n #2 \int_compare:nNnTF {#1} = \c_zero { \seq_break:n {#3} } - { \exp_args:Nf \seq_item_aux:nnn { #1 - 1 } } + { \exp_args:Nf \seq_item_aux:nnn { \int_eval:n { #1 - 1 } } } } \cs_generate_variant:Nn \seq_item:Nn { c } \cs_new_nopar:Npn \seq_use:N #1 { \seq_map_function:NN #1 \use:n } @@ -476,7 +489,7 @@ \exp_after:wN #1 #2 { ? \seq_break: } { } - \seq_break_point:n { } + \prg_break_point:n { } } \cs_new_nopar:Npn \seq_mapthread_function_aux:NN #1#2 { @@ -515,64 +528,31 @@ \tl_gset:Nx #1 { \clist_map_function:nN {#2} \seq_wrap_item:n } } -\cs_new:Npn \seq_wrap_item:n #1 { \exp_not:n { \seq_item:n {#1} } } \cs_generate_variant:Nn \seq_set_from_clist:NN { Nc } \cs_generate_variant:Nn \seq_set_from_clist:NN { c , cc } \cs_generate_variant:Nn \seq_set_from_clist:Nn { c } \cs_generate_variant:Nn \seq_gset_from_clist:NN { Nc } \cs_generate_variant:Nn \seq_gset_from_clist:NN { c , cc } \cs_generate_variant:Nn \seq_gset_from_clist:Nn { c } -\cs_new_protected_nopar:Npn \seq_tmp:w - { \msg_expandable_error:n { There~is~a~bug~in~LaTeX3! } } -\cs_new_protected_nopar:Npn \seq_set_reverse:N +\cs_new_protected_nopar:Npn \seq_tmp:w { } +\cs_new_protected_nopar:Npn \seq_reverse:N { \seq_reverse_aux:NN \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_reverse:N +\cs_new_protected_nopar:Npn \seq_greverse:N { \seq_reverse_aux:NN \tl_gset:Nx } \cs_new_protected_nopar:Npn \seq_reverse_aux:NN #1 #2 { \cs_set_eq:NN \seq_tmp:w \seq_item:n - \cs_set_eq:NN \seq_item:n \seq_reverse_aux_item:w - #1 #2 { #2 \prg_do_nothing: } + \cs_set_eq:NN \seq_item:n \seq_reverse_aux_item:nwn + #1 #2 { #2 \exp_not:n { } } \cs_set_eq:NN \seq_item:n \seq_tmp:w } -\cs_new:Npn \seq_reverse_aux_item:w #1 #2 \prg_do_nothing: +\cs_new:Npn \seq_reverse_aux_item:nwn #1 #2 \exp_not:n #3 { #2 - \prg_do_nothing: - \exp_not:n { \seq_item:n {#1} } - } -\cs_new_protected_nopar:Npn \seq_set_split:Nnn - { \seq_set_split_aux:NNnn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_split:Nnn - { \seq_set_split_aux:NNnn \tl_gset:Nx } -\cs_new_protected_nopar:Npn \seq_set_split_aux:NNnn #1 #2 #3 #4 - { - \tl_if_empty:nTF {#4} - { #1 #2 { } } - { - \tl_set:Nn \l_seq_tmpa_tl - { - \seq_set_split_aux_i:w \prg_do_nothing: - #4 - \seq_set_split_aux_end: - } - \tl_replace_all:Nnn \l_seq_tmpa_tl { #3 } - { - \seq_set_split_aux_end: - \seq_set_split_aux_i:w \prg_do_nothing: - } - \tl_set:Nx \l_seq_tmpa_tl { \l_seq_tmpa_tl } - #1 #2 { \l_seq_tmpa_tl } - } - } -\cs_new:Npn \seq_set_split_aux_i:w #1 \seq_set_split_aux_end: - { - \exp_not:N \seq_set_split_aux_ii:w - \exp_args:No \tl_trim_spaces:n {#1} - \exp_not:N \seq_set_split_aux_end: + \exp_not:n { \seq_item:n {#1} #3 } } -\cs_new:Npn \seq_set_split_aux_ii:w #1 \seq_set_split_aux_end: - { \exp_not:n { \seq_item:n {#1} } } +\cs_generate_variant:Nn \seq_reverse:N { c } +\cs_generate_variant:Nn \seq_greverse:N { c } %% %% %% End of file `l3seq.sty'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty index 605733e8580..40bcb9caad3 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty @@ -46,8 +46,9 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3skip.dtx 2959 2011-11-14 21:47:18Z joseph $ +\GetIdInfo$Id: l3skip.dtx 3029 2011-12-06 22:47:30Z joseph $ {L3 Experimental dimensions and skips} + \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: @@ -224,6 +225,8 @@ \cs_generate_variant:Nn \dim_use:N { c } \cs_new_eq:NN \dim_show:N \kernel_register_show:N \cs_generate_variant:Nn \dim_show:N { c } +\cs_new_protected:Npn \dim_show:n #1 + { \tex_showthe:D \dim_eval:w #1 \dim_eval_end: } \cs_new_eq:NN \c_zero_dim \z@ \cs_new_eq:NN \c_max_dim \maxdimen \dim_new:N \l_tmpa_dim @@ -296,6 +299,8 @@ \cs_generate_variant:Nn \skip_vertical:N { c } \cs_new_eq:NN \skip_show:N \kernel_register_show:N \cs_generate_variant:Nn \skip_show:N { c } +\cs_new_protected:Npn \skip_show:n #1 + { \tex_showthe:D \etex_glueexpr:D #1 \scan_stop: } \cs_new_eq:NN \c_zero_skip \c_zero_dim \cs_new_eq:NN \c_max_skip \c_max_dim \skip_new:N \l_tmpa_skip @@ -341,6 +346,8 @@ \cs_generate_variant:Nn \muskip_use:N { c } \cs_new_eq:NN \muskip_show:N \kernel_register_show:N \cs_generate_variant:Nn \muskip_show:N { c } +\cs_new_protected:Npn \muskip_show:n #1 + { \tex_showthe:D \etex_muexpr:D #1 \scan_stop: } \cs_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4 { \skip_if_infinite_glue:nTF {#1} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty index cd04f11ddb4..f22f7bd8d66 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty @@ -46,8 +46,10 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3tl.dtx 2929 2011-10-22 13:00:20Z bruno $ +\GetIdInfo$Id: l3tl.dtx 3034 2011-12-07 11:40:25Z bruno $ {L3 Experimental token lists} + + \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: @@ -69,6 +71,7 @@ } \cs_generate_variant:Nn \tl_const:Nn { c } \cs_generate_variant:Nn \tl_const:Nx { c } +\tl_const:Nn \c_empty_tl { } \cs_new_protected_nopar:Npn \tl_clear:N #1 { \tl_set_eq:NN #1 \c_empty_tl } \cs_new_protected_nopar:Npn \tl_gclear:N #1 @@ -188,27 +191,10 @@ \c_tl_rescan_marker_tl { \tl_set:Nn \exp_not:N \l_tl_rescan_tl {##1} } } -\cs_generate_variant:Nn \tl_set_rescan:Nnn { Nno } -\cs_generate_variant:Nn \tl_set_rescan:Nnn { c , cno } -\cs_generate_variant:Nn \tl_gset_rescan:Nnn { Nno } +\cs_generate_variant:Nn \tl_set_rescan:Nnn { Nno , Nnx } +\cs_generate_variant:Nn \tl_set_rescan:Nnn { c , cno , cnx } +\cs_generate_variant:Nn \tl_gset_rescan:Nnn { Nno , Nnx } \cs_generate_variant:Nn \tl_gset_rescan:Nnn { c , cno } -\cs_new_protected_nopar:Npn \tl_set_rescan:Nnx - { \tl_set_rescan_aux:NNnx \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_rescan:Nnx - { \tl_set_rescan_aux:NNnx \tl_gset:Nn } -\cs_new_protected_nopar:Npn \tl_set_rescan_aux:NNnx #1#2#3#4 - { - \group_begin: - \etex_everyeof:D { \exp_not:N } - \tex_endlinechar:D \c_minus_one - \tex_newlinechar:D \c_minus_one - #3 - \tl_set:Nx \l_tl_rescan_tl { \etex_scantokens:D {#4} } - \exp_args:NNNo \group_end: - #1 #2 \l_tl_rescan_tl - } -\cs_generate_variant:Nn \tl_set_rescan:Nnx { c } -\cs_generate_variant:Nn \tl_gset_rescan:Nnx { c } \cs_new_protected:Npn \tl_rescan:nn #1#2 { \group_begin: @@ -371,63 +357,59 @@ \cs_generate_variant:Nn \tl_if_in:nnF { V , o , no } \cs_generate_variant:Nn \tl_if_in:nnTF { V , o , no } \cs_new:Npn \tl_map_function:nN #1#2 - { \tl_map_function_aux:Nn #2 #1 \q_recursion_tail \q_recursion_stop } -\cs_new_nopar:Npn \tl_map_function:NN #1#2 { - \exp_after:wN \tl_map_function_aux:Nn - \exp_after:wN #2 #1 \q_recursion_tail \q_recursion_stop + \tl_map_function_aux:Nn #2 #1 + \q_recursion_tail + \prg_break_point:n { } } +\cs_new_nopar:Npn \tl_map_function:NN + { \exp_args:No \tl_map_function:nN } \cs_new:Npn \tl_map_function_aux:Nn #1#2 { - \quark_if_recursion_tail_stop:n {#2} + \quark_if_recursion_tail_break:n {#2} #1 {#2} \tl_map_function_aux:Nn #1 } \cs_generate_variant:Nn \tl_map_function:NN { c } \cs_new_protected:Npn \tl_map_inline:nn #1#2 { - \int_gincr:N \g_tl_inline_level_int - \cs_gset:cpn { tl_map_inline_ \int_use:N \g_tl_inline_level_int :n } + \int_gincr:N \g_prg_map_int + \cs_gset:cpn { tl_map_inline_ \int_use:N \g_prg_map_int :n } ##1 {#2} \exp_args:Nc \tl_map_function_aux:Nn - { tl_map_inline_ \int_use:N \g_tl_inline_level_int :n } - #1 \q_recursion_tail \q_recursion_stop - \int_gdecr:N \g_tl_inline_level_int - } -\cs_new_protected:Npn \tl_map_inline:Nn #1#2 - { - \int_gincr:N \g_tl_inline_level_int - \cs_gset:cpn { tl_map_inline_ \int_use:N \g_tl_inline_level_int :n } - ##1 {#2} - \exp_last_unbraced:NcV \tl_map_function_aux:Nn - { tl_map_inline_ \int_use:N \g_tl_inline_level_int :n } - #1 \q_recursion_tail\q_recursion_stop - \int_gdecr:N \g_tl_inline_level_int + { tl_map_inline_ \int_use:N \g_prg_map_int :n } + #1 \q_recursion_tail + \prg_break_point:n { \int_gdecr:N \g_prg_map_int } } +\cs_new_protected:Npn \tl_map_inline:Nn + { \exp_args:No \tl_map_inline:nn } \cs_generate_variant:Nn \tl_map_inline:Nn { c } \cs_new_protected:Npn \tl_map_variable:nNn #1#2#3 - { \tl_map_variable_aux:Nnn #2 {#3} #1 \q_recursion_tail \q_recursion_stop } + { + \tl_map_variable_aux:Nnn #2 {#3} #1 + \q_recursion_tail + \prg_break_point:n { } + } \cs_new_protected_nopar:Npn \tl_map_variable:NNn { \exp_args:No \tl_map_variable:nNn } \cs_new_protected:Npn \tl_map_variable_aux:Nnn #1#2#3 { \tl_set:Nn #1 {#3} - \quark_if_recursion_tail_stop:N #1 - #2 \tl_map_variable_aux:Nnn #1 {#2} + \quark_if_recursion_tail_break:N #1 + \use:n {#2} + \tl_map_variable_aux:Nnn #1 {#2} } \cs_generate_variant:Nn \tl_map_variable:NNn { c } -\cs_new_eq:NN \tl_map_break: \use_none_delimit_by_q_recursion_stop:w +\cs_new_eq:NN \tl_map_break: \prg_map_break: +\cs_new_eq:NN \tl_map_break:n \prg_map_break:n \cs_new_eq:NN \tl_to_str:n \etex_detokenize:D \cs_new_nopar:Npn \tl_to_str:N #1 { \etex_detokenize:D \exp_after:wN {#1} } \cs_generate_variant:Nn \tl_to_str:N { c } -\cs_new_eq:NN \tl_use:N \prg_do_nothing: -\cs_new_nopar:Npn \tl_use:c #1 +\cs_new_nopar:Npn \tl_use:N #1 { - \if_cs_exist:w #1 \cs_end: - \cs:w #1 \exp_after:wN \cs_end: - \else: - \msg_expandable_error:n { Undefined~variable~name~'#1'! } - \fi: + \cs_if_exist:NTF #1 {#1} + { \msg_expandable_kernel_error:nnn { kernel } { bad-var } {#1} } } +\cs_generate_variant:Nn \tl_use:N { c } \cs_new:Npn \tl_length:n #1 { \int_eval:n @@ -438,17 +420,24 @@ \int_eval:n { 0 \tl_map_function:NN #1 \tl_length_aux:n } } -\cs_new:Npn \tl_length_aux:n #1 { + 1 } +\cs_new:Npn \tl_length_aux:n #1 { + \c_one } \cs_generate_variant:Nn \tl_length:n { V , o } \cs_generate_variant:Nn \tl_length:N { c } \cs_new:Npn \tl_reverse_items:n #1 - { \tl_reverse_items_aux:nw #1 \q_recursion_tail \q_recursion_stop } -\cs_new:Npn \tl_reverse_items_aux:nw #1 #2 \q_recursion_stop { - \quark_if_recursion_tail_stop_do:nn {#1} { \use_none:n } - \tl_reverse_items_aux:nw #2 \q_recursion_stop - {#1} + \tl_reverse_items_aux:nwNwn #1 ? + \q_mark \tl_reverse_items_aux:nwNwn + \q_mark \tl_reverse_items_aux:wn + \q_stop { } + } +\cs_new:Npn \tl_reverse_items_aux:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5 + { + #3 #2 + \q_mark \tl_reverse_items_aux:nwNwn + \q_mark \tl_reverse_items_aux:wn + \q_stop { {#1} #5 } } +\cs_new:Npn \tl_reverse_items_aux:wn #1 \q_stop #2 { \use_none:nn #2 } \cs_set:Npn \tl_tmp:w #1 { \cs_new:Npn \tl_trim_spaces:n ##1 @@ -603,27 +592,20 @@ } \prg_new_conditional:Npnn \tl_if_head_space:n #1 { p , T , F , TF } { - \if_int_compare:w - \pdftex_strcmp:D - { } - { \tl_if_head_space_aux:w \prg_do_nothing: #1 ? ~ } - = \c_zero - \prg_return_true: - \else: - \prg_return_false: - \fi: + \tex_romannumeral:D \if_false: { \fi: + \tl_if_head_space_aux:w ? #1 ? ~ } } -\cs_new:Npn \tl_if_head_space_aux:w #1 ~ % +\cs_new:Npn \tl_if_head_space_aux:w #1 ~ { - \exp_not:o {#1} - \if_false: { \fi: } + \tl_if_empty:oTF { \use_none:n #1 } + { \exp_after:wN \c_zero \exp_after:wN \prg_return_true: } + { \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_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 \tl_const:Nx \c_job_name_tl { \tex_jobname:D } -\tl_const:Nn \c_empty_tl { } \tl_const:Nn \c_space_tl { ~ } \tl_new:N \g_tmpa_tl \tl_new:N \g_tmpb_tl @@ -733,8 +715,11 @@ { \tl_act_reverse_output:n { {#2} } } \cs_generate_variant:Nn \tl_reverse:n { o , V } \cs_new_protected_nopar:Npn \tl_reverse:N #1 - { \tl_set:No #1 { \etex_unexpanded:D \tl_reverse:o { #1 { } } } } -\cs_generate_variant:Nn \tl_reverse:N { c } + { \tl_set:Nf #1 { \tl_reverse:o { #1 \exp_stop_f: } } } +\cs_new_protected_nopar:Npn \tl_greverse:N #1 + { \tl_gset:Nf #1 { \tl_reverse:o { #1 \exp_stop_f: } } } +\cs_generate_variant:Nn \tl_reverse:N { c } +\cs_generate_variant:Nn \tl_greverse:N { c } \cs_new:Npn \tl_length_tokens:n #1 { \int_eval:n @@ -786,6 +771,30 @@ \exp_after:wN \tl_act_output:n \exp_after:wN { \exp_after:wN { \tex_romannumeral:D \tl_act_case_aux:nn {#1} {#2} } } } +\cs_new:Npn \tl_item:nn #1#2 + { + \exp_args:Nf \tl_item_aux:nn + { + \int_eval:n + { + \int_compare:nNnT {#2} < \c_zero + { \tl_length:n {#1} + } + #2 + } + } + #1 + \q_recursion_tail + \prg_break_point:n { } + } +\cs_new_nopar:Npn \tl_item_aux:nn #1#2 + { + \quark_if_recursion_tail_break:n {#2} + \int_compare:nNnTF {#1} = \c_zero + { \tl_map_break:n {#2} } + { \exp_args:Nf \tl_item_aux:nn { \int_eval:n { #1 - 1 } } } + } +\cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn } +\cs_generate_variant:Nn \tl_item:Nn { c } %% %% %% End of file `l3tl.sty'. -- cgit v1.2.3