diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-06 21:49:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-06 21:49:18 +0000 |
commit | 905323115107c182a860bca6a036889f4fc7f36f (patch) | |
tree | 6c869d6ae5c9e922ab2e2d5e490ff94a21c0eba5 /Master/texmf-dist/tex/latex/l3experimental/l3str | |
parent | f050c0a04305c67056475697fe6f1131c2b4bc9e (diff) |
l3experimental
git-svn-id: svn://tug.org/texlive/trunk@47633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3str')
9 files changed, 143 insertions, 150 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty index 711e7bcd2d2..e2a1f762f08 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-convert.sty @@ -20,7 +20,7 @@ %% %% File: l3str-convert.dtx Copyright (C) 2013-2018 The LaTeX3 Project \RequirePackage{expl3} -\ProvidesExplPackage{l3str-convert}{2018/03/05}{} +\ProvidesExplPackage{l3str-convert}{2018-04-30}{} {L3 Experimental string encoding conversions} \cs_if_exist:NF \use_ii_i:nn { \cs_new:Npn \use_ii_i:nn #1#2 { #2 #1 } } @@ -52,14 +52,14 @@ \prg_new_conditional:Npnn \__str_if_contains_char:NN #1#2 { T , TF } { \exp_after:wN \__str_if_contains_char_aux:NN \exp_after:wN #2 - #1 { \__prg_break:n { ? \fi: } } - \__prg_break_point: + #1 { \prg_break:n { ? \fi: } } + \prg_break_point: \prg_return_false: } \prg_new_conditional:Npnn \__str_if_contains_char:nN #1#2 { TF } { - \__str_if_contains_char_aux:NN #2 #1 { \__prg_break:n { ? \fi: } } - \__prg_break_point: + \__str_if_contains_char_aux:NN #2 #1 { \prg_break:n { ? \fi: } } + \prg_break_point: \prg_return_false: } \cs_new:Npn \__str_if_contains_char_aux:NN #1#2 @@ -70,7 +70,7 @@ \__str_if_contains_char_aux:NN #1 } \cs_new:Npn \__str_if_contains_char_true: - { \__prg_break:n { \prg_return_true: \use_none:n } } + { \prg_break:n { \prg_return_true: \use_none:n } } \prg_new_conditional:Npnn \__str_octal_use:N #1 { TF } { \if_int_compare:w 1 < '1 \token_to_str:N #1 \exp_stop_f: @@ -84,9 +84,7 @@ \if_int_compare:w 1 < "1 \token_to_str:N #1 \exp_stop_f: #1 \prg_return_true: \else: - \if_case:w \__int_eval:w - \exp_after:wN ` \token_to_str:N #1 - `a - \__int_eval_end: + \if_case:w \int_eval:n { \exp_after:wN ` \token_to_str:N #1 - `a } A \or: B \or: C @@ -118,18 +116,16 @@ { \exp_after:wN \exp_after:wN \exp_after:wN \use_i:nnn - \cs:w c__str_byte_ \__int_value:w \__int_eval:w + \cs:w c__str_byte_ \int_eval:w } \cs_new:Npn \__str_output_hexadecimal:n #1 - { \__str_output_hexadecimal:w #1 \__str_output_end: } -\cs_new:Npn \__str_output_hexadecimal:w { \exp_after:wN \exp_after:wN \exp_after:wN \use_none:n - \cs:w c__str_byte_ \__int_value:w \__int_eval:w + \cs:w c__str_byte_ \int_eval:n {#1} _tl \cs_end: } \cs_new:Npn \__str_output_end: - { \__int_eval_end: _tl \cs_end: } + { \scan_stop: _tl \cs_end: } \cs_new:Npn \__str_output_byte_pair_be:n #1 { \exp_args:Nf \__str_output_byte_pair:nnN @@ -152,8 +148,8 @@ { \exp_after:wN \__str_convert_gmap_loop:NN \exp_after:wN #1 - \g__str_result_tl { ? \__prg_break: } - \__prg_break_point: + \g__str_result_tl { ? \prg_break: } + \prg_break_point: } } \cs_new:Npn \__str_convert_gmap_loop:NN #1#2 @@ -168,8 +164,8 @@ { \exp_after:wN \__str_convert_gmap_internal_loop:Nww \exp_after:wN #1 - \g__str_result_tl \s__tl \q_stop \__prg_break: \s__tl - \__prg_break_point: + \g__str_result_tl \s__tl \q_stop \prg_break: \s__tl + \prg_break_point: } } \cs_new:Npn \__str_convert_gmap_internal_loop:Nww #1 #2 \s__tl #3 \s__tl @@ -214,7 +210,7 @@ { \group_begin: #1 - \tl_gset:Nx \g__str_result_tl { \__str_to_other_fast:n {#4} } + \tl_gset:Nx \g__str_result_tl { \__kernel_str_to_other_fast:n {#4} } \exp_after:wN \__str_convert:wwwnn \tl_to_str:n {#5} /// \q_stop { decode } { unescape } @@ -286,8 +282,8 @@ \cs_new:Npn \__str_convert_lowercase_alphanum:n #1 { \exp_after:wN \__str_convert_lowercase_alphanum_loop:N - \tl_to_str:n {#1} { ? \__prg_break: } - \__prg_break_point: + \tl_to_str:n {#1} { ? \prg_break: } + \prg_break_point: } \cs_new:Npn \__str_convert_lowercase_alphanum_loop:N #1 { @@ -336,8 +332,8 @@ \cs_new:Npn \__str_filter_bytes:n #1 { \__str_filter_bytes_aux:N #1 - { ? \__prg_break: } - \__prg_break_point: + { ? \prg_break: } + \prg_break_point: } \cs_new:Npn \__str_filter_bytes_aux:N #1 { @@ -372,57 +368,43 @@ \cs_new_protected:Npn \__str_convert_decode_: { \__str_convert_gmap:N \__str_decode_native_char:N } \cs_new:Npn \__str_decode_native_char:N #1 - { #1 \s__tl \__int_value:w `#1 \s__tl } -\group_begin: - \char_set_catcode_other:n { 0 } - \bool_lazy_any:nTF - { - \sys_if_engine_luatex_p: - \sys_if_engine_xetex_p: - } - { - \cs_new_protected:Npn \__str_convert_encode_: - { - \__tl_gbuild_x:Nw \g__str_result_tl - \exp_after:wN \__str_encode_native_loop:w - \g__str_result_tl \s__tl { \q_stop \__prg_break: } \s__tl - \__prg_break_point: - \__tl_build_end: - } - \cs_new_protected:Npn \__str_encode_native_loop:w #1 \s__tl #2 \s__tl - { - \use_none_delimit_by_q_stop:w #2 \q_stop - \exp_args:Nx \__tl_build_one:n - { \char_generate:nn {#2} {12} } - \__str_encode_native_loop:w - } - } - { - \cs_new_protected:Npn \__str_convert_encode_: - { - \flag_clear:n { str_error } - \__str_convert_gmap_internal:N \__str_encode_native_char:n - \__str_if_flag_error:nnx { str_error } - { pdfTeX-native-overflow } { } - } - \cs_new:Npn \__str_encode_native_char:n #1 - { - \if_int_compare:w #1 > \c__str_max_byte_int - \flag_raise:n { str_error } - ? - \else: - \__str_output_byte:n {#1} - \fi: - } - \__kernel_msg_new:nnnn { str } { pdfTeX-native-overflow } - { Character~code~too~large~for~pdfTeX. } - { - The~pdfTeX~engine~only~supports~8-bit~characters:~ - valid~character~codes~are~in~the~range~[0,255].~ - To~manipulate~arbitrary~Unicode,~use~LuaTeX~or~XeTeX. - } - } -\group_end: + { #1 \s__tl \int_value:w `#1 \s__tl } +\bool_lazy_any:nTF + { + \sys_if_engine_luatex_p: + \sys_if_engine_xetex_p: + } + { + \cs_new_protected:Npn \__str_convert_encode_: + { \__str_convert_gmap_internal:N \__str_encode_native_char:n } + \cs_new:Npn \__str_encode_native_char:n #1 + { \char_generate:nn {#1} {12} } + } + { + \cs_new_protected:Npn \__str_convert_encode_: + { + \flag_clear:n { str_error } + \__str_convert_gmap_internal:N \__str_encode_native_char:n + \__str_if_flag_error:nnx { str_error } + { native-overflow } { } + } + \cs_new:Npn \__str_encode_native_char:n #1 + { + \if_int_compare:w #1 > \c__str_max_byte_int + \flag_raise:n { str_error } + ? + \else: + \char_generate:nn {#1} {12} + \fi: + } + \__kernel_msg_new:nnnn { str } { native-overflow } + { Character~code~too~large~for~this~engine. } + { + This~engine~only~support~8-bit~characters:~ + valid~character~codes~are~in~the~range~[0,255].~ + To~manipulate~arbitrary~Unicode,~use~LuaTeX~or~XeTeX. + } + } \cs_new_protected:Npn \__str_convert_decode_clist: { \clist_gset:No \g__str_result_tl \g__str_result_tl @@ -456,12 +438,12 @@ \int_zero:N \l__str_internal_int \exp_last_unbraced:Nx \__str_decode_eight_bit_load:nn { \tl_use:c { c__str_encoding_#1_tl } } - { \q_stop \__prg_break: } { } - \__prg_break_point: + { \q_stop \prg_break: } { } + \prg_break_point: \exp_last_unbraced:Nx \__str_decode_eight_bit_load_missing:n { \tl_use:c { c__str_encoding_#1_missing_tl } } - { \q_stop \__prg_break: } - \__prg_break_point: + { \q_stop \prg_break: } + \prg_break_point: \flag_clear:n { str_error } \__str_convert_gmap:N \__str_decode_eight_bit_char:N \__str_if_flag_error:nnx { str_error } { decode-8-bit } {#1} @@ -472,7 +454,7 @@ \use_none_delimit_by_q_stop:w #1 \q_stop \tex_dimen:D "#1 = \l__str_internal_int sp \scan_stop: \tex_skip:D \l__str_internal_int = "#1 sp \scan_stop: - \tex_toks:D \l__str_internal_int \exp_after:wN { \__int_value:w "#2 } + \tex_toks:D \l__str_internal_int \exp_after:wN { \int_value:w "#2 } \int_incr:N \l__str_internal_int \__str_decode_eight_bit_load:nn } @@ -494,7 +476,7 @@ \tex_the:D \tex_toks:D \tex_dimen:D \fi: \fi: - \__int_value:w `#1 \s__tl + \int_value:w `#1 \s__tl } \cs_new_protected:Npn \__str_convert_encode_eight_bit:n #1 { @@ -502,8 +484,8 @@ \int_zero:N \l__str_internal_int \exp_last_unbraced:Nx \__str_encode_eight_bit_load:nn { \tl_use:c { c__str_encoding_#1_tl } } - { \q_stop \__prg_break: } { } - \__prg_break_point: + { \q_stop \prg_break: } { } + \prg_break_point: \flag_clear:n { str_error } \__str_convert_gmap_internal:N \__str_encode_eight_bit_char:n \__str_if_flag_error:nnx { str_error } { encode-8-bit } {#1} diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf16.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf16.def index 66d5ec7a527..83f53a20f49 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf16.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf16.def @@ -68,10 +68,13 @@ } \__kernel_msg_new:nnnn { str } { utf16-decode } { - Invalid~UTF-16~string: \exp_last_unbraced:Nf \use_none:n - \__str_if_flag_times:nT { str_missing } { ,~missing~trail~surrogate } - \__str_if_flag_times:nT { str_extra } { ,~extra~trail~surrogate } - \__str_if_flag_times:nT { str_end } { ,~odd~number~of~bytes } + Invalid~UTF-16~string: + \exp_last_unbraced:Nf \use_none:n + { + \__str_if_flag_times:nT { str_missing } { ,~missing~trail~surrogate } + \__str_if_flag_times:nT { str_extra } { ,~extra~trail~surrogate } + \__str_if_flag_times:nT { str_end } { ,~odd~number~of~bytes } + } . } { @@ -105,13 +108,13 @@ } } \cs_new_protected:cpn { __str_convert_decode_utf16be: } - { \__str_decode_utf_xvi:Nw 1 \g__str_result_tl \s__stop } + { \__str_decode_utf_xvi:Nw 1 \g__str_result_tl \s_stop } \cs_new_protected:cpn { __str_convert_decode_utf16le: } - { \__str_decode_utf_xvi:Nw 2 \g__str_result_tl \s__stop } + { \__str_decode_utf_xvi:Nw 2 \g__str_result_tl \s_stop } \cs_new_protected:cpn { __str_convert_decode_utf16: } { \exp_after:wN \__str_decode_utf_xvi_bom:NN - \g__str_result_tl \s__stop \s__stop \s__stop + \g__str_result_tl \s_stop \s_stop \s_stop } \cs_new_protected:Npn \__str_decode_utf_xvi_bom:NN #1#2 { @@ -123,7 +126,7 @@ { \__str_decode_utf_xvi:Nw 1 #1#2 } } } - \cs_new_protected:Npn \__str_decode_utf_xvi:Nw #1#2 \s__stop + \cs_new_protected:Npn \__str_decode_utf_xvi:Nw #1#2 \s_stop { \flag_clear:n { str_error } \flag_clear:n { str_missing } @@ -134,7 +137,7 @@ { \exp_after:wN \__str_decode_utf_xvi_pair:NN #2 \q_nil \q_nil - \__prg_break_point: + \prg_break_point: } \__str_if_flag_error:nnx { str_error } { utf16-decode } { } } @@ -144,7 +147,7 @@ \__str_decode_utf_xvi_pair_end:Nw #1 \fi: \if_case:w - \__int_eval:w ( \__str_tmp:w #1#2 - "D6 ) / 4 \__int_eval_end: + \int_eval:n { ( \__str_tmp:w #1#2 - "D6 ) / 4 } \scan_stop: \or: \exp_after:wN \__str_decode_utf_xvi_quad:NNwNN \or: \exp_after:wN \__str_decode_utf_xvi_extra:NNw \fi: @@ -186,7 +189,7 @@ \else: \__str_decode_utf_xvi_error:nNN { end } #1 \prg_do_nothing: \fi: - \__prg_break: + \prg_break: } \cs_new:Npn \__str_decode_utf_xvi_extra:NNw #1#2 \s__tl #3 \s__tl { \__str_decode_utf_xvi_error:nNN { extra } #1#2 } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf32.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf32.def index 3c37226eebc..992ee7ce19a 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf32.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf32.def @@ -58,9 +58,12 @@ \flag_clear_new:n { str_end } \__kernel_msg_new:nnnn { str } { utf32-decode } { - Invalid~UTF-32~string: \exp_last_unbraced:Nf \use_none:n - \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } - \__str_if_flag_times:nT { str_end } { ,~truncated~string } + Invalid~UTF-32~string: + \exp_last_unbraced:Nf \use_none:n + { + \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } + \__str_if_flag_times:nT { str_end } { ,~truncated~string } + } . } { @@ -81,13 +84,13 @@ } } \cs_new_protected:cpn { __str_convert_decode_utf32be: } - { \__str_decode_utf_xxxii:Nw 1 \g__str_result_tl \s__stop } + { \__str_decode_utf_xxxii:Nw 1 \g__str_result_tl \s_stop } \cs_new_protected:cpn { __str_convert_decode_utf32le: } - { \__str_decode_utf_xxxii:Nw 2 \g__str_result_tl \s__stop } + { \__str_decode_utf_xxxii:Nw 2 \g__str_result_tl \s_stop } \cs_new_protected:cpn { __str_convert_decode_utf32: } { \exp_after:wN \__str_decode_utf_xxxii_bom:NNNN \g__str_result_tl - \s__stop \s__stop \s__stop \s__stop \s__stop + \s_stop \s_stop \s_stop \s_stop \s_stop } \cs_new_protected:Npn \__str_decode_utf_xxxii_bom:NNNN #1#2#3#4 { @@ -99,7 +102,7 @@ { \__str_decode_utf_xxxii:Nw 1 #1#2#3#4 } } } - \cs_new_protected:Npn \__str_decode_utf_xxxii:Nw #1#2 \s__stop + \cs_new_protected:Npn \__str_decode_utf_xxxii:Nw #1#2 \s_stop { \flag_clear:n { str_overflow } \flag_clear:n { str_end } @@ -108,14 +111,14 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN \__str_decode_utf_xxxii_loop:NNNN - #2 \s__stop \s__stop \s__stop \s__stop - \__prg_break_point: + #2 \s_stop \s_stop \s_stop \s_stop + \prg_break_point: } \__str_if_flag_error:nnx { str_error } { utf32-decode } { } } \cs_new:Npn \__str_decode_utf_xxxii_loop:NNNN #1#2#3#4 { - \if_meaning:w \s__stop #4 + \if_meaning:w \s_stop #4 \exp_after:wN \__str_decode_utf_xxxii_end:w \fi: #1#2#3#4 \s__tl @@ -136,7 +139,7 @@ \s__tl \__str_decode_utf_xxxii_loop:NNNN } - \cs_new:Npn \__str_decode_utf_xxxii_end:w #1 \s__stop + \cs_new:Npn \__str_decode_utf_xxxii_end:w #1 \s_stop { \tl_if_empty:nF {#1} { @@ -145,7 +148,7 @@ #1 \s__tl \int_use:N \c__str_replacement_char_int \s__tl } - \__prg_break: + \prg_break: } \group_end: %% diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def index 486b12974a6..ac07909cf81 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-enc-utf8.def @@ -37,7 +37,7 @@ \exp_after:wN \use_none_delimit_by_q_stop:w \fi: \exp_after:wN \__str_encode_utf_viii_loop:wwnnw - \__int_value:w \int_div_truncate:nn {#1} {64} ; #1 ; + \int_value:w \int_div_truncate:nn {#1} {64} ; #1 ; #5 \q_stop \__str_output_byte:n { #2 - 64 * ( #1 - 2 ) } } @@ -47,11 +47,14 @@ \flag_clear_new:n { str_overflow } \__kernel_msg_new:nnnn { str } { utf8-decode } { - Invalid~UTF-8~string: \exp_last_unbraced:Nf \use_none:n - \__str_if_flag_times:nT { str_missing } { ,~missing~continuation~byte } - \__str_if_flag_times:nT { str_extra } { ,~extra~continuation~byte } - \__str_if_flag_times:nT { str_overlong } { ,~overlong~form } - \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } + Invalid~UTF-8~string: + \exp_last_unbraced:Nf \use_none:n + { + \__str_if_flag_times:nT { str_missing } { ,~missing~continuation~byte } + \__str_if_flag_times:nT { str_extra } { ,~extra~continuation~byte } + \__str_if_flag_times:nT { str_overlong } { ,~overlong~form } + \__str_if_flag_times:nT { str_overflow } { ,~code~point~too~large } + } . } { @@ -99,8 +102,8 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN \__str_decode_utf_viii_start:N \g__str_result_tl - { \__prg_break: \__str_decode_utf_viii_end: } - \__prg_break_point: + { \prg_break: \__str_decode_utf_viii_end: } + \prg_break_point: } \__str_if_flag_error:nnx { str_error } { utf8-decode } { } } @@ -110,7 +113,7 @@ \if_int_compare:w `#1 < "C0 \exp_stop_f: \s__tl \if_int_compare:w `#1 < "80 \exp_stop_f: - \__int_value:w `#1 + \int_value:w `#1 \else: \flag_raise:n { str_extra } \flag_raise:n { str_error } @@ -118,7 +121,7 @@ \fi: \else: \exp_after:wN \__str_decode_utf_viii_continuation:wwN - \__int_value:w \__int_eval:w `#1 - "C0 \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { `#1 - "C0 } \exp_after:wN \fi: \s__tl \use_none_delimit_by_q_stop:w {"80} {"800} {"10000} {"110000} \q_stop @@ -133,9 +136,7 @@ "C0 \exp_stop_f: #3 \exp_after:wN \__str_decode_utf_viii_aux:wNnnwN - \__int_value:w \__int_eval:w - #1 * "40 + `#3 - "80 - \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { #1 * "40 + `#3 - "80 } \exp_after:wN \else: \s__tl \flag_raise:n { str_missing } @@ -163,7 +164,7 @@ \__str_decode_utf_viii_overflow:w #1 \fi: \exp_after:wN \__str_decode_utf_viii_continuation:wwN - \__int_value:w \__int_eval:w #1 - #4 \exp_after:wN \__int_eval_end: + \int_value:w \int_eval:n { #1 - #4 } \exp_after:wN \fi: \s__tl #2 {#4} #5 @@ -182,7 +183,7 @@ \flag_raise:n { str_missing } \flag_raise:n { str_error } \int_use:N \c__str_replacement_char_int \s__tl - \__prg_break: + \prg_break: } %% %% diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-hex.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-hex.def index 98932ef5521..5d8c5972cd5 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-hex.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-hex.def @@ -29,8 +29,8 @@ \__str_output_byte:w " \exp_last_unbraced:Nf \__str_unescape_hex_auxi:N { \tl_to_str:N \g__str_result_tl } - 0 { ? 0 - 1 \__prg_break: } - \__prg_break_point: + 0 { ? 0 - 1 \prg_break: } + \prg_break_point: \__str_output_end: } \__str_if_flag_error:nnx { str_error } { unescape-hex } { } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-name.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-name.def index f22018c7357..625bcdc4feb 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-name.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-name.def @@ -30,8 +30,8 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN #3 \g__str_result_tl - #1 ? { ? \__prg_break: } - \__prg_break_point: + #1 ? { ? \prg_break: } + \prg_break_point: } \__str_if_flag_error:nnx { str_byte } { non-byte } { #2 } \__str_if_flag_error:nnx { str_error } { unescape-#2 } { } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-string.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-string.def index 133f06d086e..d290b2f0f91 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-string.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-string.def @@ -33,14 +33,14 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN \__str_unescape_string_newlines:wN - \g__str_result_tl \__prg_break: ^^M ? - \__prg_break_point: + \g__str_result_tl \prg_break: ^^M ? + \prg_break_point: } \tl_gset:Nx \g__str_result_tl { \exp_after:wN \__str_unescape_string_loop:wNNN - \g__str_result_tl #1 ?? { ? \__prg_break: } - \__prg_break_point: + \g__str_result_tl #1 ?? { ? \prg_break: } + \prg_break_point: } \__str_if_flag_error:nnx { str_byte } { non-byte } { string } \__str_if_flag_error:nnx { str_error } { unescape-string } { } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-url.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-url.def index eeff559146d..94db0c22f09 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-url.def +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-esc-url.def @@ -30,8 +30,8 @@ \tl_gset:Nx \g__str_result_tl { \exp_after:wN #3 \g__str_result_tl - #1 ? { ? \__prg_break: } - \__prg_break_point: + #1 ? { ? \prg_break: } + \prg_break_point: } \__str_if_flag_error:nnx { str_byte } { non-byte } { #2 } \__str_if_flag_error:nnx { str_error } { unescape-#2 } { } diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty index 855c67ce144..d23bafdc9a2 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-format.sty @@ -20,7 +20,7 @@ %% %% File: l3str-format.dtx Copyright (C) 2012-2018 The LaTeX3 Project \RequirePackage{expl3} -\ProvidesExplPackage{l3str-format}{2018/03/05}{} +\ProvidesExplPackage{l3str-format}{2018-04-30}{} {L3 Experimental string formatting} \cs_generate_variant:Nn \use:nn { nf } \cs_generate_variant:Nn \use:nnn { fnf } @@ -30,26 +30,26 @@ \if_int_compare:w 9 < 1 #1 \exp_stop_f: \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new:Npn \__str_format_put:nw #1 #2 \s__stop { #2 \s__stop #1 } +\cs_new:Npn \__str_format_put:nw #1 #2 \s_stop { #2 \s_stop #1 } \cs_generate_variant:Nn \__str_format_put:nw { o , f } \prg_new_conditional:Npnn \__str_format_if_in:nN #1#2 { TF } { \__str_format_if_in_aux:NN #2 #1 - { #2 \prg_return_false: \exp_after:wN \__prg_break: \else: } - \__prg_break_point: + { #2 \prg_return_false: \exp_after:wN \prg_break: \else: } + \prg_break_point: } \cs_new:Npn \__str_format_if_in_aux:NN #1#2 { \if_charcode:w #1 #2 \prg_return_true: - \exp_after:wN \__prg_break: + \exp_after:wN \prg_break: \fi: \__str_format_if_in_aux:NN #1 } \cs_new:Npn \__str_format_parse:n #1 { \exp_last_unbraced:Nf \__str_format_parse_auxi:NN - \__str_to_other:n {#1} \s__stop \s__stop {#1} + { \__kernel_str_to_other:n {#1} } \s_stop \s_stop {#1} } \cs_new:Npx \__str_format_parse_auxi:NN #1#2 { @@ -94,11 +94,11 @@ } \cs_new:Npn \__str_format_parse_auxvii:nN #1#2 { - \token_if_eq_meaning:NNTF \s__stop #2 + \token_if_eq_meaning:NNTF \s_stop #2 { \__str_format_parse_end:nwn { #1 ? } #2 } { \__str_format_parse_end:nwn { #1 #2 } } } -\cs_new:Npn \__str_format_parse_end:nwn #1 #2 \s__stop \s__stop #3 +\cs_new:Npn \__str_format_parse_end:nwn #1 #2 \s_stop \s_stop #3 { \tl_if_empty:nF {#2} { \__kernel_msg_expandable_error:nnn { str } { invalid-format } {#3} } @@ -195,13 +195,13 @@ } } \__str_format_tl_s:NNnnNNn - \s__stop + \s_stop } \cs_new:Npn \__str_format_tl_s:NNnnNNn #1#2#3#4#5#6#7 { \exp_args:Nc \exp_args:Nf { __str_format_align_#6:nnnN } - { \exp_args:Nf #2 { \__str_to_other:n {#7} } #3 } + { \exp_args:Nf #2 { \__kernel_str_to_other:n {#7} } #3 } { } {#4} #5 } @@ -275,9 +275,9 @@ { str } { invalid-style-format } {#6} { int } \__str_format_int:NwnnNNn \use:n } - \s__stop {#7} + \s_stop {#7} } -\cs_new:Npn \__str_format_int:NwnnNNn #1#2 \s__stop #3#4#5#6#7 +\cs_new:Npn \__str_format_int:NwnnNNn #1#2 \s_stop #3#4#5#6#7 { \exp_args:Nc \exp_args:Nf { __str_format_align_#6:nnnN } @@ -328,11 +328,11 @@ { str } { invalid-style-format } {#6} { fp } \__str_format_fp:wnnnNNw \__str_format_fp_g:wn } - \s__stop + \s_stop \s__fp \__fp_chk:w #7 #8 } \cs_new:Npn \__str_format_fp:wnnnNNw - #1 \s__stop #2 #3 #4 #5#6 #7 ; + #1 \s_stop #2 #3 #4 #5#6 #7 ; { \exp_args:Nc \exp_args:Nf { __str_format_align_#6:nnnN } @@ -352,7 +352,7 @@ } { \exp_last_unbraced:Nf \__str_format_fp_e_aux:wn - \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } + { \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2#3 ; { #4 + 1 } } {#4} } } @@ -371,7 +371,7 @@ { \str_range:nnn { #4#5#6#7 0 } { 2 } { #8 + 1 } } } \__str_format_put:fw { \use_i:nnnn #4 . } - \use_none:n \s__stop + \use_none:n \s_stop } \cs_new:Npn \__str_format_fp_f:wn \s__fp \__fp_chk:w #1#2#3 ; #4 { @@ -383,8 +383,10 @@ } { \exp_last_unbraced:Nf \__str_format_fp_f_aux:wwwn - \fp_to_decimal:n - { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) } + { + \fp_to_decimal:n + { abs ( round ( \s__fp \__fp_chk:w #1#2#3 ; , #4 ) ) } + } . . ; {#4} } @@ -405,8 +407,10 @@ } { \exp_last_unbraced:Nf \__str_format_fp_g_aux:wn - \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ; - { \int_max:nn {1} {#3} } + { + \__str_format_fp_round:wn \s__fp \__fp_chk:w #1#2 ; + { \int_max:nn {1} {#3} } + } { \int_max:nn {1} {#3} } } } |