diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-23 17:14:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-23 17:14:27 +0000 |
commit | f7855c12c18bb97b7b9e49ab685ee558d8c0b47b (patch) | |
tree | 9196e768b98b68b7ea8eb5fbdf45508d766f4056 /Master/texmf-dist/tex/latex/l3experimental/l3dt | |
parent | c47bc266846cc8bf776d79f1f54140443a8269a3 (diff) |
l3 3990
git-svn-id: svn://tug.org/texlive/trunk@27107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3dt')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty | 316 |
1 files changed, 155 insertions, 161 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty b/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty index 99bd83e7764..a672181b903 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty @@ -47,21 +47,20 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: l3dt.dtx 3459 2012-02-26 08:58:53Z joseph $ +\GetIdInfo$Id: l3dt.dtx 3877 2012-06-30 22:24:42Z joseph $ {L3 Experimental data tables} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\package_check_loaded_expl: -\quark_new:N \q_dt -\quark_new:N \q_dt_row -\quark_new:N \q_dt_header +\quark_new:N \q__dt +\quark_new:N \q__dt_row +\quark_new:N \q__dt_header \tl_const:Nn \c_empty_dt { { 0 } - \q_dt + \q__dt \q_nil - \q_dt_header - \q_dt_row + \q__dt_header + \q__dt_row } \cs_new_protected:Npn \dt_new:N #1 { \cs_new_eq:NN #1 \c_empty_dt } \cs_new_protected:Npn \dt_clear:N #1 { \cs_set_eq:NN #1 \c_empty_dt } @@ -76,168 +75,166 @@ \dt_new:N \l_tmpb_dt \dt_new:N \g_tmpa_dt \dt_new:N \g_tmpb_dt -\cs_new_protected:Npn \dt_split_aux:nnnn #1#2#3#4 { #3 #2 } -\cs_new_protected:Npn \dt_split_aux:w { } -\cs_new:Npn \dt_split_header:NT #1#2 - { \exp_after:wN \dt_split_header_aux:wn #1 \q_stop {#2} } -\cs_new:Npn \dt_split_header_aux:wn #1 \q_nil \q_dt_header #2 \q_stop #3 - { #3 {#1} { \q_dt_header #2 } } -\cs_new_protected:Npn \dt_split_key:nnTF #1#2 - { \exp_args:No \dt_split_key_aux:nnTF { \tl_to_str:n {#2} } {#1} } -\cs_new_protected:Npn \dt_split_key_aux:nnTF #1#2 - { - \cs_set_protected:Npn \dt_split_aux:w - ##1 \q_dt #1 \q_dt ##2##3##4 \q_mark ##5 \q_stop - { \dt_split_aux:nnnn ##3 { { ##1 \q_dt } {##2} {##4} } } - \dt_split_aux:w #2 \q_mark - \q_dt #1 \q_dt { } { ? \use_ii:nn { } } \q_mark \q_stop - } -\cs_new_protected:Npn \dt_split_key_list:NnTF #1#2 - { \exp_args:NNo \dt_split_key_list_aux:NnTF #1 { \tl_to_str:n {#2} } } -\cs_new_protected:Npn \dt_split_key_list_aux:NnTF #1#2 - { - \cs_set_protected:Npn \dt_split_aux:w - ##1##2 \q_dt #2 \q_dt ##3##4 \q_dt_header ##5 \q_mark ##6 \q_stop +\cs_new_protected:Npn \__dt_split:nnnn #1#2#3#4 { #3 #2 } +\cs_new_protected:Npn \__dt_split:w { } +\cs_new:Npn \__dt_split_header:NT #1#2 + { \exp_after:wN \__dt_split_header:wn #1 \q_stop {#2} } +\cs_new:Npn \__dt_split_header:wn #1 \q_nil \q__dt_header #2 \q_stop #3 + { #3 {#1} { \q__dt_header #2 } } +\cs_new_protected:Npn \__dt_split_key:nnTF #1#2 + { \exp_args:No \__dt_split_key_aux:nnTF { \tl_to_str:n {#2} } {#1} } +\cs_new_protected:Npn \__dt_split_key_aux:nnTF #1#2 + { + \cs_set_protected:Npn \__dt_split:w + ##1 \q__dt #1 \q__dt ##2##3##4 \q_mark ##5 \q_stop + { \__dt_split:nnnn ##3 { { ##1 \q__dt } {##2} {##4} } } + \__dt_split:w #2 \q_mark + \q__dt #1 \q__dt { } { ? \use_ii:nn { } } \q_mark \q_stop + } +\cs_new_protected:Npn \__dt_split_key_list:NnTF #1#2 + { \exp_args:NNo \__dt_split_key_list_aux:NnTF #1 { \tl_to_str:n {#2} } } +\cs_new_protected:Npn \__dt_split_key_list_aux:NnTF #1#2 + { + \cs_set_protected:Npn \__dt_split:w + ##1##2 \q__dt #2 \q__dt ##3##4 \q__dt_header ##5 \q_mark ##6 \q_stop { - \dt_split_aux:nnnn ##3 - { { {##1} ##2 \q_dt } { ##3##4 \q_dt_header ##5 } } + \__dt_split:nnnn ##3 + { { {##1} ##2 \q__dt } { ##3##4 \q__dt_header ##5 } } } - \exp_after:wN \dt_split_aux:w #1 \q_mark - \q_dt #2 \q_dt { ? \use_ii:nn { } } \q_dt_header \q_mark \q_stop + \exp_after:wN \__dt_split:w #1 \q_mark + \q__dt #2 \q__dt { ? \use_ii:nn { } } \q__dt_header \q_mark \q_stop } -\cs_new_protected:Npn \dt_split_row:NnTF #1#2 - { \dt_split_row_aux:NfTF #1 { \int_eval:n {#2} } } -\cs_new_protected:Npn \dt_split_row_aux:NnTF #1#2 +\cs_new_protected:Npn \__dt_split_row:NnTF #1#2 + { \__dt_split_row_aux:NfTF #1 { \int_eval:n {#2} } } +\cs_new_protected:Npn \__dt_split_row_aux:NnTF #1#2 { - \cs_set_protected:Npn \dt_split_aux:w - ##1 \q_dt_row #2 \q_dt ##2##3 \q_dt_row ##4 \q_mark ##5 \q_stop + \cs_set_protected:Npn \__dt_split:w + ##1 \q__dt_row #2 \q__dt ##2##3 \q__dt_row ##4 \q_mark ##5 \q_stop { - \dt_split_aux:nnnn ##2 - { { ##1 \q_dt_row } { #2 \q_dt ##2##3 } {##4} } + \__dt_split:nnnn ##2 + { { ##1 \q__dt_row } { #2 \q__dt ##2##3 } {##4} } } - \exp_after:wN \dt_split_aux:w #1 \q_mark - \q_dt_row #2 \q_dt { ? \use_ii:nn { } } \q_dt_row \q_mark \q_stop + \exp_after:wN \__dt_split:w #1 \q_mark + \q__dt_row #2 \q__dt { ? \use_ii:nn { } } \q__dt_row \q_mark \q_stop } -\cs_generate_variant:Nn \dt_split_row_aux:NnTF { Nf } -\cs_new_protected_nopar:Npn \dt_add_key:Nn { \dt_add_key_aux:NNn \tl_set:Nx } -\cs_new_protected_nopar:Npn \dt_gadd_key:Nn { \dt_add_key_aux:NNn \tl_gset:Nx } -\cs_new_protected:Npn \dt_add_key_aux:NNn #1#2#3 +\cs_generate_variant:Nn \__dt_split_row_aux:NnTF { Nf } +\cs_new_protected_nopar:Npn \dt_add_key:Nn { \__dt_add_key:NNn \tl_set:Nx } +\cs_new_protected_nopar:Npn \dt_gadd_key:Nn { \__dt_add_key:NNn \tl_gset:Nx } +\cs_new_protected:Npn \__dt_add_key:NNn #1#2#3 { - \dt_split_key_list:NnTF #2 {#3} + \__dt_split_key_list:NnTF #2 {#3} { \use_none:nn } { - \dt_split_header:NT #2 - { \dt_add_key_aux:NNnnn #1 #2 {#3} } + \__dt_split_header:NT #2 + { \__dt_add_key:NNnnn #1 #2 {#3} } } } -\cs_new_protected:Npn \dt_add_key_aux:NNnnn #1#2#3#4#5 +\cs_new_protected:Npn \__dt_add_key:NNnnn #1#2#3#4#5 { #1 #2 { \exp_not:n {#4} \tl_to_str:n {#3} - \exp_not:n { \q_dt \q_nil #5 } + \exp_not:n { \q__dt \q_nil #5 } } } -\cs_new_protected_nopar:Npn \dt_add_row:N { \dt_add_row_aux:NN \tl_set:Nx } -\cs_new_protected_nopar:Npn \dt_gadd_row:N { \dt_add_row_aux:NN \tl_gset:Nx } -\cs_new_protected:Npn \dt_add_row_aux:NN #1#2 - { \exp_args:NNf \dt_add_row_aux:NnN #1 { \dt_rows:N #2 } #2 } -\cs_new_protected:Npn \dt_add_row_aux:NnN #1#2#3 +\cs_new_protected_nopar:Npn \dt_add_row:N { \__dt_add_row:NN \tl_set:Nx } +\cs_new_protected_nopar:Npn \dt_gadd_row:N { \__dt_add_row:NN \tl_gset:Nx } +\cs_new_protected:Npn \__dt_add_row:NN #1#2 + { \exp_args:NNf \__dt_add_row:NnN #1 { \dt_rows:N #2 } #2 } +\cs_new_protected:Npn \__dt_add_row:NnN #1#2#3 { #1 #3 { { \int_eval:n { #2 + \c_one } } - \exp_after:wN \dt_add_row_aux:nw #3 \q_stop + \exp_after:wN \__dt_add_row:nw #3 \q_stop #2 - \exp_not:n { \q_dt \q_nil \q_dt_row } + \exp_not:n { \q__dt \q_nil \q__dt_row } } } -\cs_new:Npn \dt_add_row_aux:nw #1#2 \q_stop { \exp_not:n {#2} } +\cs_new:Npn \__dt_add_row:nw #1#2 \q_stop { \exp_not:n {#2} } \cs_new_protected:Npn \dt_put:Nnn #1 { \dt_put:Nnnn #1 { \dt_rows:N #1 - \c_one } } \cs_new_protected:Npn \dt_gput:Nnn #1 { \dt_gput:Nnnn #1 { \dt_rows:N #1 - \c_one } } \cs_new_protected_nopar:Npn \dt_put:Nnnn - { \dt_put_aux:NNNnnn \dt_add_key:Nn \tl_set:Nx } + { \__dt_put:NNNnnn \dt_add_key:Nn \tl_set:Nx } \cs_new_protected_nopar:Npn \dt_gput:Nnnn - { \dt_put_aux:NNNnnn \dt_gadd_key:Nn \tl_gset:Nx } -\cs_new_protected:Npn \dt_put_aux:NNNnnn #1#2#3#4#5#6 + { \__dt_put:NNNnnn \dt_gadd_key:Nn \tl_gset:Nx } +\cs_new_protected:Npn \__dt_put:NNNnnn #1#2#3#4#5#6 { #1 #3 {#5} - \dt_split_row:NnTF #3 {#4} - { \dt_put_aux:NNnnnnn #2 #3 {#5} {#6} } + \__dt_split_row:NnTF #3 {#4} + { \__dt_put:NNnnnnn #2 #3 {#5} {#6} } { - \msg_kernel_error:nnxxx { dt } { unknown-row } + \__msg_kernel_error:nnxxx { dt } { unknown-row } { \token_to_str:N #3 } { \int_eval:n {#4} } { \dt_rows:N #3 } } } -\cs_new_protected:Npn \dt_put_aux:NNnnnnn #1#2#3#4#5#6#7 +\cs_new_protected:Npn \__dt_put:NNnnnnn #1#2#3#4#5#6#7 { - \dt_split_key:nnTF {#6} {#3} - { \dt_put_update:NNnnnnnnn #1 #2 {#3} {#4} {#5} {#7} } - { \dt_put_add_to_row:NNnnnnn #1 #2 {#3} {#4} {#5} {#6} {#7} } + \__dt_split_key:nnTF {#6} {#3} + { \__dt_put_update:NNnnnnnnn #1 #2 {#3} {#4} {#5} {#7} } + { \__dt_put_add_to_row:NNnnnnn #1 #2 {#3} {#4} {#5} {#6} {#7} } } -\cs_new_protected:Npn \dt_put_update:NNnnnnnnn #1#2#3#4#5#6#7#8#9 +\cs_new_protected:Npn \__dt_put_update:NNnnnnnnn #1#2#3#4#5#6#7#8#9 { #1 #2 { \exp_not:n { #5 #7 } \tl_to_str:n {#3} - \exp_not:n { \q_dt {#4} \q_dt #9 \q_dt_row #6 } + \exp_not:n { \q__dt {#4} \q__dt #9 \q__dt_row #6 } } } -\cs_new_protected:Npn \dt_put_add_to_row:NNnnnnn #1#2#3#4#5#6#7 +\cs_new_protected:Npn \__dt_put_add_to_row:NNnnnnn #1#2#3#4#5#6#7 { #1 #2 { \exp_not:n {#5} - \exp_not:o { \dt_put_add_row_aux:w #6 } + \exp_not:o { \__dt_put_add_to_row_aux:w #6 } \tl_to_str:n {#3} - \exp_not:n { \q_dt {#4} \q_dt \q_nil \q_dt_row #7 } + \exp_not:n { \q__dt {#4} \q__dt \q_nil \q__dt_row #7 } } } -\cs_new:Npn \dt_put_add_row_aux:w #1 \q_nil {#1} +\cs_new:Npn \__dt_put_add_to_row_aux:w #1 \q_nil {#1} \cs_new:Npn \dt_keys:N #1 - { \dt_split_header:NT #1 { \dt_keys_aux:nn } } -\cs_new:Npn \dt_keys_aux:nn #1#2 + { \__dt_split_header:NT #1 { \__dt_keys:nn } } +\cs_new:Npn \__dt_keys:nn #1#2 { \int_eval:n { 0 - \exp_after:wN \dt_keys_aux:wN \use_none:nn #1 \q_recursion_tail \q_dt - \prg_break_point:n { } + \exp_after:wN \__dt_keys:wN \use_none:nn #1 \q_recursion_tail \q__dt + \__prg_break_point:Nn \dt_map_break: { } } } -\cs_new:Npn \dt_keys_aux:wN #1 \q_dt +\cs_new:Npn \__dt_keys:wN #1 \q__dt { - \if_meaning:w \q_recursion_tail #1 - \exp_after:wN \prg_map_break: - \fi: + \__quark_if_recursion_tail_break:nN {#1} \dt_map_break: +1 - \dt_keys_aux:wN + \__dt_keys:wN } \cs_new:Npn \dt_rows:N #1 { \exp_after:wN \use_i_delimit_by_q_stop:nw #1 \q_stop } -\cs_new_protected:Npn \dt_del:Nn #1 { \dt_del:Nnn #1 +\cs_new_protected:Npn \dt_remove:Nn #1 { \dt_remove:Nnn #1 { \dt_rows:N #1 - \c_one } } -\cs_new_protected:Npn \dt_gdel:Nn #1 { \dt_gdel:Nnn #1 +\cs_new_protected:Npn \dt_gremove:Nn #1 { \dt_gremove:Nnn #1 { \dt_rows:N #1 - \c_one } } -\cs_new_protected_nopar:Npn \dt_del:Nnn { \dt_del_aux:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \dt_gdel:Nnn { \dt_del_aux:NNnn \tl_gset:Nn } -\cs_new_protected:Npn \dt_del_aux:NNnn #1#2#3#4 +\cs_new_protected_nopar:Npn \dt_remove:Nnn { \dt_remove_aux:NNnn \tl_set:Nn } +\cs_new_protected_nopar:Npn \dt_gremove:Nnn { \dt_remove_aux:NNnn \tl_gset:Nn } +\cs_new_protected:Npn \dt_remove_aux:NNnn #1#2#3#4 { - \dt_split_row:NnTF #2 {#3} - { \dt_del_aux:NNnnnn #1 #2 {#4} } + \__dt_split_row:NnTF #2 {#3} + { \dt_remove_aux:NNnnnn #1 #2 {#4} } { } } -\cs_new_protected:Npn \dt_del_aux:NNnnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \dt_remove_aux:NNnnnn #1#2#3#4#5#6 { - \dt_split_key:nnTF {#5} {#3} - { \dt_del_aux:NNnnnnn #1 #2 {#4} {#6} } + \__dt_split_key:nnTF {#5} {#3} + { \dt_remove_aux:NNnnnnn #1 #2 {#4} {#6} } { } } -\cs_new_protected:Npn \dt_del_aux:NNnnnnn #1#2#3#4#5#6#7 +\cs_new_protected:Npn \dt_remove_aux:NNnnnnn #1#2#3#4#5#6#7 { #1 #2 { #3 #5 #7 #4 } } \cs_new_protected_nopar:Npn \dt_remove_key:Nn { \dt_remove_key_aux:NNn \tl_set:Nx } @@ -245,25 +242,23 @@ { \dt_remove_key_aux:NNn \tl_gset:Nx } \cs_new_protected:Npn \dt_remove_key_aux:NNn #1#2#3 { - \dt_split_key_list:NnTF #2 {#3} + \__dt_split_key_list:NnTF #2 {#3} { \exp_args:No \dt_remove_key_aux:nNNnn { \tl_to_str:n {#3} } #1 #2 } { } } \cs_new_protected:Npn \dt_remove_key_aux:nNNnn #1#2#3#4#5 { - \cs_set:Npn \dt_remove_key_aux:w ##1 \q_dt #1 \q_dt ##2 ##3 + \cs_set:Npn \dt_remove_key_aux:w ##1 \q__dt #1 \q__dt ##2 ##3 { \exp_not:n {##1} - \if_meaning:w \q_recursion_tail ##3 - \exp_after:wN \prg_map_break: - \fi: + \__quark_if_recursion_tail_break:nN {##3} \dt_map_break: \dt_remove_key_aux:w ##3 } #2 #3 { \exp_not:n {#4} - \dt_remove_key_aux:w #5 \q_dt #1 \q_dt { } \q_recursion_tail - \prg_break_point:n { } + \dt_remove_key_aux:w #5 \q__dt #1 \q__dt { } \q_recursion_tail + \__prg_break_point:Nn \dt_map_break: { } } } \cs_new:Npn \dt_remove_key_aux:w { } @@ -273,7 +268,7 @@ { \dt_remove_row_aux:NNn \tl_gset:Nx } \cs_new_protected:Npn \dt_remove_row_aux:NNn #1#2#3 { - \dt_split_row:NnTF #2 {#3} + \__dt_split_row:NnTF #2 {#3} { \dt_remove_row_aux:NNnnn #1 #2 } { } } @@ -283,46 +278,44 @@ { { \int_eval:n { \dt_rows:N #2 - \c_one } } \dt_remove_row_aux:nw #3 \q_stop - \dt_remove_row_loop:nw #5 \q_recursion_tail \q_dt_row - \prg_break_point:n { } + \dt_remove_row_loop:nw #5 \q_recursion_tail \q__dt_row + \__prg_break_point:Nn \dt_map_break: { } } } -\cs_new_eq:NN \dt_remove_row_aux:nw \dt_add_row_aux:nw -\cs_new:Npn \dt_remove_row_loop:nw #1#2 \q_dt_row +\cs_new_eq:NN \dt_remove_row_aux:nw \__dt_add_row:nw +\cs_new:Npn \dt_remove_row_loop:nw #1#2 \q__dt_row { - \if_meaning:w \q_recursion_tail #1 - \exp_after:wN \prg_map_break: - \fi: + \__quark_if_recursion_tail_break:nN {#1} \dt_map_break: \int_eval:n { #1 - \c_one } - \exp_not:n { #2 \q_dt_row } + \exp_not:n { #2 \q__dt_row } \dt_remove_row_loop:nw } \cs_new_protected:Npn \dt_get:NnnN #1#2#3#4 { - \dt_split_row:NnTF #1 {#2} + \__dt_split_row:NnTF #1 {#2} { \dt_get_aux:nNnnn {#3} #4 } { \tl_set:Nn #4 { \q_no_value } } } \cs_new_protected:Npn \dt_get_aux:nNnnn #1#2#3#4#5 { - \dt_split_key:nnTF {#4} {#1} + \__dt_split_key:nnTF {#4} {#1} { \dt_get_aux:Nnnn #2 } { \tl_set:Nn #2 { \q_no_value } } } \cs_new_protected:Npn \dt_get_aux:Nnnn #1#2#3#4 { \tl_set:Nn #1 {#3} } \prg_new_protected_conditional:Npnn \dt_get:NnnN #1#2#3#4 { T , F , TF } { - \dt_split_row:NnTF #1 {#2} - { \dt_get_aux_true:nNnnn {#3} #4 } + \__dt_split_row:NnTF #1 {#2} + { \__dt_get_true:nNnnn {#3} #4 } { \prg_return_false: } } -\cs_new_protected:Npn \dt_get_aux_true:nNnnn #1#2#3#4#5 +\cs_new_protected:Npn \__dt_get_true:nNnnn #1#2#3#4#5 { - \dt_split_key:nnTF {#4} {#1} - { \dt_get_aux_true:Nnnn #2 } + \__dt_split_key:nnTF {#4} {#1} + { \__dt_get_true:Nnnn #2 } { \prg_return_false: } } -\cs_new_protected:Npn \dt_get_aux_true:Nnnn #1#2#3#4 +\cs_new_protected:Npn \__dt_get_true:Nnnn #1#2#3#4 { \tl_set:Nn #1 {#3} \prg_return_true: @@ -340,36 +333,37 @@ { \int_gincr:N \g_dt_map_level_int \seq_gclear_new:c { g_dt_map_ \int_use:N \g_dt_map_level_int _seq } - \keyval_parse:NNn \use_none:n \dt_map_variables_key:nn {#2} - \dt_split_header:NT #1 { \dt_map_variables_aux:nnn {#3} } + \keyval_parse:NNn \use_none:n \__dt_map_variables_key:nn {#2} + \__dt_split_header:NT #1 { \__dt_map_variables:nnn {#3} } } -\cs_new_protected:Npn \dt_map_variables_key:nn #1#2 +\cs_new_protected:Npn \__dt_map_variables_key:nn #1#2 { \seq_gput_right:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq } { {#1} #2 } } -\cs_new_protected:Npn \dt_map_variables_aux:nnn #1#2#3 - { \dt_map_variables_aux:nNNw {#1} #3 \q_stop } -\cs_new_protected:Npn \dt_map_variables_aux:nNNw - #1 \q_dt_header \q_dt_row #2 \q_stop +\cs_new_protected:Npn \__dt_map_variables:nnn #1#2#3 + { \__dt_map_variables:nNNw {#1} #3 \q_stop } +\cs_new_protected:Npn \__dt_map_variables:nNNw + #1 \q__dt_header \q__dt_row #2 \q_stop { \int_zero_new:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int } - \dt_map_variables_aux:nnw {#1} #2 { } \q_recursion_tail \q_dt_row - \prg_break_point:n { \int_gdecr:N \g_dt_map_level_int } + \__dt_map_variables:nnw {#1} #2 { } \q_recursion_tail \q__dt_row + \__prg_break_point:Nn \dt_map_break: + { \int_gdecr:N \g_dt_map_level_int } } -\cs_new_protected:Npn \dt_map_variables_aux:nnw #1#2#3#4 \q_dt_row +\cs_new_protected:Npn \__dt_map_variables:nnw #1#2#3#4 \q__dt_row { - \if_meaning:w \q_recursion_tail #3 - \exp_after:wN \dt_map_break: - \fi: + \__quark_if_recursion_tail_break:nN {#3} \dt_map_break: \seq_map_inline:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq } { \dt_get_aux:nNnnn ##1 { } {#3#4} { } } #1 \int_incr:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int } - \dt_map_variables_aux:nnw {#1} + \__dt_map_variables:nnw {#1} } -\cs_new_eq:NN \dt_map_break: \prg_map_break: -\cs_new_eq:NN \dt_map_break:n \prg_map_break:n +\cs_new_nopar:Npn \dt_map_break: + { \__prg_map_break:Nn \dt_map_break: { } } +\cs_new_nopar:Npn \dt_map_break:n + { \__prg_map_break:Nn \dt_map_break: } \prg_new_conditional:Npnn \dt_if_empty:N #1 { T , F , TF , p } { \if_meaning:w #1 \c_empty_dt @@ -379,36 +373,36 @@ \fi: } \prg_new_conditional:Npnn \dt_if_in:Nn #1#2 { p , T , F , TF } - { \dt_split_header:NT #1 { \dt_if_in_aux:nnn {#2} } } -\cs_new:Npn \dt_if_in_aux:nnn #1#2#3 + { \__dt_split_header:NT #1 { \__dt_if_in:nnn {#2} } } +\cs_new:Npn \__dt_if_in:nnn #1#2#3 { - \exp_last_unbraced:Nno \dt_if_in_aux:nwN {#1} { \use_none:nn #2 } - \q_recursion_tail \q_dt - \prg_break_point:n { } + \exp_last_unbraced:Nno \__dt_if_in:nwN {#1} { \use_none:nn #2 } + \q_recursion_tail \q__dt + \__prg_break_point: } -\cs_new:Npn \dt_if_in_aux:nwN #1#2 \q_dt +\cs_new:Npn \__dt_if_in:nwN #1#2 \q__dt { \if_meaning:w \q_recursion_tail #2 - \exp_after:wN \prg_map_break:n + \exp_after:wN \__prg_break:n \else: \exp_after:wN \use_none:n \fi: { \prg_return_false: } \str_if_eq:nnTF {#1} {#2} - { \prg_map_break:n { \prg_return_true: } } - { \dt_if_in_aux:nwN {#1} } + { \__prg_break:n { \prg_return_true: } } + { \__dt_if_in:nwN {#1} } } \prg_new_conditional:Npnn \dt_if_in_row:Nnn #1#2#3 { p , T , F , TF } { - \exp_last_unbraced:Nno \dt_if_in_row_aux:nw {#2} #1 + \exp_last_unbraced:Nno \__dt_if_in_row:nw {#2} #1 \q_recursion_tail \q_nil - \prg_break_point:n { } + \__prg_break_point: { \tl_to_str:n {#3} } } -\cs_new:Npn \dt_if_in_row_aux:nw #1#2 \q_dt_row #3#4 \q_nil +\cs_new:Npn \__dt_if_in_row:nw #1#2 \q__dt_row #3#4 \q_nil { \if_meaning:w \q_recursion_tail #3 - \exp_after:wN \prg_map_break:n + \exp_after:wN \__prg_break:n \else: \exp_after:wN \use_none:n \fi: @@ -417,28 +411,28 @@ \prg_return_false: } \int_compare:nNnTF {#1} = {#3} - { \prg_map_break:n { \exp_args:Nno \dt_if_in_row_aux:nn {#4} } } - { \dt_if_in_row_aux:nw {#1} } + { \__prg_break:n { \exp_args:Nno \__dt_if_in_row:nn {#4} } } + { \__dt_if_in_row:nw {#1} } } -\cs_new:Npn \dt_if_in_row_aux:nn #1#2 +\cs_new:Npn \__dt_if_in_row:nn #1#2 { - \dt_if_in_row_aux:nwn {#2} #1 {#2} \q_dt { } \q_recursion_tail - \prg_break_point:n { } + \__dt_if_in_row:nwn {#2} #1 {#2} \q__dt { } \q_recursion_tail + \__prg_break_point: } -\cs_new:Npn \dt_if_in_row_aux:nwn #1 \q_dt #2 \q_dt #3 +\cs_new:Npn \__dt_if_in_row:nwn #1 \q__dt #2 \q__dt #3 { \str_if_eq:xxTF {#1} {#2} - { \dt_if_in_row_aux:N } - { \dt_if_in_row_aux:nwn {#1} } + { \__dt_if_in_row:N } + { \__dt_if_in_row:nwn {#1} } } -\cs_new:Npn \dt_if_in_row_aux:N #1 +\cs_new:Npn \__dt_if_in_row:N #1 { - \if_meaning:w \q_dt #1 + \if_meaning:w \q__dt #1 \prg_return_true: \else: \prg_return_false: \fi: - \prg_map_break: + \__prg_break: } \cs_new:Npn \dt_if_in_row_p:Nn #1 { \dt_if_in_row_p:Nnn #1 { \dt_rows:N #1 - \c_one } } @@ -448,7 +442,7 @@ { \dt_rows:N #1 - \c_one } } \cs_new:Npn \dt_if_in_row:NnTF #1 { \dt_if_in_row:NnnTF #1 { \dt_rows:N #1 - \c_one } } -\msg_kernel_new:nnnn { dt } { unknown-row } +\__msg_kernel_new:nnnn { dt } { unknown-row } { Data~table~#1~does~not~contain~a~row~'#2'. } { Data~table~#1~contains~#3~rows.~These~must~be~accessed~by~number:~row~ |