diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx index 3237dc3aaa4..10eea3278f4 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx @@ -547,13 +547,24 @@ \cs_new:Npn \seq_format:Nn #1#2 { \tl_to_str:f - { \@@_seq:of {#1} { \@@_parse:n {#2} } } + { + \@@_seq:ff { \exp_after:wN \@@_seq_extract:w #1 } + { \@@_parse:n {#2} } + } } \cs_generate_variant:Nn \seq_format:Nn { c } % \end{macrocode} % \end{macro} % -% \begin{macro}[aux, EXP]{\@@_seq:nn, \@@_seq:of} +% \begin{macro}[aux, rEXP]{\@@_seq_extract:w} +% Extract the contents of a sequence as items of the form +% |\__seq_item:n| \Arg{item}. +% \begin{macrocode} +\cs_new:Npn \@@_seq_extract:w \s__seq #1 \s_obj_end { \exp_stop_f: #1 } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[aux, EXP]{\@@_seq:nn, \@@_seq:ff} % The first argument is the contents of a \texttt{seq} variable. The % second is a parsed \meta{format specification}. Set up the loop. % \begin{macrocode} @@ -563,7 +574,7 @@ #1 { ? \@@_seq_end:w } { } } -\cs_generate_variant:Nn \@@_seq:nn { of } +\cs_generate_variant:Nn \@@_seq:nn { ff } % \end{macrocode} % \end{macro} % @@ -644,7 +655,7 @@ \int_compare:nNnTF {#7} < \c_zero { \@@_put:nw { - } } { - \str_case:nnn {#3} + \str_case:nnF {#3} { { ~ } { \@@_put:ow { \c_catcode_other_space_tl } } { + } { \@@_put:nw { + } } @@ -657,7 +668,7 @@ \__msg_kernel_expandable_error:nnnn { str } { invalid-precision-format } {#5} {int} } - \str_case:nnn {#6} + \str_case:nnF {#6} { { ? } { \@@_int:NwnnNNn \use:n } { d } { \@@_int:NwnnNNn \use:n } @@ -757,7 +768,7 @@ \token_if_eq_meaning:NNTF 2 #8 { \@@_put:nw { - } } { - \str_case:nnn {#3} + \str_case:nnF {#3} { { ~ } { \@@_put:ow { \c_catcode_other_space_tl } } { + } { \@@_put:nw { + } } @@ -768,7 +779,7 @@ \tl_if_empty:nTF {#5} { \@@_put:nw { { 6} } } { \@@_put:nw { {#5} } } - \str_case:nnn {#6} + \str_case:nnF {#6} { { e } { \@@_fp:wnnnNNw \@@_fp_e:wn } { f } { \@@_fp:wnnnNNw \@@_fp_f:wn } @@ -828,7 +839,7 @@ \group_end: \cs_new:Npn \@@_fp_e:wn \s__fp \__fp_chk:w #1#2#3 ; #4 { - \int_case:nnn {#1} + \int_case:nnF {#1} { {0} { \use:nf { 0 . } { \prg_replicate:nn {#4} { 0 } } e 0 } {2} { inf } @@ -869,7 +880,7 @@ % \begin{macrocode} \cs_new:Npn \@@_fp_f:wn \s__fp \__fp_chk:w #1#2#3 ; #4 { - \int_case:nnn {#1} + \int_case:nnF {#1} { {0} { \use:nf { 0 . } { \prg_replicate:nn {#4} { 0 } } } {2} { inf } @@ -907,7 +918,7 @@ % \begin{macrocode} \cs_new:Npn \@@_fp_g:wn \s__fp \__fp_chk:w #1#2 ; #3 { - \int_case:nnn {#1} + \int_case:nnF {#1} { {0} { 0 } {2} { inf } |