diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3prop.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3prop.sty | 187 |
1 files changed, 81 insertions, 106 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty index 916ff713332..85cff451ddb 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty @@ -13,7 +13,7 @@ %% %% Do not distribute a modified version of this file. %% -%% File: l3prop.dtx Copyright (C) 1990-2012 The LaTeX3 Project +%% File: l3prop.dtx Copyright (C) 1990-2013 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,25 +46,24 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3prop.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3prop.dtx 4423 2013-01-09 00:05:30Z bruno $ {L3 Property lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__expl_package_check: -\quark_new:N \q__prop -\tl_const:Nn \c_empty_prop { \q__prop } -\cs_new_protected:Npn \prop_new:N #1 { \cs_new_eq:NN #1 \c_empty_prop } -\cs_new_protected:Npn \prop_new:c #1 { \cs_new_eq:cN {#1} \c_empty_prop } -\cs_new_protected:Npn \prop_clear:N #1 { \cs_set_eq:NN #1 \c_empty_prop } -\cs_generate_variant:Nn \prop_clear:N { c } -\cs_new_protected:Npn \prop_gclear:N #1 { \cs_gset_eq:NN #1 \c_empty_prop } -\cs_generate_variant:Nn \prop_gclear:N { c } -\cs_new_protected:Npn \prop_clear_new:N #1 - { \prop_if_exist:NTF #1 { \prop_clear:N #1 } { \prop_new:N #1 } } -\cs_generate_variant:Nn \prop_clear_new:N { c } -\cs_new_protected:Npn \prop_gclear_new:N #1 - { \prop_if_exist:NTF #1 { \prop_gclear:N #1 } { \prop_new:N #1 } } -\cs_generate_variant:Nn \prop_gclear_new:N { c } +\__scan_new:N \s__prop +\tl_new:N \l__prop_internal_tl +\cs_new_eq:NN \c_empty_prop \c_empty_tl +\cs_new_eq:NN \prop_new:N \tl_new:N +\cs_new_eq:NN \prop_new:c \tl_new:c +\cs_new_eq:NN \prop_clear:N \tl_clear:N +\cs_new_eq:NN \prop_clear:c \tl_clear:c +\cs_new_eq:NN \prop_gclear:N \tl_gclear:N +\cs_new_eq:NN \prop_gclear:c \tl_gclear:c +\cs_new_eq:NN \prop_clear_new:N \tl_clear_new:N +\cs_new_eq:NN \prop_clear_new:c \tl_clear_new:c +\cs_new_eq:NN \prop_gclear_new:N \tl_gclear_new:N +\cs_new_eq:NN \prop_gclear_new:c \tl_gclear_new: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 @@ -79,22 +78,27 @@ \prop_new:N \g_tmpb_prop \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 +\cs_new_protected:Npn \__prop_split_aux:NnTF #1#2#3#4 { - \cs_set_protected:Npn \__prop_split_aux:w - ##1 \q__prop #2 \q__prop ##2 ##3 ##4 \q_mark ##5 \q_stop - { \__prop_split_aux:nnnn ##3 { {##1 \q__prop } {##2} {##4} } } - \exp_after:wN \__prop_split_aux:w #1 \q_mark - \q__prop #2 \q__prop { } { ? \use_ii:nn { } } \q_mark \q_stop + \cs_set:Npn \__prop_split_aux:w ##1 + \s__prop #2 \s__prop ##2 ##3 \q_mark ##4 ##5 \q_stop + { ##4 {#3} {#4} } + \exp_after:wN \__prop_split_aux:w #1 \q_mark \use_i:nn + \s__prop #2 \s__prop { } \q_mark \use_ii:nn \q_stop } -\cs_new:Npn \__prop_split_aux:nnnn #1#2#3#4 { #3 #2 } -\cs_new_protected:Npn \__prop_split_aux:w { } +\cs_new:Npn \__prop_split_aux:w { } \cs_new_protected:Npn \prop_remove:Nn #1#2 - { \__prop_split:NnTF #1 {#2} { \__prop_remove:NNnnn \tl_set:Nn #1 } { } } + { + \__prop_split:NnTF #1 {#2} + { \tl_set:Nn #1 { ##1 ##3 } } + { } + } \cs_new_protected:Npn \prop_gremove:Nn #1#2 - { \__prop_split:NnTF #1 {#2} { \__prop_remove:NNnnn \tl_gset:Nn #1 } { } } -\cs_new_protected:Npn \__prop_remove:NNnnn #1#2#3#4#5 - { #1 #2 { #3 #5 } } + { + \__prop_split:NnTF #1 {#2} + { \tl_gset:Nn #1 { ##1 ##3 } } + { } + } \cs_generate_variant:Nn \prop_remove:Nn { NV } \cs_generate_variant:Nn \prop_remove:Nn { c , cV } \cs_generate_variant:Nn \prop_gremove:Nn { NV } @@ -102,30 +106,29 @@ \cs_new_protected:Npn \prop_get:NnN #1#2#3 { \__prop_split:NnTF #1 {#2} - { \__prop_get:Nnnn #3 } + { \tl_set:Nn #3 {##2} } { \tl_set:Nn #3 { \q_no_value } } } -\cs_new_protected:Npn \__prop_get:Nnnn #1#2#3#4 - { \tl_set:Nn #1 {#3} } \cs_generate_variant:Nn \prop_get:NnN { NV , No } \cs_generate_variant:Nn \prop_get:NnN { c , cV , co } \cs_new_protected:Npn \prop_pop:NnN #1#2#3 { \__prop_split:NnTF #1 {#2} - { \__prop_pop:NNNnnn \tl_set:Nn #1 #3 } + { + \tl_set:Nn #3 {##2} + \tl_set:Nn #1 { ##1 ##3 } + } { \tl_set:Nn #3 { \q_no_value } } } \cs_new_protected:Npn \prop_gpop:NnN #1#2#3 { \__prop_split:NnTF #1 {#2} - { \__prop_pop:NNNnnn \tl_gset:Nn #1 #3 } + { + \tl_set:Nn #3 {##2} + \tl_gset:Nn #1 { ##1 ##3 } + } { \tl_set:Nn #3 { \q_no_value } } } -\cs_new_protected:Npn \__prop_pop:NNNnnn #1#2#3#4#5#6 - { - \tl_set:Nn #3 {#5} - #1 #2 { #4 #6 } - } \cs_generate_variant:Nn \prop_pop:NnN { No } \cs_generate_variant:Nn \prop_pop:NnN { c , co } \cs_generate_variant:Nn \prop_gpop:NnN { No } @@ -133,45 +136,40 @@ \prg_new_protected_conditional:Npnn \prop_pop:NnN #1#2#3 { T , F , TF } { \__prop_split:NnTF #1 {#2} - { \__prop_pop_true:NNNnnn \tl_set:Nn #1 #3 } + { + \tl_set:Nn #3 {##2} + \tl_set:Nn #1 { ##1 ##3 } + \prg_return_true: + } { \prg_return_false: } } \prg_new_protected_conditional:Npnn \prop_gpop:NnN #1#2#3 { T , F , TF } { \__prop_split:NnTF #1 {#2} - { \__prop_pop_true:NNNnnn \tl_gset:Nn #1 #3 } + { + \tl_set:Nn #3 {##2} + \tl_gset:Nn #1 { ##1 ##3 } + \prg_return_true: + } { \prg_return_false: } } -\cs_new_protected:Npn \__prop_pop_true:NNNnnn #1#2#3#4#5#6 - { - \tl_set:Nn #3 {#5} - #1 #2 { #4 #6 } - \prg_return_true: - } \cs_generate_variant:Nn \prop_pop:NnNT { c } \cs_generate_variant:Nn \prop_pop:NnNF { c } \cs_generate_variant:Nn \prop_pop:NnNTF { c } \cs_generate_variant:Nn \prop_gpop:NnNT { c } \cs_generate_variant:Nn \prop_gpop:NnNF { c } \cs_generate_variant:Nn \prop_gpop:NnNTF { c } -\cs_new_protected:Npn \prop_put:Nnn +\cs_new_protected_nopar:Npn \prop_put:Nnn { \__prop_put:NNNnn \tl_set:Nx \tl_put_right:Nx } -\cs_new_protected:Npn \prop_gput:Nnn +\cs_new_protected_nopar:Npn \prop_gput:Nnn { \__prop_put:NNNnn \tl_gset:Nx \tl_gput_right:Nx } \cs_new_protected:Npn \__prop_put:NNNnn #1#2#3#4#5 { + \tl_set:Nn \l__prop_internal_tl + { \s__prop \tl_to_str:n {#4} \s__prop { \exp_not:n {#5} } } \__prop_split:NnTF #3 {#4} - { \__prop_put:NNnnnnn #1 #3 {#4} {#5} } - { #2 #3 { \tl_to_str:n {#4} \exp_not:n { \q__prop {#5} \q__prop } } } - } -\cs_new_protected:Npn \__prop_put:NNnnnnn #1#2#3#4#5#6#7 - { - #1 #2 - { - \exp_not:n {#5} - \tl_to_str:n {#3} \exp_not:n { \q__prop {#4} \q__prop } - \exp_not:n {#7} - } + { #1 #3 { \exp_not:n {##1} \l__prop_internal_tl \exp_not:n {##3} } } + { #2 #3 { \l__prop_internal_tl } } } \cs_generate_variant:Nn \prop_put:Nnn { NnV , Nno , Nnx , NV , NVV , No , Noo } @@ -187,44 +185,29 @@ { \__prop_put_if_new:NNnn \tl_gput_right:Nx } \cs_new_protected:Npn \__prop_put_if_new:NNnn #1#2#3#4 { + \tl_set:Nn \l__prop_internal_tl + { \s__prop \tl_to_str:n {#3} \s__prop \exp_not:n { {#4} } } \__prop_split:NnTF #2 {#3} - { \use_none:nnn } - { - #1 #2 - { \tl_to_str:n {#3} \exp_not:n { \q__prop {#4} \q__prop } } - } + { } + { #1 #2 { \l__prop_internal_tl } } } \cs_generate_variant:Nn \prop_put_if_new:Nnn { c } \cs_generate_variant:Nn \prop_gput_if_new:Nnn { c } -\cs_new_eq:NN \prop_if_exist:NTF \cs_if_exist:NTF -\cs_new_eq:NN \prop_if_exist:NT \cs_if_exist:NT -\cs_new_eq:NN \prop_if_exist:NF \cs_if_exist:NF -\cs_new_eq:NN \prop_if_exist_p:N \cs_if_exist_p:N -\cs_new_eq:NN \prop_if_exist:cTF \cs_if_exist:cTF -\cs_new_eq:NN \prop_if_exist:cT \cs_if_exist:cT -\cs_new_eq:NN \prop_if_exist:cF \cs_if_exist:cF -\cs_new_eq:NN \prop_if_exist_p:c \cs_if_exist_p:c -\prg_new_conditional:Npnn \prop_if_empty:N #1 { p, T , F , TF } - { - \if_meaning:w #1 \c_empty_prop - \prg_return_true: - \else: - \prg_return_false: - \fi: - } -\cs_generate_variant:Nn \prop_if_empty_p:N {c} -\cs_generate_variant:Nn \prop_if_empty:NTF {c} -\cs_generate_variant:Nn \prop_if_empty:NT {c} -\cs_generate_variant:Nn \prop_if_empty:NF {c} +\prg_new_eq_conditional:NNn \prop_if_exist:N \cs_if_exist:N { TF , T , F , p } +\prg_new_eq_conditional:NNn \prop_if_exist:c \cs_if_exist:c { TF , T , F , p } +\prg_new_eq_conditional:NNn \prop_if_empty:N \tl_if_empty:N + { p , T , F , TF } +\prg_new_eq_conditional:NNn \prop_if_empty:c \tl_if_empty:c + { p , T , F , TF } \prg_new_conditional:Npnn \prop_if_in:Nn #1#2 { p , T , F , TF } { \exp_last_unbraced:Noo \__prop_if_in:nwn { \tl_to_str:n {#2} } #1 - \tl_to_str:n {#2} \q__prop { } - \q_recursion_tail % could be any cs != \q__prop + \s__prop \tl_to_str:n {#2} \s__prop { } + \q_recursion_tail \__prg_break_point: } -\cs_new:Npn \__prop_if_in:nwn #1 \q__prop #2 \q__prop #3 +\cs_new:Npn \__prop_if_in:nwn #1 \s__prop #2 \s__prop #3 { \str_if_eq_x:nnTF {#1} {#2} { \__prop_if_in:N } @@ -232,7 +215,7 @@ } \cs_new:Npn \__prop_if_in:N #1 { - \if_meaning:w \q__prop #1 + \if_meaning:w \s__prop #1 \prg_return_true: \else: \prg_return_false: @@ -250,14 +233,12 @@ \prg_new_protected_conditional:Npnn \prop_get:NnN #1#2#3 { T , F , TF } { \__prop_split:NnTF #1 {#2} - { \__prop_get_true:Nnnn #3 } + { + \tl_set:Nn #3 {##2} + \prg_return_true: + } { \prg_return_false: } } -\cs_new_protected:Npn \__prop_get_true:Nnnn #1#2#3#4 - { - \tl_set:Nn #1 {#3} - \prg_return_true: - } \cs_generate_variant:Nn \prop_get:NnNT { NV , No } \cs_generate_variant:Nn \prop_get:NnNF { NV , No } \cs_generate_variant:Nn \prop_get:NnNTF { NV , No } @@ -267,12 +248,14 @@ \cs_new:Npn \prop_map_function:NN #1#2 { \exp_last_unbraced:NNo \__prop_map_function:Nwn #2 - #1 \q_recursion_tail \q__prop { } + #1 \s__prop \q_recursion_tail \s__prop { } \__prg_break_point:Nn \prop_map_break: { } } -\cs_new:Npn \__prop_map_function:Nwn #1 \q__prop #2 \q__prop #3 +\cs_new:Npn \__prop_map_function:Nwn #1 \s__prop #2 \s__prop #3 { - \__quark_if_recursion_tail_break:nN {#2} \prop_map_break: + \if_meaning:w \q_recursion_tail #2 + \exp_after:wN \prop_map_break: + \fi: #1 {#2} {#3} \__prop_map_function:Nwn #1 } @@ -285,7 +268,7 @@ \exp_last_unbraced:Nco \__prop_map_function:Nwn { __prg_map_ \int_use:N \g__prg_map_int :w } #1 - \q_recursion_tail \q__prop { } + \s__prop \q_recursion_tail \s__prop { } \__prg_break_point:Nn \prop_map_break: { \int_gdecr:N \g__prg_map_int } } \cs_generate_variant:Nn \prop_map_inline:Nn { c } @@ -299,14 +282,6 @@ { \prop_map_function:NN #1 \__msg_show_item:nn } } \cs_generate_variant:Nn \prop_show:N { c } -\cs_new_eq:NN \prop_del:Nn \prop_remove:Nn -\cs_new_eq:NN \prop_del:NV \prop_remove:NV -\cs_new_eq:NN \prop_del:cn \prop_remove:cn -\cs_new_eq:NN \prop_del:cV \prop_remove:cV -\cs_new_eq:NN \prop_gdel:Nn \prop_gremove:Nn -\cs_new_eq:NN \prop_gdel:NV \prop_gremove:NV -\cs_new_eq:NN \prop_gdel:cn \prop_gremove:cn -\cs_new_eq:NN \prop_gdel:cV \prop_gremove:cV %% %% %% End of file `l3prop.sty'. |