From a57ec5a6dea711c791fc567803079341c6fbfae3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Dec 2011 22:31:32 +0000 Subject: l3experimental 3036 (11dec11) git-svn-id: svn://tug.org/texlive/trunk@24820 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/l3experimental/l3str/l3regex-trace.sty | 1796 -------------------- .../tex/latex/l3experimental/l3str/l3regex.sty | 145 +- .../tex/latex/l3experimental/l3str/l3str-hex.def | 81 + .../latex/l3experimental/l3str/l3str-iso88591.def | 57 + .../latex/l3experimental/l3str/l3str-iso885910.def | 103 ++ .../latex/l3experimental/l3str/l3str-iso885911.def | 148 ++ .../latex/l3experimental/l3str/l3str-iso885913.def | 113 ++ .../latex/l3experimental/l3str/l3str-iso885914.def | 88 + .../latex/l3experimental/l3str/l3str-iso885915.def | 65 + .../latex/l3experimental/l3str/l3str-iso885916.def | 97 ++ .../latex/l3experimental/l3str/l3str-iso88592.def | 114 ++ .../latex/l3experimental/l3str/l3str-iso88593.def | 92 + .../latex/l3experimental/l3str/l3str-iso88594.def | 107 ++ .../latex/l3experimental/l3str/l3str-iso88595.def | 151 ++ .../latex/l3experimental/l3str/l3str-iso88596.def | 137 ++ .../latex/l3experimental/l3str/l3str-iso88597.def | 136 ++ .../latex/l3experimental/l3str/l3str-iso88598.def | 124 ++ .../latex/l3experimental/l3str/l3str-iso88599.def | 63 + .../tex/latex/l3experimental/l3str/l3str-name.def | 102 ++ .../latex/l3experimental/l3str/l3str-string.def | 153 ++ .../tex/latex/l3experimental/l3str/l3str-url.def | 100 ++ .../tex/latex/l3experimental/l3str/l3str-utf16.def | 186 ++ .../tex/latex/l3experimental/l3str/l3str-utf32.def | 141 ++ .../tex/latex/l3experimental/l3str/l3str-utf8.def | 159 ++ .../tex/latex/l3experimental/l3str/l3str.sty | 881 +++++----- 25 files changed, 3082 insertions(+), 2257 deletions(-) delete mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-hex.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88591.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885910.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885911.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885913.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885914.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885915.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885916.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88592.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88593.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88594.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88595.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88596.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88597.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88598.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88599.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-name.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-string.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-url.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf16.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf32.def create mode 100644 Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf8.def (limited to 'Master/texmf-dist/tex/latex/l3experimental') diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty deleted file mode 100644 index 07d568d94e9..00000000000 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex-trace.sty +++ /dev/null @@ -1,1796 +0,0 @@ -%% -%% This is file `l3regex-trace.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% l3regex.dtx (with options: `package,trace') -%% -%% EXPERIMENTAL CODE -%% -%% Do not distribute this file without also distributing the -%% source files specified above. -%% -%% Do not distribute a modified version of this file. -%% -%% File: l3regex.dtx Copyright (C) 2011 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 -%% license or (at your option) any later version. The latest version -%% of this license is in the file -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This file is part of the "l3experimental bundle" (The Work in LPPL) -%% and all files in that bundle must be distributed together. -%% -%% The released version of this bundle is available from CTAN. -%% -%% ----------------------------------------------------------------------- -%% -%% The development version of the bundle can be found at -%% -%% http://www.latex-project.org/svnroot/experimental/trunk/ -%% -%% for those people who are interested. -%% -%%%%%%%%%%% -%% NOTE: %% -%%%%%%%%%%% -%% -%% Snapshots taken from the repository represent work in progress and may -%% not work or may contain conflicting material! We therefore ask -%% people _not_ to put them into distributions, archives, etc. without -%% prior consultation with the LaTeX3 Project. -%% -%% ----------------------------------------------------------------------- -\RequirePackage{expl3} -\GetIdInfo$Id: l3regex.dtx 2943 2011-10-30 15:59:43Z bruno $ - {L3 Experimental Regular Expressions} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\RequirePackage{l3str} -\int_const:Nn \c_forty_eight { 48 } -\int_const:Nn \c_fifty_eight { 58 } -\int_const:Nn \c_sixty_five { 65 } -\int_const:Nn \c_ninety_one { 91 } -\int_const:Nn \c_ninety_seven { 97 } -\int_const:Nn \c_one_hundred_twenty_three { 123 } -\int_const:Nn \c_one_hundred_twenty_seven { 127 } -\cs_new:Npn \regex_tmp:w { } -\tl_new:N \g_regex_tmpa_tl -\tl_new:N \l_regex_tmpa_tl -\tl_new:N \l_regex_tmpb_tl -\int_new:N \l_regex_tmpa_int -\int_new:N \l_regex_tmpb_int -\int_new:N \l_regex_max_state_int -\int_new:N \l_regex_left_state_int -\int_new:N \l_regex_right_state_int -\seq_new:N \l_regex_group_begin_seq -\seq_new:N \l_regex_group_end_seq -\int_new:N \l_regex_capturing_group_int -\seq_new:N \l_regex_capturing_group_seq -\tl_new:N \l_regex_one_or_group_tl -\cs_new_eq:NN \regex_build_tmp_class:n \use_none:n -\bool_new:N \l_regex_class_bool -\tl_new:N \l_regex_class_tl -\tl_const:Nn \c_regex_d_tl - { - \regex_item_range:nn { \c_forty_eight } { 57 } % 0--9 - } -\tl_const:Nn \c_regex_D_tl - { - \regex_item_geq:n { \c_fifty_eight } % > `9 - \regex_item_range:nn { \c_zero } { 47 } % 0 - } -\tl_const:Nn \c_regex_h_tl - { - \regex_item_equal:n { \c_thirty_two } % space - \regex_item_equal:n { \c_nine } % tab - } -\tl_const:Nn \c_regex_H_tl - { - \regex_item_geq:n { 33 } % > space - \regex_item_range:nn { \c_ten } { 31 } % tab < ... < space - \regex_item_range:nn { \c_zero } { \c_eight } % < tab - } -\tl_const:Nn \c_regex_s_tl - { - \regex_item_equal:n { \c_thirty_two } % space - \regex_item_range:nn { \c_nine } { \c_ten } % tab, lf - \regex_item_range:nn { \c_twelve } { \c_thirteen } % ff, cr - } -\tl_const:Nn \c_regex_S_tl - { - \regex_item_geq:n { 33 } % > space - \regex_item_range:nn { \c_fourteen } { 31 } % tab < ... < space - \regex_item_range:nn { \c_zero } { \c_eight } % < tab - \regex_item_equal:n { \c_eleven } % vtab - } -\tl_const:Nn \c_regex_v_tl - { - \regex_item_range:nn { \c_ten } { \c_thirteen } % lf, vtab, ff, cr - } -\tl_const:Nn \c_regex_V_tl - { - \regex_item_geq:n { \c_fourteen } % >cr - \regex_item_range:nn { \c_zero } { \c_nine } % < lf - } -\tl_const:Nn \c_regex_w_tl - { - \regex_item_range:nn { \c_ninety_seven } { 122 } % a--z - \regex_item_range:nn { \c_sixty_five } { 90 } % A--Z - \regex_item_range:nn { \c_forty_eight } { 57 } % 0--9 - \regex_item_equal:n { 95 } % _ - } -\tl_const:Nn \c_regex_W_tl - { - \regex_item_range:nn { \c_zero } { 47 } % <`0 - \regex_item_range:nn { \c_fifty_eight } { 64 } % (`9+1)--(`A-1) - \regex_item_range:nn { \c_ninety_one } { 94 } % (`Z+1)--(`_-1) - \regex_item_equal:n { 96 } % ` - \regex_item_geq:n { \c_one_hundred_twenty_three } % z - } -\tl_const:Nn \c_regex_N_tl - { - \regex_item_geq:n { \c_eleven } % > lf - \regex_item_range:nn { \c_zero } { \c_nine } % < lf - } -\tl_new:N \l_regex_query_other_str -\int_new:N \l_regex_current_step_int -\int_new:N \l_regex_start_step_int -\int_new:N \l_regex_success_step_int -\int_new:N \l_regex_unique_step_int -\int_new:N \l_regex_current_char_int -\int_new:N \l_regex_last_char_int -\int_new:N \l_regex_case_changed_char_int -\bool_new:N \l_regex_caseless_bool -\int_new:N \l_regex_current_state_int -\prop_new:N \l_regex_current_submatches_prop -\prop_new:N \l_regex_success_submatches_prop -\int_new:N \l_regex_max_index_int -\tl_new:N \l_regex_every_match_tl -\bool_new:N \l_regex_success_bool -\cs_new_protected:Npn \regex_last_match_empty_no:F #1 {#1} -\cs_new_protected:Npn \regex_last_match_empty_yes:F - { \int_compare:nNnF \l_regex_start_step_int = \l_regex_current_step_int } -\cs_new_eq:NN \regex_last_match_empty:F \regex_last_match_empty_no:F -\bool_new:N \l_regex_success_empty_bool -\bool_new:N \l_regex_fresh_thread_bool -\seq_new:N \g_regex_submatches_seq -\int_new:N \g_regex_match_count_int -\seq_new:N \g_regex_extract_all_seq -\seq_new:N \g_regex_split_seq -\tl_new:N \l_regex_replacement_tl -\tl_new:N \g_regex_replaced_str -\cs_new_eq:NN \s_regex_toks \scan_stop: -\cs_new_protected:Npn \regex_toks_put_left:Nx #1#2 - { - \cs_set_nopar:Npx \regex_tmp:w \s_regex_toks { \s_regex_toks #2 } - \tex_toks:D #1 \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \regex_tmp:w \tex_the:D \tex_toks:D #1 } - } -\cs_new_protected:Npn \regex_toks_put_right:Nx #1#2 - { - \cs_set_nopar:Npx \regex_tmp:w {#2} - \tex_toks:D #1 \exp_after:wN - { \tex_the:D \tex_toks:D \exp_after:wN #1 \regex_tmp:w } - } -\cs_new_nopar:Npn \regex_query_substr:NN #1#2 - { - \exp_after:wN \regex_query_substr_aux:NN - \exp_after:wN #1 - \exp_after:wN #2 - \l_regex_query_other_str - \q_stop - } -\cs_new:Npn \regex_query_substr_aux:NN #1#2 - { - \str_skip_do:nn {#1} - { \str_collect_do:nn { #2 - #1 } { \use_i_delimit_by_q_stop:nw } } - } -\cs_new_protected_nopar:Npn \regex_seq_pop:N #1 - { - \seq_pop:NN #1 \l_regex_tmpa_tl - \l_regex_tmpa_tl - } -\cs_new_protected_nopar:Npn \regex_seq_get:N #1 - { - \seq_get:NN #1 \l_regex_tmpa_tl - \l_regex_tmpa_tl - } -\cs_new_protected_nopar:Npn \regex_item_dot:T - { \int_compare:nNnF \l_regex_current_char_int = \c_minus_one } -\cs_new_protected_nopar:Npn \regex_break_true:w - #1 \regex_break_point:TF #2 #3 {#2} -\cs_new_protected_nopar:Npn \regex_break_false:w - #1 \regex_break_point:TF #2 #3 {#3} -\cs_new_protected_nopar:Npn \regex_break_point:TF #1 #2 { #2 } -\cs_new_protected_nopar:Npn \regex_item_caseful_equal:n #1 - { - \if_num:w #1 = \l_regex_current_char_int - \exp_after:wN \regex_break_true:w - \fi: - } -\cs_new_protected_nopar:Npn \regex_item_caseful_range:nn #1 #2 - { - \reverse_if:N \if_num:w #1 > \l_regex_current_char_int - \reverse_if:N \if_num:w #2 < \l_regex_current_char_int - \exp_after:wN \exp_after:wN \exp_after:wN \regex_break_true:w - \fi: - \fi: - } -\cs_new_protected_nopar:Npn \regex_item_caseful_geq:n #1 - { - \reverse_if:N \if_num:w #1 > \l_regex_current_char_int - \exp_after:wN \regex_break_true:w - \fi: - } -\cs_new_protected_nopar:Npn \regex_item_caseless_equal:n #1 - { - \if_num:w #1 = \l_regex_current_char_int - \exp_after:wN \regex_break_true:w - \fi: - \if_num:w #1 = \l_regex_case_changed_char_int - \exp_after:wN \regex_break_true:w - \fi: - } -\cs_new_protected_nopar:Npn \regex_item_caseless_range:nn #1 #2 - { - \reverse_if:N \if_num:w #1 > \l_regex_current_char_int - \reverse_if:N \if_num:w #2 < \l_regex_current_char_int - \exp_after:wN \exp_after:wN \exp_after:wN \regex_break_true:w - \fi: - \fi: - \reverse_if:N \if_num:w #1 > \l_regex_case_changed_char_int - \reverse_if:N \if_num:w #2 < \l_regex_case_changed_char_int - \exp_after:wN \exp_after:wN \exp_after:wN \regex_break_true:w - \fi: - \fi: - } -\cs_new_protected_nopar:Npn \regex_item_caseless_geq:n #1 - { - \reverse_if:N \if_num:w #1 > \l_regex_current_char_int - \exp_after:wN \regex_break_true:w - \fi: - \reverse_if:N \if_num:w #1 > \l_regex_case_changed_char_int - \exp_after:wN \regex_break_true:w - \fi: - } -\cs_new:Npn \regex_item_equal:n { \regex_item_caseful_equal:n } -\cs_new:Npn \regex_item_range:nn { \regex_item_caseful_range:nn } -\cs_new:Npn \regex_item_geq:n { \regex_item_caseful_geq:n } -\cs_new_protected_nopar:Npn \regex_build_caseless: - { - \bool_set_true:N \l_regex_caseless_bool - \cs_set:Npn \regex_item_equal:n { \regex_item_caseless_equal:n } - \cs_set:Npn \regex_item_range:nn { \regex_item_caseless_range:nn } - \cs_set:Npn \regex_item_geq:n { \regex_item_caseless_geq:n } - } -\cs_new_protected_nopar:Npn \regex_build_caseful: - { - \bool_set_false:N \l_regex_caseless_bool - \cs_set:Npn \regex_item_equal:n { \regex_item_caseful_equal:n } - \cs_set:Npn \regex_item_range:nn { \regex_item_caseful_range:nn } - \cs_set:Npn \regex_item_geq:n { \regex_item_caseful_geq:n } - } -\cs_new_protected:Npn \regex_get_digits:nw #1 - { - \tex_afterassignment:D \regex_tmp:w - \cs_set_nopar:Npx \regex_tmp:w - { - \exp_not:n {#1} - { \if_false: } } \fi: - \regex_get_digits_aux:NN - } -\cs_new_nopar:Npn \regex_get_digits_aux:NN #1#2 - { - \if_meaning:w \regex_build_raw:N #1 - \if_charcode:w \c_space_token \exp_not:N #2 - \else: - \if_num:w 9 < 1 \exp_not:N #2 \exp_stop_f: - #2 - \else: - \regex_get_digits_end:w #1 #2 - \fi: - \fi: - \else: - \regex_get_digits_end:w #1 #2 - \fi: - \regex_get_digits_aux:NN - } -\cs_new_nopar:Npn \regex_get_digits_end:w #1 \fi: #2 \regex_get_digits_aux:NN - { - \fi: #2 - \if_false: { { \fi: } } - #1 - } -\prg_new_conditional:Npnn \regex_token_if_other_digit:N #1 { TF } - { - \if_num:w \c_nine < 1 \exp_not:N #1 \exp_stop_f: - \prg_return_true: \else: \prg_return_false: \fi: - } -\prg_new_conditional:Npnn \regex_aux_char_if_special:N #1 { TF } - { - \if_num:w `#1 < \c_ninety_one - \if_num:w `#1 < \c_fifty_eight - \if_num:w `#1 < \c_forty_eight - \if_num:w `#1 < \c_thirty_two - \prg_return_false: \else: \prg_return_true: \fi: - \else: \prg_return_false: \fi: - \else: - \if_num:w `#1 < \c_sixty_five - \prg_return_true: \else: \prg_return_false: \fi: - \fi: - \else: - \if_num:w `#1 < \c_one_hundred_twenty_three - \if_num:w `#1 < \c_ninety_seven - \prg_return_true: \else: \prg_return_false: \fi: - \else: - \if_num:w `#1 < \c_one_hundred_twenty_seven - \prg_return_true: \else: \prg_return_false: \fi: - \fi: - \fi: - } -\prg_new_conditional:Npnn \regex_aux_char_if_alphanumeric:N #1 { TF } - { - \if_num:w `#1 < \c_ninety_one - \if_num:w `#1 < \c_fifty_eight - \if_num:w `#1 < \c_forty_eight - \prg_return_false: \else: \prg_return_true: \fi: - \else: - \if_num:w `#1 < \c_sixty_five - \prg_return_false: \else: \prg_return_true: \fi: - \fi: - \else: - \if_num:w `#1 < \c_one_hundred_twenty_three - \if_num:w `#1 < \c_ninety_seven - \prg_return_false: \else: \prg_return_true: \fi: - \else: - \prg_return_false: - \fi: - \fi: - } -\cs_new_protected_nopar:Npn \regex_build_new_state: - { - \int_compare:nNnTF \l_regex_max_state_int > { 32766 } - { \msg_error:nn { regex } { -997 } } - { - \int_incr:N \l_regex_max_state_int - \tex_toks:D \l_regex_max_state_int { \s_regex_toks } - } - \int_set_eq:NN \l_regex_left_state_int \l_regex_right_state_int - \int_set_eq:NN \l_regex_right_state_int \l_regex_max_state_int - } -\cs_new_protected_nopar:Npn \regex_build_transition_aux:NN #1#2 - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { #1 { \int_eval:n { #2 - \l_regex_left_state_int } } } - } -\cs_new_protected_nopar:Npn \regex_build_transitions_aux:NNNN #1#2#3#4 - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { - #1 { \int_eval:n { #2 - \l_regex_left_state_int } } - #3 { \int_eval:n { #4 - \l_regex_left_state_int } } - } - } -\cs_new_protected:Npn \regex_build:n #1 - { - \regex_build_setup: - \str_aux_escape:NNNn - \regex_build_i_unescaped:N - \regex_build_i_escaped:N - \regex_build_i_raw:N - { #1 } - \regex_build_open_aux: - \g_str_result_tl \prg_do_nothing: \prg_do_nothing: - \seq_push:Nn \l_regex_capturing_group_seq { 0 } - \regex_build_close_aux: \regex_build_group_: - \regex_build_end: - } -\cs_new_nopar:Npn \regex_build_i_unescaped:N #1 - { - \regex_aux_char_if_special:NTF #1 - { \exp_not:N \regex_build_control:N #1 } - { \exp_not:N \regex_build_raw:N #1 } - } -\cs_new_nopar:Npn \regex_build_i_escaped:N #1 - { - \regex_aux_char_if_alphanumeric:NTF #1 - { \exp_not:N \regex_build_control:N #1 } - { \exp_not:N \regex_build_raw:N #1 } - } -\cs_new_nopar:Npn \regex_build_i_raw:N #1 - { \exp_not:N \regex_build_raw:N #1 } -\cs_new_protected_nopar:Npn \regex_build_default_control:N #1 - { - \cs_if_exist_use:cF { regex_build_#1: } - { \regex_build_default_raw:N #1 } - } -\cs_new_protected_nopar:Npn \regex_build_setup: - { - \cs_set_eq:NN \regex_build_control:N \regex_build_default_control:N - \cs_set_eq:NN \regex_build_raw:N \regex_build_default_raw:N - \int_set_eq:NN \l_regex_capturing_group_int \c_zero - \int_zero:N \l_regex_max_state_int - \regex_build_new_state: - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { \regex_action_start_wildcard:nn {0} {1} } - } -\cs_new_protected_nopar:Npn \regex_build_end: - { - \seq_if_empty:NF \l_regex_capturing_group_seq - { - \msg_error:nn { regex } {22} - \prg_replicate:nn - { \seq_length:N \l_regex_capturing_group_seq } - { \regex_build_close_aux: \regex_build_group_: } - } - \regex_toks_put_right:Nx \l_regex_right_state_int - { \regex_action_success: } - } -\cs_new_protected_nopar:cpn { regex_build_^: } - { \regex_build_anchor_start:N \c_zero } -\cs_new_protected_nopar:Npn \regex_build_A: - { \regex_build_anchor_start:N \c_zero } -\cs_new_protected_nopar:Npn \regex_build_G: - { \regex_build_anchor_start:N \l_regex_start_step_int } -\cs_new_protected_nopar:Npn \regex_build_anchor_start:N #1 - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \exp_not:N \int_compare:nNnT {#1} = \l_regex_current_step_int - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - } - } -\cs_new_protected_nopar:cpn { regex_build_$: } % $ - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \exp_not:N \int_compare:nNnT - \c_minus_one = \l_regex_current_char_int - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - } - } -\cs_new_eq:Nc \regex_build_Z: { regex_build_$: } %$ -\cs_new_eq:Nc \regex_build_z: { regex_build_$: } %$ -\cs_new_protected_nopar:Npn \regex_build_b: - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \exp_not:N \regex_if_word_boundary:TF - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - { } - } - } -\cs_new_protected_nopar:Npn \regex_build_B: - { - \regex_build_new_state: - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \exp_not:N \regex_if_word_boundary:TF - { } - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - } - } -\cs_new_protected_nopar:Npn \regex_if_word_boundary:TF - { - \group_begin: - \int_set_eq:NN \l_regex_current_char_int \l_regex_last_char_int - \c_regex_w_tl - \regex_break_point:TF - { \group_end: \c_regex_W_tl \regex_item_equal:n { -1 } } - { \group_end: \c_regex_w_tl } - \regex_break_point:TF - } -\cs_new_protected_nopar:Npn \regex_build_default_raw:N #1 - { - \cs_set:Npx \regex_build_tmp_class:n ##1 - { - \regex_item_equal:n { \int_value:w `#1 } - \regex_break_point:TF { \regex_action_cost:n { ##1 } } { } - } - \regex_build_one_quantifier: - } -\cs_new_protected_nopar:cpn { regex_build_.: } - { - \cs_set:Npn \regex_build_tmp_class:n ##1 - { \regex_item_dot:T { \regex_action_cost:n {##1} } } - \regex_build_one_quantifier: - } -\cs_new_protected_nopar:Npn \regex_build_char_type:N #1 - { - \cs_set:Npn \regex_build_tmp_class:n ##1 - { - \exp_not:N #1 - \regex_break_point:TF { \regex_action_cost:n {##1} } { } - } - \regex_build_one_quantifier: - } -\tl_map_inline:nn { dDhHsSvVwWN } - { - \cs_new_protected_nopar:cpx { regex_build_#1: } - { - \exp_not:N \regex_build_char_type:N - \exp_not:c { c_regex_#1_tl } - } - } -\cs_new_protected_nopar:cpn { regex_build_[: } - { - \tl_clear:N \l_regex_class_tl - \cs_set_eq:NN \regex_build_control:N \regex_class_control:N - \cs_set_eq:NN \regex_build_raw:N \regex_class_raw:N - \regex_class_first:NN - } -\cs_new_protected_nopar:Npn \regex_class_control:N #1 - { - \cs_if_exist_use:cF { regex_class_#1: } - { \regex_class_raw:N #1 } - } -\cs_new_protected_nopar:cpn { regex_class_]: } - { - \tl_if_empty:NTF \l_regex_class_tl %[ - { \regex_class_raw:N ] } - { - \cs_set_eq:NN \regex_build_control:N \regex_build_default_control:N - \cs_set_eq:NN \regex_build_raw:N \regex_build_default_raw:N - \cs_set:Npn \regex_build_tmp_class:n ##1 - { - \exp_not:o \l_regex_class_tl - \bool_if:NTF \l_regex_class_bool - { \regex_break_point:TF { \regex_action_cost:n {##1} } { } } - { \regex_break_point:TF { } { \regex_action_cost:n {##1} } } - } - \regex_build_one_quantifier: - } - } -\cs_new_protected_nopar:Npn \regex_class_first:NN #1#2 - { - \str_if_eq:nnTF {#1#2} { \regex_build_control:N ^ } - { \bool_set_false:N \l_regex_class_bool } - { - \bool_set_true:N \l_regex_class_bool - #1 #2 - } - } -\cs_new_protected_nopar:Npn \regex_class_raw:N #1#2#3 - { - \str_if_eq:nnTF {#2#3} { \regex_build_control:N - } - { \regex_class_range:Nw #1 } - { - \regex_class_single:N #1 - #2 #3 - } - } -\cs_new_protected_nopar:Npn \regex_class_single:N #1 - { - \tl_put_right:Nx \l_regex_class_tl - { \regex_item_equal:n { \int_value:w `#1 } } - } -\cs_new_protected_nopar:Npn \regex_class_range:Nw #1#2#3 - { - \token_if_eq_meaning:NNTF #2 \regex_build_control:N - { - \cs_if_exist:cTF { regex_class_#3: } - { - \regex_class_single:N #1 - \regex_class_single:N - - #2#3 - } - { \regex_class_range_put:NN #1#3 } - } - { \regex_class_range_put:NN #1#3 } - } -\cs_new_protected_nopar:Npn \regex_class_range_put:NN #1#2 - { - \if_num:w `#1 > `#2 \exp_stop_f: - \msg_error:nn { regex } {8} - \else: - \tl_put_right:Nx \l_regex_class_tl - { - \if_num:w `#1 = `#2 \exp_stop_f: - \regex_item_equal:n - \else: - \regex_item_range:nn { \int_value:w `#1 } - \fi: - { \int_value:w `#2 } - } - \fi: - } -\tl_map_inline:nn { dDhHsSvVwWN } - { - \cs_new_protected_nopar:cpx { regex_class_#1: } - { - \tl_put_right:Nn \exp_not:N \l_regex_class_tl - { \exp_not:c { c_regex_#1_tl } } - } - } -\cs_new_protected_nopar:Npn \regex_build_quantifier:w #1#2 - { - \token_if_eq_meaning:NNTF #1 \regex_build_control:N - { - \cs_if_exist_use:cF { regex_build_quantifier_#2:w } - { - \regex_build_quantifier_end:n { } - #1 #2 - } - } - { - \regex_build_quantifier_end:n { } - #1 #2 - } - } -\cs_new_protected_nopar:cpn { regex_build_quantifier_?:w } - { \regex_build_quantifier_aux:nnNN { } { ? } } -\cs_new_protected_nopar:cpn { regex_build_quantifier_*:w } - { \regex_build_quantifier_aux:nnNN { } { * } } -\cs_new_protected_nopar:cpn { regex_build_quantifier_+:w } - { \regex_build_quantifier_aux:nnNN { } { + } } -\cs_new_protected_nopar:Npn \regex_build_quantifier_aux:nnNN #1#2#3#4 - { - \str_if_eq:nnTF { #3 #4 } { \regex_build_control:N ? } - { \regex_build_quantifier_end:n { #2 #4 } #1 } - { - \regex_build_quantifier_end:n { #2 } #1 - #3 #4 - } - } -\cs_new_protected_nopar:cpn { regex_build_quantifier_ \c_lbrace_str :w } - { \regex_get_digits:nw { \regex_build_quantifier_lbrace:n } } -\cs_new_protected_nopar:Npn \regex_build_quantifier_lbrace:n #1 - { - \tl_if_empty:nTF {#1} - { - \regex_build_quantifier_end:n { } - \exp_after:wN \regex_build_raw:N \c_lbrace_str - } - { \regex_build_quantifier_lbrace:nw {#1} } - } -\cs_new_protected_nopar:Npx \regex_build_quantifier_lbrace:nw #1#2#3 - { - \exp_not:N \prg_case_str:nnn { #2 #3 } - { - { \exp_not:N \regex_build_control:N , } - { - \exp_not:N \regex_get_digits:nw - { \exp_not:N \regex_build_quantifier_lbrace:nnw {#1} } - } - { \exp_not:N \regex_build_control:N \c_rbrace_str } - { \exp_not:N \regex_build_quantifier_end:n {n} {#1} } - } - { - \exp_not:N \regex_build_quantifier_end:n { } - \exp_not:N \regex_build_raw:N \c_lbrace_str #1#2 - } - } -\cs_new_protected_nopar:Npn \regex_build_quantifier_lbrace:nnw #1#2#3#4 - { - \str_if_eq:xxTF - { \exp_not:n {#3#4} } - { \exp_not:N \regex_build_control:N \c_rbrace_str } - { - \tl_if_empty:nTF {#2} - { \regex_build_quantifier_aux:nnNN { {#1} } { n* } } - { - \int_compare:nNnT {#1} > {#2} - { \msg_error:nn { regex } {4} } - \regex_build_quantifier_aux:nnNN { {#1} {#2} } { nn } - } - } - { - \regex_build_quantifier_end:n { } - \use:x - { - \exp_args:No \tl_map_function:nN - { \c_lbrace_str #1 , #2 } - \regex_build_raw:N - } - #3 #4 - } - } -\cs_new_protected_nopar:Npn \regex_build_quantifier_end:n #1 - { \use:c { regex_build_ \l_regex_one_or_group_tl _ #1 : } } -\cs_new_protected_nopar:Npn \regex_build_one_quantifier: - { - \tl_set:Nx \l_regex_one_or_group_tl { one } - \regex_build_quantifier:w - } -\cs_new_protected_nopar:Npn \regex_build_one_: - { - \regex_build_transition_aux:NN - \regex_build_tmp_class:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_?: } - { - \regex_build_transitions_aux:NNNN - \regex_build_tmp_class:n \l_regex_right_state_int - \regex_action_free:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_??: } - { - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_right_state_int - \regex_build_tmp_class:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_*: } - { - \regex_build_transitions_aux:NNNN - \regex_build_tmp_class:n \l_regex_left_state_int - \regex_action_free:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_*?: } - { - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_right_state_int - \regex_build_tmp_class:n \l_regex_left_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_+: } - { - \regex_build_one_: - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_tmpa_int - \regex_action_free:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_one_+?: } - { - \regex_build_one_: - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_right_state_int - \regex_action_free:n \l_regex_tmpa_int - } -\cs_new_protected_nopar:Npn \regex_build_one_n: #1 - { \prg_replicate:nn {#1} { \regex_build_one_: } } -\cs_new_eq:cN { regex_build_one_n?: } \regex_build_one_n: -\cs_new_protected_nopar:cpx { regex_build_one_n*: } #1 - { - \exp_not:N \prg_replicate:nn {#1} { \exp_not:N \regex_build_one_: } - \exp_not:c { regex_build_one_*: } - } -\cs_new_protected_nopar:cpx { regex_build_one_n*?: } #1 - { - \exp_not:N \prg_replicate:nn {#1} { \exp_not:N \regex_build_one_: } - \exp_not:c { regex_build_one_*?: } - } -\cs_new_protected_nopar:Npn \regex_build_one_nn_aux:Nnn #1#2#3 - { - \prg_replicate:nn {#2} { \regex_build_one_: } - \prg_replicate:nn {#3-#2} {#1} - } -\cs_new_protected_nopar:Npx \regex_build_one_nn: - { \regex_build_one_nn_aux:Nnn \exp_not:c { regex_build_one_?: } } -\cs_new_protected_nopar:cpx { regex_build_one_nn?: } - { \regex_build_one_nn_aux:Nnn \exp_not:c { regex_build_one_??: } } -\cs_new_protected_nopar:cpn { regex_build_(: } #1#2 - { - \str_if_eq:nnTF { #1 #2 } { \regex_build_control:N ? } - { \regex_build_special_group:NN } - { - \int_incr:N \l_regex_capturing_group_int - \seq_push:Nx \l_regex_capturing_group_seq - { \int_use:N \l_regex_capturing_group_int } - \regex_build_open_aux: - #1 #2 - } - } -\cs_new_protected_nopar:Npn \regex_build_open_aux: - { - \regex_build_new_state: - \seq_push:Nx \l_regex_group_begin_seq - { - \int_set:Nn \l_regex_left_state_int - { \int_use:N \l_regex_left_state_int } - } - \bool_if:NTF \l_regex_caseless_bool - { \seq_push:Nn \l_regex_group_end_seq { \regex_build_caseless: } } - { \seq_push:Nn \l_regex_group_end_seq { \regex_build_caseful: } } - \seq_push:Nx \l_regex_group_end_seq - { - \int_set:Nn \l_regex_right_state_int - { \int_use:N \l_regex_right_state_int } - } - \regex_build_begin_alternation: - } -\cs_new_protected_nopar:cpn { regex_build_|: } - { - \regex_build_end_alternation: - \regex_build_begin_alternation: - } -\cs_new_protected_nopar:cpn { regex_build_): } - { - \seq_if_empty:NTF \l_regex_capturing_group_seq - { \msg_error:nn { regex } { 22 } } - { - \regex_build_close_aux: - \regex_build_group_quantifier: - } - } -\cs_new_protected_nopar:Npn \regex_build_close_aux: - { - \regex_build_end_alternation: - \regex_seq_pop:N \l_regex_group_begin_seq - \regex_seq_pop:N \l_regex_group_end_seq - \regex_seq_pop:N \l_regex_group_end_seq - } -\cs_new_protected_nopar:Npn \regex_build_begin_alternation: - { - \regex_build_new_state: - \regex_seq_get:N \l_regex_group_begin_seq - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - } -\cs_new_protected_nopar:Npn \regex_build_end_alternation: - { - \int_set_eq:NN \l_regex_left_state_int \l_regex_right_state_int - \regex_seq_get:N \l_regex_group_end_seq - \regex_toks_put_right:Nx \l_regex_left_state_int - { - \regex_action_free:n - { - \int_eval:n - { \l_regex_right_state_int - \l_regex_left_state_int } - } - } - } -\cs_new_protected_nopar:Npn \regex_build_special_group:NN #1#2 - { - \cs_if_exist_use:cF { regex_build_special_group_\token_to_str:N #2 : } - { - \msg_error:nn { regex } { -998 } - \regex_build_control:N ( % ) - \regex_build_raw:N ? - #1 #2 - } - } -\cs_new_protected_nopar:cpn { regex_build_special_group_:: } - { - \seq_push:Nx \l_regex_capturing_group_seq { * } - \regex_build_open_aux: - } -\cs_new_protected_nopar:Npn \regex_build_special_group_i: - { - \regex_build_options:NNN + - \regex_build_raw:N i - } -\cs_new_protected_nopar:cpn { regex_build_special_group_-: } - { - \regex_build_options:NNN - - } -\cs_new_protected_nopar:Npn \regex_build_options:NNN #1#2#3 - { - \token_if_eq_meaning:NNTF \regex_build_raw:N #2 - { - \cs_if_exist_use:cF { regex_build_option_#1#3: } - { \msg_error:nnx { regex } { unknown-option } { #3 } } - \regex_build_options:NNN #1 - } - { - \prg_case_str:nnn { #3 } - { % ( - { ) } { } - { - } { \regex_build_options:NNN - } - } - { \msg_error:nnx { regex } { invalid-in-option } { #3 } } - } - } -\cs_new_protected_nopar:cpn { regex_build_option_+i: } - { - \regex_build_caseless: - \cs_set_eq:NN \regex_match_loop_case_hook: - \regex_match_loop_caseless_hook: - } -\cs_new_protected_nopar:cpn { regex_build_option_-i: } - { \regex_build_caseful: } -\cs_new_protected_nopar:Npn \regex_build_group_quantifier: - { - \tl_set:Nn \l_regex_one_or_group_tl { group } - \regex_build_quantifier:w - } -\cs_new_protected_nopar:Npn \regex_build_group_submatches:NN #1#2 - { - \seq_pop:NN \l_regex_capturing_group_seq \l_regex_tmpa_tl - \str_if_eq:xxF { \l_regex_tmpa_tl } { * } - { - \regex_toks_put_left:Nx #1 - { \regex_action_submatch:n { \l_regex_tmpa_tl < } } - \regex_toks_put_left:Nx #2 - { \regex_action_submatch:n { \l_regex_tmpa_tl > } } - } - } -\cs_new_protected_nopar:Npn \regex_build_group_: - { - \regex_build_group_submatches:NN - \l_regex_left_state_int \l_regex_right_state_int - \regex_build_transition_aux:NN - \regex_action_free:n \l_regex_right_state_int - } -\cs_new_protected_nopar:Npn \regex_build_group_shift:N #1 - { - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \regex_build_new_state: - \tex_toks:D \l_regex_right_state_int = \tex_toks:D \l_regex_tmpa_int - \regex_toks_put_left:Nx \l_regex_right_state_int - { - \int_set:Nn \l_regex_current_state_int - { \int_use:N \l_regex_tmpa_int } % ^^A here we lie! - } - \cs_set:Npx \regex_tmp:w - { - \tex_toks:D \l_regex_tmpa_int - { - \s_regex_toks - #1 { \int_eval:n { \l_regex_right_state_int - \l_regex_tmpa_int } } - } - } - \regex_tmp:w - \regex_build_group_submatches:NN - \l_regex_right_state_int \l_regex_left_state_int - } -\cs_new_protected_nopar:Npn \regex_build_group_qs_aux:NN #1#2 - { - \regex_build_group_shift:N \regex_action_free:n - \int_set_eq:NN \l_regex_right_state_int \l_regex_left_state_int - \regex_build_transition_aux:NN \regex_action_free:n #1 - #2 \l_regex_tmpa_int - { - \regex_action_free:n - { \int_eval:n { \l_regex_right_state_int - \l_regex_tmpa_int } } - } - } -\cs_new_protected_nopar:cpn { regex_build_group_?: } - { - \regex_build_group_qs_aux:NN - \l_regex_right_state_int \regex_toks_put_right:Nx - } -\cs_new_protected_nopar:cpn { regex_build_group_??: } - { - \regex_build_group_qs_aux:NN - \l_regex_right_state_int \regex_toks_put_left:Nx - } -\cs_new_protected_nopar:cpn { regex_build_group_*: } - { - \regex_build_group_qs_aux:NN - \l_regex_tmpa_int \regex_toks_put_right:Nx - } -\cs_new_protected_nopar:cpn { regex_build_group_*?: } - { - \regex_build_group_qs_aux:NN - \l_regex_tmpa_int \regex_toks_put_left:Nx - } -\cs_new_protected_nopar:cpn { regex_build_group_+: } - { - \regex_build_group_submatches:NN - \l_regex_left_state_int \l_regex_right_state_int - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_tmpa_int - \regex_action_free:n \l_regex_right_state_int - } -\cs_new_protected_nopar:cpn { regex_build_group_+?: } - { - \regex_build_group_submatches:NN - \l_regex_left_state_int \l_regex_right_state_int - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_right_state_int - \regex_action_free:n \l_regex_tmpa_int - } -\cs_new_protected_nopar:Npn \regex_build_group_n_aux:n #1 - { - \regex_toks_put_right:Nx \l_regex_right_state_int - { - \regex_action_free:n - { \int_eval:n { \l_regex_max_state_int - \l_regex_left_state_int } } - } - \int_set_eq:NN \l_regex_tmpa_int \l_regex_left_state_int - \int_set:Nn \l_regex_tmpb_int { \l_regex_max_state_int + \c_one } - \int_set:Nn \l_regex_max_state_int - { - \l_regex_left_state_int - \c_one - + #1 * ( \l_regex_max_state_int - \l_regex_left_state_int + \c_one ) - } - \int_until_do:nNnn \l_regex_tmpb_int > \l_regex_max_state_int - { - \tex_toks:D \l_regex_tmpb_int = \tex_toks:D \l_regex_tmpa_int - \int_incr:N \l_regex_tmpa_int - \int_incr:N \l_regex_tmpb_int - } - } -\cs_new_protected_nopar:Npn \regex_build_group_n: #1 - { % ^^A todo: catch case #1 <= 0. - \regex_build_group_n_aux:n {#1} - \regex_build_transition_aux:NN - \regex_action_free:n \l_regex_right_state_int - \regex_build_group_submatches:NN - \l_regex_tmpa_int \l_regex_left_state_int - } -\cs_new_eq:cN { regex_build_group_n?: } \regex_build_group_n: -\cs_new_protected_nopar:cpn { regex_build_group_n*: } #1 - { % ^^A todo: catch case #1 <= 0. - \regex_build_group_n_aux:n {#1} - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_tmpa_int - \regex_action_free:n \l_regex_right_state_int - \regex_build_group_submatches:NN - \l_regex_tmpa_int \l_regex_left_state_int - } -\cs_new_protected_nopar:cpn { regex_build_group_n*?: } #1 - { % ^^A todo: catch case #1 <= 0. - \regex_build_group_n_aux:n {#1} - \regex_build_transitions_aux:NNNN - \regex_action_free:n \l_regex_right_state_int - \regex_action_free:n \l_regex_tmpa_int - \regex_build_group_submatches:NN - \l_regex_tmpa_int \l_regex_left_state_int - } -\cs_new_protected_nopar:Npn \regex_build_group_nn: #1#2 - { % ^^A Not Implemented Yet! - \msg_expandable_error:n { Quantifier~{m,n}~not~implemented~yet } - \use:c { regex_build_group_n*: } {#1} - } -\cs_new_protected_nopar:cpn { regex_build_group_nn?: } #1#2 - { % ^^A Not Implemented Yet! - \msg_expandable_error:n { Quantifier~{m,n}~not~implemented~yet } - \use:c { regex_build_group_n*?: } {#1} - } -\cs_new_protected:Npn \regex_store_state:n #1 - { - \int_incr:N \l_regex_max_index_int - \tex_skip:D \l_regex_max_index_int #1 sp \scan_stop: - \regex_store_submatches:n {#1} - } -\cs_new_protected_nopar:Npn \regex_state_use_with_submatches: - { \regex_state_use_aux:n { } } -\cs_new_protected_nopar:Npn \regex_state_use: - { \regex_state_use_aux:n { \exp_after:wN \regex_state_use_aux_ii:w } } -\cs_new_nopar:Npn \regex_state_use_aux_ii:w #1 \s_regex_toks { } -\cs_new_protected_nopar:Npn \regex_state_use_aux:n #1 - { - \if_num:w \tex_dimen:D \l_regex_current_state_int - < \l_regex_unique_step_int - \tex_dimen:D \l_regex_current_state_int - = \l_regex_unique_step_int sp \scan_stop: - #1 \tex_the:D \tex_toks:D \exp_after:wN \l_regex_current_state_int - \fi: - \scan_stop: - } -\cs_new_protected_nopar:Npn \regex_disable_submatches: - { - \cs_set_eq:NN \regex_state_use_with_submatches: \regex_state_use: - \cs_set_eq:NN \regex_store_submatches:n - \regex_protected_use_none:n - \cs_set_eq:NN \regex_action_submatches:n - \regex_protected_use_none:n - } -\cs_new_protected:Npn \regex_protected_use_none:n #1 { } -\cs_new_protected:Npn \regex_store_submatches:n #1 - { - \tex_toks:D #1 \exp_after:wN - { - \tex_romannumeral:D - \exp_after:wN \regex_store_submatches_aux:w - \tex_the:D \tex_toks:D #1 - } - } -\cs_new_protected:Npn \regex_store_submatches_aux:w #1 \s_regex_toks - { - \regex_store_submatches_aux_ii:Nnnw - #1 - \regex_state_submatches:nn \c_minus_one \q_prop - \s_regex_toks - } -\cs_new_protected:Npn \regex_store_submatches_aux_ii:Nnnw - \regex_state_submatches:nn #1 #2 #3 \s_regex_toks - { - \exp_after:wN \c_zero - \exp_after:wN \regex_state_submatches:nn \exp_after:wN - { - \int_value:w \int_eval:w - \l_regex_unique_step_int + \c_one - \exp_after:wN - } - \exp_after:wN { \l_regex_current_submatches_prop } - \regex_state_submatches:nn {#1} {#2} - \s_regex_toks - } -\cs_new_protected:Npn \regex_state_submatches:nn #1#2 - { - \if_num:w #1 = \l_regex_unique_step_int - \tl_set:Nn \l_regex_current_submatches_prop { #2 } - \fi: - } -\cs_new_protected:Npn \regex_match:n #1 - { - \tl_set:Nx \l_regex_query_other_str { \tl_to_other_str:n {#1} } - \regex_match_initial_setup: - \regex_match_once: - } -\cs_new_protected_nopar:Npn \regex_match_once: - { - \regex_match_setup: - \exp_after:wN \regex_match_once_aux: \l_regex_query_other_str - \q_recursion_tail \q_recursion_stop - \bool_if:NT \l_regex_success_bool { \l_regex_every_match_tl } - } -\cs_new_protected_nopar:Npn \regex_match_once_aux: - { - \int_compare:nNnTF \l_regex_start_step_int = \c_zero - { - \int_set_eq:NN \l_regex_current_char_int \c_minus_one - \regex_match_loop:N - } - { - \str_skip_do:nn - { \l_regex_start_step_int - \c_one } - { \regex_match_once_aux_ii:N } - } - } -\cs_new_protected_nopar:Npn \regex_match_once_aux_ii:N #1 - { - \int_set:Nn \l_regex_current_char_int { `#1 } - \regex_match_loop:N - } -\cs_new_protected_nopar:Npn \regex_match_initial_setup: - { - \prg_stepwise_inline:nnnn {1} {1} { \l_regex_max_state_int } - { \tex_dimen:D ##1 \c_minus_one sp \scan_stop: } - \int_set_eq:NN \l_regex_unique_step_int \c_minus_one - \int_set_eq:NN \l_regex_start_step_int \c_minus_one - \int_set_eq:NN \l_regex_current_step_int \c_zero - \int_set_eq:NN \l_regex_success_step_int \c_zero - \bool_set_false:N \l_regex_success_empty_bool - } -\cs_new_protected_nopar:Npn \regex_match_setup: - { - \prop_clear:N \l_regex_current_submatches_prop - \bool_if:NTF \l_regex_success_empty_bool - { \cs_set_eq:NN \regex_last_match_empty:F \regex_last_match_empty_yes:F } - { \cs_set_eq:NN \regex_last_match_empty:F \regex_last_match_empty_no:F } - \int_set_eq:NN \l_regex_start_step_int \l_regex_success_step_int - \int_set_eq:NN \l_regex_current_step_int \l_regex_start_step_int - \int_decr:N \l_regex_current_step_int - \bool_set_false:N \l_regex_success_bool - \int_zero:N \l_regex_max_index_int - \regex_store_state:n {1} - } -\cs_new_eq:NN \s_regex_step \scan_stop: -\cs_new:Npn \regex_break_step:w #1 \s_regex_step { } -\cs_new_protected_nopar:Npn \regex_match_loop:N #1 - { - \regex_match_loop_setup:N #1 - \cs_set_nopar:Npx \regex_tmp:w - { - \int_zero:N \l_regex_max_index_int - \prg_stepwise_function:nnnN - {1} {1} { \l_regex_max_index_int } - \regex_match_one_index:n - } - \regex_tmp:w - \s_regex_step - \if_num:w \l_regex_max_index_int = \c_zero - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w - \fi: - \quark_if_recursion_tail_stop:N #1 - \regex_match_loop:N - } -\cs_new_nopar:Npn \regex_match_one_index:n #1 - { - \regex_match_one_index_aux:n - { \int_value:w \tex_skip:D #1 } - } -\cs_new_protected_nopar:Npn \regex_match_one_index_aux:n #1 - { - \int_set:Nn \l_regex_current_state_int {#1} - \prop_clear:N \l_regex_current_submatches_prop - \regex_state_use_with_submatches: - } -\cs_new_protected_nopar:Npn \regex_match_loop_setup:N #1 - { - \int_incr:N \l_regex_current_step_int - \int_incr:N \l_regex_unique_step_int - \bool_set_false:N \l_regex_fresh_thread_bool - \int_set_eq:NN \l_regex_last_char_int \l_regex_current_char_int - \if_meaning:w #1 \q_recursion_tail - \int_set_eq:NN \l_regex_current_char_int \c_minus_one - \else: - \int_set:Nn \l_regex_current_char_int {`#1} - \fi: - \regex_match_loop_case_hook: - } -\cs_new_protected_nopar:Npn \regex_match_loop_case_hook: { } -\cs_new_protected_nopar:Npn \regex_match_loop_caseless_hook: - { - \int_set_eq:NN \l_regex_case_changed_char_int \l_regex_current_char_int - \if_num:w \l_regex_current_char_int < \c_ninety_one - \if_num:w \l_regex_current_char_int < \c_sixty_five - \else: - \int_add:Nn \l_regex_case_changed_char_int { \c_thirty_two } - \fi: - \else: - \if_num:w \l_regex_current_char_int < \c_one_hundred_twenty_three - \if_num:w \l_regex_current_char_int < \c_ninety_seven - \else: - \int_sub:Nn \l_regex_case_changed_char_int { \c_thirty_two } - \fi: - \fi: - \fi: - } -\cs_new_protected_nopar:Npn \regex_action_start_wildcard:nn #1#2 - { - \bool_set_true:N \l_regex_fresh_thread_bool - \regex_action_free:n {#2} - \bool_set_false:N \l_regex_fresh_thread_bool - \regex_action_cost:n {#1} - } -\cs_new_protected_nopar:Npn \regex_action_cost:n #1 - { - \exp_args:Nf \regex_store_state:n %^^A optimize! - { \int_eval:n { \l_regex_current_state_int + #1 } } - } -\cs_new_protected_nopar:Npn \regex_action_success: - { - \regex_last_match_empty:F - { - \bool_set_true:N \l_regex_success_bool - \bool_set_eq:NN \l_regex_success_empty_bool - \l_regex_fresh_thread_bool - \int_set_eq:NN \l_regex_success_step_int - \l_regex_current_step_int - \prop_set_eq:NN \l_regex_success_submatches_prop - \l_regex_current_submatches_prop - \regex_break_step:w - } - } -\cs_new_protected_nopar:Npn \regex_action_free:n #1 - { - \cs_set_nopar:Npx \regex_tmp:w - { - \int_add:Nn \l_regex_current_state_int {#1} - \regex_state_use: - \int_set:Nn \l_regex_current_state_int - { \int_use:N \l_regex_current_state_int } - \tl_set:Nn \exp_not:N \l_regex_current_submatches_prop - { \exp_not:o \l_regex_current_submatches_prop } - } - \regex_tmp:w - } -\cs_new_protected_nopar:Npn \regex_action_submatch:n #1 - { - \prop_put:Nno \l_regex_current_submatches_prop {#1} - { \int_use:N \l_regex_current_step_int } - } -\cs_new_protected_nopar:Npn \regex_extract: - { - \seq_gclear:N \g_regex_submatches_seq - \prg_stepwise_inline:nnnn - {0} {1} { \l_regex_capturing_group_int } - { - \regex_extract_aux:nTF { ##1 } - { - \seq_gput_right:Nx \g_regex_submatches_seq - { \regex_query_substr:NN \l_regex_tmpa_tl \l_regex_tmpb_tl } - } - { \seq_gput_right:Nn \g_regex_submatches_seq { } } - } - } -\cs_new_protected_nopar:Npn \regex_extract_aux:nTF #1#2#3 - { - \prop_get:NnNTF \l_regex_success_submatches_prop - { #1 < } \l_regex_tmpa_tl - { - \prop_get:NnNTF \l_regex_success_submatches_prop - { #1 > } \l_regex_tmpb_tl - {#2} - {#3} - } - {#3} - } -\cs_new_protected_nopar:Npn \regex_set:Nn - { \regex_set_aux:NNn \tl_set_eq:NN } -\cs_new_protected_nopar:Npn \regex_gset:Nn - { \regex_set_aux:NNn \tl_gset_eq:NN } -\cs_new_protected:Npn \regex_set_aux:NNn #1#2#3 - { - \group_begin: - \regex_build:n {#3} - \tl_gset:Nx \g_regex_tmpa_tl - { - \exp_not:N \regex_nfa:Nw \exp_not:N #2 - \l_regex_max_state_int - = \int_use:N \l_regex_max_state_int - \l_regex_capturing_group_int - = \int_use:N \l_regex_capturing_group_int - \token_if_eq_meaning:NNT - \regex_match_loop_case_hook: - \regex_match_loop_caseless_hook: - { - \cs_set_eq:NN \regex_match_loop_case_hook: - \regex_match_loop_caseless_hook: - } - \prg_stepwise_function:nnnN - {1} {1} {\l_regex_max_state_int} - \regex_set_aux:n - \regex_nfa_end: - } - \group_end: - #1 #2 \g_regex_tmpa_tl - } -\cs_new_nopar:Npn \regex_set_aux:n #1 - { \tex_toks:D #1 { \tex_the:D \tex_toks:D #1 } } -\cs_new:Npn \regex_nfa:Nw #1 #2 \regex_nfa_end: - { \msg_expandable_error:n { Automaton~#1 used~incorrectly. } } -\cs_new_eq:NN \regex_nfa_end: \scan_stop: -\prg_new_protected_conditional:Npnn \regex_check_nfa:N #1 { T , TF } - { \exp_after:wN \regex_check_nfa_aux:Nw #1 \q_stop } -\cs_new:Npn \regex_check_nfa_aux:Nw #1 #2 \q_stop - { - \if_meaning:w \regex_nfa:Nw #1 - \prg_return_true: - \else: - \msg_error:nnx { regex } { not-nfa } { \token_to_str:N #1 } - \prg_return_false: - \fi: - } -\cs_new_protected_nopar:Npn \regex_use:N #1 - { \exp_after:wN \use_none:nn #1 } -\cs_new_protected:Npn \regex_user_aux:n #1 - { - \group_begin: - \tl_clear:N \l_regex_every_match_tl - #1 - \group_end: - } -\cs_new_protected_nopar:Npn \regex_return_after_group: - { - \if_meaning:w \c_true_bool \l_regex_success_bool - \group_insert_after:N \prg_return_true: - \else: - \group_insert_after:N \prg_return_false: - \fi: - } -\cs_new_protected_nopar:Npn \regex_extract_after_group:N #1 - { - \if_meaning:w \c_true_bool \l_regex_success_bool - \regex_extract: - \group_insert_after:N \seq_set_eq:NN - \group_insert_after:N #1 - \group_insert_after:N \g_regex_submatches_seq - \fi: - } -\cs_new_protected_nopar:Npn \regex_count_after_group:N #1 - { - \group_insert_after:N \int_set_eq:NN - \group_insert_after:N #1 - \group_insert_after:N \g_regex_match_count_int - } -\prg_new_protected_conditional:Npnn \regex_match:nn #1#2 { T , F , TF } - { - \regex_user_aux:n - { - \regex_disable_submatches: - \regex_build:n {#1} - \regex_match:n {#2} - \regex_return_after_group: - } - } -\prg_new_protected_conditional:Npnn \regex_match:Nn #1#2 { T , F , TF } - { - \regex_check_nfa:NTF #1 - { - \regex_user_aux:n - { - \regex_disable_submatches: - \regex_use:N #1 - \regex_match:n {#2} - \regex_return_after_group: - } - } - { \prg_return_false: } - } -\cs_new_protected:Npn \regex_count:nnN #1#2#3 - { - \regex_user_aux:n - { - \regex_disable_submatches: - \int_gzero:N \g_regex_match_count_int - \tl_set:Nn \l_regex_every_match_tl - { - \int_gincr:N \g_regex_match_count_int - \regex_match_once: - } - \regex_build:n {#1} - \regex_match:n {#2} - \regex_count_after_group:N #3 - } - } -\cs_new_protected:Npn \regex_count:NnN #1#2#3 - { - \regex_check_nfa:NT #1 - { - \regex_user_aux:n - { - \regex_disable_submatches: - \int_gzero:N \g_regex_match_count_int - \tl_set:Nn \l_regex_every_match_tl - { - \int_gincr:N \g_regex_match_count_int - \regex_match_once: - } - \regex_use:N #1 - \regex_match:n {#2} - \regex_count_after_group:N #3 - } - } - } -\cs_new_protected:Npn \regex_extract_once:nnN #1#2#3 - { - \regex_user_aux:n - { - \regex_build:n {#1} - \regex_match:n {#2} - \regex_extract_after_group:N #3 - } - } -\prg_new_protected_conditional:Npnn \regex_extract_once:nnN #1#2#3 - { T , F , TF } - { - \regex_user_aux:n - { - \regex_build:n {#1} - \regex_match:n {#2} - \regex_extract_after_group:N #3 - \regex_return_after_group: - } - } -\cs_new_protected:Npn \regex_extract_once:NnN #1#2#3 - { - \regex_check_nfa:NT #1 - { - \regex_user_aux:n - { - \regex_use:N #1 - \regex_match:n {#2} - \regex_extract_after_group:N #3 - } - } - } -\prg_new_protected_conditional:Npnn \regex_extract_once:NnN #1#2#3 - { T , F , TF } - { - \regex_check_nfa:NTF #1 - { - \regex_user_aux:n - { - \regex_use:N #1 - \regex_match:n {#2} - \regex_extract_after_group:N #3 - \regex_return_after_group: - } - } - { \prg_return_false: } - } -\cs_new_protected:Npn \regex_extract_all:nnN #1#2#3 - { - \regex_user_aux:n - { - \seq_gclear:N \g_regex_extract_all_seq - \tl_set:Nn \l_regex_every_match_tl { \regex_extract_all_aux: } - \regex_build:n {#1} - \regex_match:n {#2} - \regex_extract_all_after_group:N #3 - } - } -\cs_new_protected:Npn \regex_extract_all:NnN #1#2#3 - { - \regex_check_nfa:NT #1 - { - \regex_user_aux:n - { - \seq_gclear:N \g_regex_extract_all_seq - \tl_set:Nn \l_regex_every_match_tl { \regex_extract_all_aux: } - \regex_use:N #1 - \regex_match:n {#2} - \regex_extract_all_after_group:N #3 - } - } - } -\cs_new_protected_nopar:Npn \regex_extract_all_aux: - { - \regex_extract: - \seq_gconcat:NNN \g_regex_extract_all_seq - \g_regex_extract_all_seq \g_regex_submatches_seq - \regex_match_once: - } -\cs_new_protected_nopar:Npn \regex_extract_all_after_group:N #1 - { - \seq_if_empty:NF \g_regex_extract_all_seq - { - \regex_extract: - \group_insert_after:N \seq_set_eq:NN - \group_insert_after:N #1 - \group_insert_after:N \g_regex_extract_all_seq - } - } -\cs_new_protected:Npn \regex_split:nnN #1#2#3 - { - \regex_user_aux:n - { - \seq_gclear:N \g_regex_split_seq - \tl_set:Nn \l_regex_every_match_tl { \regex_split_aux: } - \regex_build:n {#1} - \regex_match:n {#2} - \regex_split_after_group:N #3 - } - } -\cs_new_protected:Npn \regex_split:NnN #1#2#3 - { - \regex_check_nfa:NT #1 - { - \regex_user_aux:n - { - \seq_gclear:N \g_regex_split_seq - \tl_set:Nn \l_regex_every_match_tl { \regex_split_aux: } - \regex_use:N #1 - \regex_match:n {#2} - \regex_split_after_group:N #3 - } - } - } -\cs_new_protected_nopar:Npn \regex_split_aux: - { - \int_compare:nNnF \l_regex_start_step_int = \l_regex_success_step_int - { - \regex_extract: - \seq_pop:NN \g_regex_submatches_seq \l_regex_tmpa_tl - \regex_extract_aux:nTF {0} - { - \seq_gput_left:Nx \g_regex_submatches_seq - { - \regex_query_substr:NN - \l_regex_start_step_int \l_regex_tmpa_tl - } - } - { \msg_error:nn { regex } { internal } } - \seq_gconcat:NNN \g_regex_split_seq - \g_regex_split_seq \g_regex_submatches_seq - } - \regex_match_once: - } -\cs_new_protected_nopar:Npn \regex_split_after_group:N #1 - { - \int_compare:nNnTF \l_regex_start_step_int = \l_regex_current_step_int - { - \bool_if:NF \l_regex_success_empty_bool - { \seq_gput_right:Nn \g_regex_split_seq { } } - } - { - \seq_gput_right:Nx \g_regex_split_seq - { - \regex_query_substr:NN - \l_regex_start_step_int \l_regex_current_step_int - } - } - \group_insert_after:N \seq_set_eq:NN - \group_insert_after:N #1 - \group_insert_after:N \g_regex_split_seq - } -\cs_new_protected:Npn \regex_replacement:n #1 - { - \str_aux_escape:NNNn - \prg_do_nothing: - \regex_replacement_escaped:N - \prg_do_nothing: - {#1} - \tl_set_eq:NN \l_regex_replacement_tl \g_str_result_tl - \tl_set:Nx \l_regex_replacement_tl - { \l_regex_replacement_tl \prg_do_nothing: } - } -\cs_new_nopar:Npn \regex_replacement_escaped:N #1 - { - \regex_token_if_other_digit:NTF #1 - { - \exp_not:n - { \exp_not:n { \seq_item:Nn \g_regex_submatches_seq } } {#1} - } - { - \token_if_eq_charcode:NNTF g #1 - { \exp_not:N \regex_replacement_submatch:w } - { #1 } - } - } -\cs_new_nopar:Npn \regex_replacement_submatch:w #1 - { - \exp_after:wN \token_if_eq_meaning:NNTF \c_lbrace_str #1 - { \regex_replacement_submatch_aux:nN { } } - { - \regex_token_if_other_digit:NTF #1 - { \exp_not:n { \seq_item:Nn \g_regex_submatches_seq } } - { \msg_expandable_error:n { \g misused~in~replacement~text. } } - #1 - } - } -\cs_new_nopar:Npn \regex_replacement_submatch_aux:nN #1 #2 - { - \regex_token_if_other_digit:NTF #2 - { \regex_replacement_submatch_aux:nN {#1#2} } - { - \exp_not:n { \seq_item:Nn \g_regex_submatches_seq } {#1} - \exp_after:wN \token_if_eq_meaning:NNF \c_rbrace_str #2 - { - \msg_expandable_error:n { \g misused~in~replacement~text. } - #2 - } - } - } -\cs_new_protected_nopar:Npn \regex_replace_after_group:N #1 - { - \group_insert_after:N \tl_set:Nx - \group_insert_after:N #1 - \group_insert_after:N { - \group_insert_after:N \tl_to_str:N - \group_insert_after:N \g_regex_replaced_str - \group_insert_after:N } - } -\cs_new_protected:Npn \regex_replace_once_aux:Nn #1#2 - { - \group_begin: - \regex_replace_after_group:N #1 - \tl_clear:N \l_regex_every_match_tl - #2 - \exp_args:No \regex_match:n {#1} - \regex_extract: - \regex_extract_aux:nTF {0} - { - \cs_set_nopar:Npn \regex_tmp:w - { \str_skip_do:nn { \l_regex_tmpb_tl } { } } - \tl_gset:Nx \g_regex_replaced_str - { - \regex_query_substr:NN \c_zero \l_regex_tmpa_tl - \l_regex_replacement_tl - \exp_after:wN \regex_tmp:w \l_regex_query_other_str - } - } - { \tl_gset_eq:NN \g_regex_replaced_str \l_regex_query_other_str } - \group_end: - } -\cs_new_protected:Npn \regex_replace_once:nnN #1#2#3 - { - \regex_replace_once_aux:Nn #3 - { - \regex_build:n {#1} - \regex_replacement:n {#2} - } - } -\cs_new_protected:Npn \regex_replace_once:NnN #1#2#3 - { - \regex_replace_once_aux:Nn #3 - { - \regex_use:N #1 - \regex_replacement:n {#2} - } - } -\prg_new_protected_conditional:Npnn \regex_replace_once:nnN #1#2#3 {T,F,TF} - { - \regex_replace_once_aux:Nn #3 - { - \regex_build:n {#1} - \regex_replacement:n {#2} - \regex_return_after_group: - } - } -\prg_new_protected_conditional:Npnn \regex_replace_once:NnN #1#2#3 {T,F,TF} - { - \regex_replace_once_aux:Nn #3 - { - \regex_use:N #1 - \regex_replacement:n {#2} - \regex_return_after_group: - } - } -\cs_new_protected:Npn \regex_replace_all_aux:Nn #1#2 - { - \group_begin: - \regex_replace_after_group:N #1 - \tl_set:Nn \l_regex_every_match_tl { \regex_replace_all_aux: } - \tl_gclear:N \g_regex_replaced_str - #2 - \exp_args:No \regex_match:n {#1} - \cs_set_nopar:Npn \regex_tmp:w - { \str_skip_do:nn { \l_regex_start_step_int } { } } - \tl_gput_right:Nx \g_regex_replaced_str - { \exp_after:wN \regex_tmp:w \l_regex_query_other_str } - \group_end: - } -\cs_new_protected_nopar:Npn \regex_replace_all_aux: - { - \regex_extract: - \regex_extract_aux:nTF {0} - { - \tl_gput_right:Nx \g_regex_replaced_str - { - \regex_query_substr:NN - \l_regex_start_step_int \l_regex_tmpa_tl - \l_regex_replacement_tl - } - } - { \msg_error:nn { regex } { internal } } - \regex_match_once: - } -\cs_new_protected:Npn \regex_replace_all:nnN #1#2#3 - { - \regex_replace_all_aux:Nn #3 - { - \regex_build:n {#1} - \regex_replacement:n {#2} - } - } -\cs_new_protected:Npn \regex_replace_all:NnN #1#2#3 - { - \regex_replace_all_aux:Nn #3 - { - \regex_use:N #1 - \regex_replacement:n {#2} - } - } -\msg_new:nnn { regex } { -998 } { Unsupported~construct } -\msg_new:nnn { regex } { -997 } - { The~regular~expression~is~too~large~(32768~states). } -\msg_new:nnn { regex } { 1 } { \iow_char:N\\~at~end~of~pattern } -\msg_new:nnn { regex } { 4 } - { Numbers~out~of~order~in~\iow_char:N\{\iow_char\}~quantifier. } -\msg_new:nnn { regex } { 6 } - { Missing~terminating~\iow_char:N\]~for~character~class } -\msg_new:nnn { regex } { 7 } - { Invalid~escape~sequence~in~character~class } -\msg_new:nnn { regex } { 8 } - { Range~out~of~order~in~character~class } -\msg_new:nnn { regex } { 22 } { Mismatched~parentheses } -\msg_new:nnn { regex } { 34 } - { Character~value~in~\iow_char:N\\x{...}~sequence~is~too~large } -\msg_new:nnn { regex } { not-nfa } - { - LaTeX~was~expecting~a~regular~expression~variable.\\ - Instead,~LaTeX~found~'#1'. - } -%% -%% -%% End of file `l3regex-trace.sty'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty index c57f415bc47..f3dc0b5a358 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3regex.sty @@ -46,18 +46,11 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3regex.dtx 2943 2011-10-30 15:59:43Z bruno $ +\GetIdInfo$Id: l3regex.dtx 3017 2011-11-28 00:10:02Z bruno $ {L3 Experimental Regular Expressions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \RequirePackage{l3str} -\int_const:Nn \c_forty_eight { 48 } -\int_const:Nn \c_fifty_eight { 58 } -\int_const:Nn \c_sixty_five { 65 } -\int_const:Nn \c_ninety_one { 91 } -\int_const:Nn \c_ninety_seven { 97 } -\int_const:Nn \c_one_hundred_twenty_three { 123 } -\int_const:Nn \c_one_hundred_twenty_seven { 127 } \cs_new:Npn \regex_tmp:w { } \tl_new:N \g_regex_tmpa_tl \tl_new:N \l_regex_tmpa_tl @@ -67,10 +60,13 @@ \int_new:N \l_regex_max_state_int \int_new:N \l_regex_left_state_int \int_new:N \l_regex_right_state_int -\seq_new:N \l_regex_group_begin_seq -\seq_new:N \l_regex_group_end_seq +\seq_new:N \l_regex_left_state_seq +\seq_new:N \l_regex_right_state_seq +\seq_new:N \l_regex_end_group_seq +\seq_new:N \l_regex_end_alternation_seq \int_new:N \l_regex_capturing_group_int \seq_new:N \l_regex_capturing_group_seq +\int_new:N \l_regex_capturing_group_max_int \tl_new:N \l_regex_one_or_group_tl \cs_new_eq:NN \regex_build_tmp_class:n \use_none:n \bool_new:N \l_regex_class_bool @@ -164,10 +160,10 @@ \seq_new:N \g_regex_split_seq \tl_new:N \l_regex_replacement_tl \tl_new:N \g_regex_replaced_str -\cs_new_eq:NN \s_regex_toks \scan_stop: +\cs_new_eq:NN \s_regex_stop \scan_stop: \cs_new_protected:Npn \regex_toks_put_left:Nx #1#2 { - \cs_set_nopar:Npx \regex_tmp:w \s_regex_toks { \s_regex_toks #2 } + \cs_set_nopar:Npx \regex_tmp:w \s_regex_stop { \s_regex_stop #2 } \tex_toks:D #1 \exp_after:wN \exp_after:wN \exp_after:wN { \exp_after:wN \regex_tmp:w \tex_the:D \tex_toks:D #1 } } @@ -190,12 +186,24 @@ \str_skip_do:nn {#1} { \str_collect_do:nn { #2 - #1 } { \use_i_delimit_by_q_stop:nw } } } -\cs_new_protected_nopar:Npn \regex_seq_pop:N #1 +\cs_new_protected:Npn \regex_seq_pop_int:NN #1#2 + { + \seq_pop:NN #1 \l_regex_tmpa_tl + \int_set:Nn #2 \l_regex_tmpa_tl + } +\cs_new_protected:Npn \regex_seq_get_int:NN #1#2 + { + \seq_get:NN #1 \l_regex_tmpa_tl + \int_set:Nn #2 \l_regex_tmpa_tl + } +\cs_new_protected:Npn \regex_seq_push_int:NN #1#2 + { \seq_push:No #1 { \int_use:N #2 } } +\cs_new_protected_nopar:Npn \regex_seq_pop_use:N #1 { \seq_pop:NN #1 \l_regex_tmpa_tl \l_regex_tmpa_tl } -\cs_new_protected_nopar:Npn \regex_seq_get:N #1 +\cs_new_protected_nopar:Npn \regex_seq_get_use:N #1 { \seq_get:NN #1 \l_regex_tmpa_tl \l_regex_tmpa_tl @@ -358,7 +366,7 @@ { \msg_error:nn { regex } { -997 } } { \int_incr:N \l_regex_max_state_int - \tex_toks:D \l_regex_max_state_int { \s_regex_toks } + \tex_toks:D \l_regex_max_state_int { \s_regex_stop } } \int_set_eq:NN \l_regex_left_state_int \l_regex_right_state_int \int_set_eq:NN \l_regex_right_state_int \l_regex_max_state_int @@ -388,7 +396,7 @@ { #1 } \regex_build_open_aux: \g_str_result_tl \prg_do_nothing: \prg_do_nothing: - \seq_push:Nn \l_regex_capturing_group_seq { 0 } + \regex_seq_push_int:NN \l_regex_capturing_group_seq \c_zero \regex_build_close_aux: \regex_build_group_: \regex_build_end: } @@ -519,7 +527,7 @@ { \cs_set:Npx \regex_build_tmp_class:n ##1 { - \regex_item_equal:n { \int_value:w `#1 } + \regex_item_equal:n { \int_value:w `#1 ~ } \regex_break_point:TF { \regex_action_cost:n { ##1 } } { } } \regex_build_one_quantifier: @@ -800,8 +808,8 @@ { \regex_build_special_group:NN } { \int_incr:N \l_regex_capturing_group_int - \seq_push:Nx \l_regex_capturing_group_seq - { \int_use:N \l_regex_capturing_group_int } + \regex_seq_push_int:NN + \l_regex_capturing_group_seq \l_regex_capturing_group_int \regex_build_open_aux: #1 #2 } @@ -809,19 +817,12 @@ \cs_new_protected_nopar:Npn \regex_build_open_aux: { \regex_build_new_state: - \seq_push:Nx \l_regex_group_begin_seq - { - \int_set:Nn \l_regex_left_state_int - { \int_use:N \l_regex_left_state_int } - } + \regex_seq_push_int:NN \l_regex_left_state_seq \l_regex_left_state_int + \regex_seq_push_int:NN \l_regex_right_state_seq \l_regex_right_state_int \bool_if:NTF \l_regex_caseless_bool - { \seq_push:Nn \l_regex_group_end_seq { \regex_build_caseless: } } - { \seq_push:Nn \l_regex_group_end_seq { \regex_build_caseful: } } - \seq_push:Nx \l_regex_group_end_seq - { - \int_set:Nn \l_regex_right_state_int - { \int_use:N \l_regex_right_state_int } - } + { \seq_push:Nn \l_regex_end_group_seq \regex_build_caseless: } + { \seq_push:Nn \l_regex_end_group_seq \regex_build_caseful: } + \seq_push:Nn \l_regex_end_alternation_seq { } \regex_build_begin_alternation: } \cs_new_protected_nopar:cpn { regex_build_|: } @@ -841,14 +842,15 @@ \cs_new_protected_nopar:Npn \regex_build_close_aux: { \regex_build_end_alternation: - \regex_seq_pop:N \l_regex_group_begin_seq - \regex_seq_pop:N \l_regex_group_end_seq - \regex_seq_pop:N \l_regex_group_end_seq + \regex_seq_pop_int:NN \l_regex_left_state_seq \l_regex_left_state_int + \regex_seq_pop_int:NN \l_regex_right_state_seq \l_regex_right_state_int + \regex_seq_pop_use:N \l_regex_end_group_seq + \seq_pop:NN \l_regex_end_alternation_seq \l_regex_tmpa_tl } \cs_new_protected_nopar:Npn \regex_build_begin_alternation: { \regex_build_new_state: - \regex_seq_get:N \l_regex_group_begin_seq + \regex_seq_get_int:NN \l_regex_left_state_seq \l_regex_left_state_int \regex_toks_put_right:Nx \l_regex_left_state_int { \regex_action_free:n @@ -861,7 +863,7 @@ \cs_new_protected_nopar:Npn \regex_build_end_alternation: { \int_set_eq:NN \l_regex_left_state_int \l_regex_right_state_int - \regex_seq_get:N \l_regex_group_end_seq + \regex_seq_get_int:NN \l_regex_right_state_seq \l_regex_right_state_int \regex_toks_put_right:Nx \l_regex_left_state_int { \regex_action_free:n @@ -870,6 +872,7 @@ { \l_regex_right_state_int - \l_regex_left_state_int } } } + \regex_seq_get_use:N \l_regex_end_alternation_seq } \cs_new_protected_nopar:Npn \regex_build_special_group:NN #1#2 { @@ -883,9 +886,39 @@ } \cs_new_protected_nopar:cpn { regex_build_special_group_:: } { - \seq_push:Nx \l_regex_capturing_group_seq { * } + \regex_seq_push_int:NN \l_regex_capturing_group_seq \c_minus_one \regex_build_open_aux: } +\cs_new_protected_nopar:cpn { regex_build_special_group_|: } + { + \regex_seq_push_int:NN \l_regex_capturing_group_seq \c_minus_one + \regex_build_new_state: + \regex_seq_push_int:NN \l_regex_left_state_seq \l_regex_left_state_int + \regex_seq_push_int:NN \l_regex_right_state_seq \l_regex_right_state_int + \seq_push:Nx \l_regex_end_alternation_seq + { + \exp_not:N \int_compare:nNnT + \l_regex_capturing_group_int + > \l_regex_capturing_group_max_int + { + \int_set_eq:NN + \l_regex_capturing_group_max_int + \l_regex_capturing_group_int + } + \int_set:Nn \l_regex_capturing_group_int + { \int_use:N \l_regex_capturing_group_int } + } + \seq_push:Nx \l_regex_end_group_seq + { + \bool_if:NTF \l_regex_caseless_bool + \regex_build_caseless: + \regex_build_caseful: + \int_set_eq:NN + \l_regex_capturing_group_int + \l_regex_capturing_group_max_int + } + \regex_build_begin_alternation: + } \cs_new_protected_nopar:Npn \regex_build_special_group_i: { \regex_build_options:NNN + @@ -928,7 +961,7 @@ \cs_new_protected_nopar:Npn \regex_build_group_submatches:NN #1#2 { \seq_pop:NN \l_regex_capturing_group_seq \l_regex_tmpa_tl - \str_if_eq:xxF { \l_regex_tmpa_tl } { * } + \int_compare:nNnF { \l_regex_tmpa_tl } < \c_zero { \regex_toks_put_left:Nx #1 { \regex_action_submatch:n { \l_regex_tmpa_tl < } } @@ -957,7 +990,7 @@ { \tex_toks:D \l_regex_tmpa_int { - \s_regex_toks + \s_regex_stop #1 { \int_eval:n { \l_regex_right_state_int - \l_regex_tmpa_int } } } } @@ -1082,7 +1115,7 @@ { \regex_state_use_aux:n { } } \cs_new_protected_nopar:Npn \regex_state_use: { \regex_state_use_aux:n { \exp_after:wN \regex_state_use_aux_ii:w } } -\cs_new_nopar:Npn \regex_state_use_aux_ii:w #1 \s_regex_toks { } +\cs_new_nopar:Npn \regex_state_use_aux_ii:w #1 \s_regex_stop { } \cs_new_protected_nopar:Npn \regex_state_use_aux:n #1 { \if_num:w \tex_dimen:D \l_regex_current_state_int @@ -1111,15 +1144,15 @@ \tex_the:D \tex_toks:D #1 } } -\cs_new_protected:Npn \regex_store_submatches_aux:w #1 \s_regex_toks +\cs_new_protected:Npn \regex_store_submatches_aux:w #1 \s_regex_stop { \regex_store_submatches_aux_ii:Nnnw #1 \regex_state_submatches:nn \c_minus_one \q_prop - \s_regex_toks + \s_regex_stop } \cs_new_protected:Npn \regex_store_submatches_aux_ii:Nnnw - \regex_state_submatches:nn #1 #2 #3 \s_regex_toks + \regex_state_submatches:nn #1 #2 #3 \s_regex_stop { \exp_after:wN \c_zero \exp_after:wN \regex_state_submatches:nn \exp_after:wN @@ -1130,7 +1163,7 @@ } \exp_after:wN { \l_regex_current_submatches_prop } \regex_state_submatches:nn {#1} {#2} - \s_regex_toks + \s_regex_stop } \cs_new_protected:Npn \regex_state_submatches:nn #1#2 { @@ -1192,8 +1225,6 @@ \int_zero:N \l_regex_max_index_int \regex_store_state:n {1} } -\cs_new_eq:NN \s_regex_step \scan_stop: -\cs_new:Npn \regex_break_step:w #1 \s_regex_step { } \cs_new_protected_nopar:Npn \regex_match_loop:N #1 { \regex_match_loop_setup:N #1 @@ -1204,8 +1235,7 @@ {1} {1} { \l_regex_max_index_int } \regex_match_one_index:n } - \regex_tmp:w - \s_regex_step + \regex_tmp:w \prg_break_point:n { } \if_num:w \l_regex_max_index_int = \c_zero \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: @@ -1277,7 +1307,7 @@ \l_regex_current_step_int \prop_set_eq:NN \l_regex_success_submatches_prop \l_regex_current_submatches_prop - \regex_break_step:w + \prg_map_break: } } \cs_new_protected_nopar:Npn \regex_action_free:n #1 @@ -1349,16 +1379,17 @@ \prg_stepwise_function:nnnN {1} {1} {\l_regex_max_state_int} \regex_set_aux:n - \regex_nfa_end: + \s_regex_stop } \group_end: #1 #2 \g_regex_tmpa_tl } \cs_new_nopar:Npn \regex_set_aux:n #1 { \tex_toks:D #1 { \tex_the:D \tex_toks:D #1 } } -\cs_new:Npn \regex_nfa:Nw #1 #2 \regex_nfa_end: - { \msg_expandable_error:n { Automaton~#1 used~incorrectly. } } -\cs_new_eq:NN \regex_nfa_end: \scan_stop: +\cs_new:Npn \regex_nfa:Nw #1 #2 \s_regex_stop + { \msg_expandable_kernel_error:nnn { regex } { nfa-misused } {#1} } +\cs_new_protected_nopar:Npn \regex_const:Nn + { \regex_set_aux:NNn \cs_new_eq:NN } \prg_new_protected_conditional:Npnn \regex_check_nfa:N #1 { T , TF } { \exp_after:wN \regex_check_nfa_aux:Nw #1 \q_stop } \cs_new:Npn \regex_check_nfa_aux:Nw #1 #2 \q_stop @@ -1644,7 +1675,7 @@ { \regex_token_if_other_digit:NTF #1 { \exp_not:n { \seq_item:Nn \g_regex_submatches_seq } } - { \msg_expandable_error:n { \g misused~in~replacement~text. } } + { \msg_expandable_kernel_error:nn { regex } { g-misused } } #1 } } @@ -1656,7 +1687,7 @@ \exp_not:n { \seq_item:Nn \g_regex_submatches_seq } {#1} \exp_after:wN \token_if_eq_meaning:NNF \c_rbrace_str #2 { - \msg_expandable_error:n { \g misused~in~replacement~text. } + \msg_expandable_kernel_error:nn { regex } { g-misused } #2 } } @@ -1791,6 +1822,10 @@ LaTeX~was~expecting~a~regular~expression~variable.\\ Instead,~LaTeX~found~'#1'. } +\msg_kernel_new:nnn { regex } { nfa-misused } + { Automaton~#1 used~incorrectly. } +\msg_kernel_new:nnn { regex } { g-misused } + { \g misused~in~replacement~text. } %% %% %% End of file `l3regex.sty'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-hex.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-hex.def new file mode 100644 index 00000000000..9af2e4322ad --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-hex.def @@ -0,0 +1,81 @@ +%% +%% This is file `l3str-hex.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `hex') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\cs_new_protected_nopar:Npn \str_convert_input_hex: + { + \tl_gset:Nx \g_str_result_tl + { + \str_output_byte:w " + \exp_after:wN \str_convert_input_hex_aux:N + \g_str_result_tl 0 { ? 0 - \c_one \prg_map_break: } + \prg_break_point:n { \str_output_end: } + } + } +\cs_new_nopar:Npn \str_convert_input_hex_aux:N #1 + { + \use_none:n #1 + \str_aux_hexadecimal_use:NTF #1 + \str_convert_input_hex_aux_ii:N + \str_convert_input_hex_aux:N + } +\cs_new_nopar:Npn \str_convert_input_hex_aux_ii:N #1 + { + \use_none:n #1 + \str_aux_hexadecimal_use:NTF #1 + { + \str_output_end: + \str_output_byte:w " \str_convert_input_hex_aux:N + } + \str_convert_input_hex_aux_ii:N + } +\cs_new_protected_nopar:Npn \str_convert_output_hex: + { \str_aux_gmap_result:N \str_convert_output_hex_aux:N } +\cs_new_nopar:Npn \str_convert_output_hex_aux:N #1 + { \str_output_hexadecimal:n { `#1 } } +%% +%% +%% End of file `l3str-hex.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88591.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88591.def new file mode 100644 index 00000000000..310226b18d1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88591.def @@ -0,0 +1,57 @@ +%% +%% This is file `l3str-iso88591.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88591') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88591 } +\tl_const:cn { c_str_encoding_iso88591_tl } + { + } +\tl_const:cn { c_str_encoding_iso88591_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso88591.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885910.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885910.def new file mode 100644 index 00000000000..68e6dc9463e --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885910.def @@ -0,0 +1,103 @@ +%% +%% This is file `l3str-iso885910.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885910') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885910 } +\tl_const:cn { c_str_encoding_iso885910_tl } + { + { A1 } { 0104 } + { A2 } { 0112 } + { A3 } { 0122 } + { A4 } { 012A } + { A5 } { 0128 } + { A6 } { 0136 } + { A8 } { 013B } + { A9 } { 0110 } + { AA } { 0160 } + { AB } { 0166 } + { AC } { 017D } + { AE } { 016A } + { AF } { 014A } + { B1 } { 0105 } + { B2 } { 0113 } + { B3 } { 0123 } + { B4 } { 012B } + { B5 } { 0129 } + { B6 } { 0137 } + { B8 } { 013C } + { B9 } { 0111 } + { BA } { 0161 } + { BB } { 0167 } + { BC } { 017E } + { BD } { 2015 } + { BE } { 016B } + { BF } { 014B } + { C0 } { 0100 } + { C7 } { 012E } + { C8 } { 010C } + { CA } { 0118 } + { CC } { 0116 } + { D1 } { 0145 } + { D2 } { 014C } + { D7 } { 0168 } + { D9 } { 0172 } + { E0 } { 0101 } + { E7 } { 012F } + { E8 } { 010D } + { EA } { 0119 } + { EC } { 0117 } + { F1 } { 0146 } + { F2 } { 014D } + { F7 } { 0169 } + { F9 } { 0173 } + { FF } { 0138 } + } +\tl_const:cn { c_str_encoding_iso885910_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso885910.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885911.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885911.def new file mode 100644 index 00000000000..b22795dea38 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885911.def @@ -0,0 +1,148 @@ +%% +%% This is file `l3str-iso885911.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885911') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885911 } +\tl_const:cn { c_str_encoding_iso885911_tl } + { + { A1 } { 0E01 } + { A2 } { 0E02 } + { A3 } { 0E03 } + { A4 } { 0E04 } + { A5 } { 0E05 } + { A6 } { 0E06 } + { A7 } { 0E07 } + { A8 } { 0E08 } + { A9 } { 0E09 } + { AA } { 0E0A } + { AB } { 0E0B } + { AC } { 0E0C } + { AD } { 0E0D } + { AE } { 0E0E } + { AF } { 0E0F } + { B0 } { 0E10 } + { B1 } { 0E11 } + { B2 } { 0E12 } + { B3 } { 0E13 } + { B4 } { 0E14 } + { B5 } { 0E15 } + { B6 } { 0E16 } + { B7 } { 0E17 } + { B8 } { 0E18 } + { B9 } { 0E19 } + { BA } { 0E1A } + { BB } { 0E1B } + { BC } { 0E1C } + { BD } { 0E1D } + { BE } { 0E1E } + { BF } { 0E1F } + { C0 } { 0E20 } + { C1 } { 0E21 } + { C2 } { 0E22 } + { C3 } { 0E23 } + { C4 } { 0E24 } + { C5 } { 0E25 } + { C6 } { 0E26 } + { C7 } { 0E27 } + { C8 } { 0E28 } + { C9 } { 0E29 } + { CA } { 0E2A } + { CB } { 0E2B } + { CC } { 0E2C } + { CD } { 0E2D } + { CE } { 0E2E } + { CF } { 0E2F } + { D0 } { 0E30 } + { D1 } { 0E31 } + { D2 } { 0E32 } + { D3 } { 0E33 } + { D4 } { 0E34 } + { D5 } { 0E35 } + { D6 } { 0E36 } + { D7 } { 0E37 } + { D8 } { 0E38 } + { D9 } { 0E39 } + { DA } { 0E3A } + { DF } { 0E3F } + { E0 } { 0E40 } + { E1 } { 0E41 } + { E2 } { 0E42 } + { E3 } { 0E43 } + { E4 } { 0E44 } + { E5 } { 0E45 } + { E6 } { 0E46 } + { E7 } { 0E47 } + { E8 } { 0E48 } + { E9 } { 0E49 } + { EA } { 0E4A } + { EB } { 0E4B } + { EC } { 0E4C } + { ED } { 0E4D } + { EE } { 0E4E } + { EF } { 0E4F } + { F0 } { 0E50 } + { F1 } { 0E51 } + { F2 } { 0E52 } + { F3 } { 0E53 } + { F4 } { 0E54 } + { F5 } { 0E55 } + { F6 } { 0E56 } + { F7 } { 0E57 } + { F8 } { 0E58 } + { F9 } { 0E59 } + { FA } { 0E5A } + { FB } { 0E5B } + } +\tl_const:cn { c_str_encoding_iso885911_missing_tl } + { + { DB } + { DC } + { DD } + { DE } + } +%% +%% +%% End of file `l3str-iso885911.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885913.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885913.def new file mode 100644 index 00000000000..a0904a29c84 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885913.def @@ -0,0 +1,113 @@ +%% +%% This is file `l3str-iso885913.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885913') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885913 } +\tl_const:cn { c_str_encoding_iso885913_tl } + { + { A1 } { 201D } + { A5 } { 201E } + { A8 } { 00D8 } + { AA } { 0156 } + { AF } { 00C6 } + { B4 } { 201C } + { B8 } { 00F8 } + { BA } { 0157 } + { BF } { 00E6 } + { C0 } { 0104 } + { C1 } { 012E } + { C2 } { 0100 } + { C3 } { 0106 } + { C6 } { 0118 } + { C7 } { 0112 } + { C8 } { 010C } + { CA } { 0179 } + { CB } { 0116 } + { CC } { 0122 } + { CD } { 0136 } + { CE } { 012A } + { CF } { 013B } + { D0 } { 0160 } + { D1 } { 0143 } + { D2 } { 0145 } + { D4 } { 014C } + { D8 } { 0172 } + { D9 } { 0141 } + { DA } { 015A } + { DB } { 016A } + { DD } { 017B } + { DE } { 017D } + { E0 } { 0105 } + { E1 } { 012F } + { E2 } { 0101 } + { E3 } { 0107 } + { E6 } { 0119 } + { E7 } { 0113 } + { E8 } { 010D } + { EA } { 017A } + { EB } { 0117 } + { EC } { 0123 } + { ED } { 0137 } + { EE } { 012B } + { EF } { 013C } + { F0 } { 0161 } + { F1 } { 0144 } + { F2 } { 0146 } + { F4 } { 014D } + { F8 } { 0173 } + { F9 } { 0142 } + { FA } { 015B } + { FB } { 016B } + { FD } { 017C } + { FE } { 017E } + { FF } { 2019 } + } +\tl_const:cn { c_str_encoding_iso885913_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso885913.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885914.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885914.def new file mode 100644 index 00000000000..9cbba28749a --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885914.def @@ -0,0 +1,88 @@ +%% +%% This is file `l3str-iso885914.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885914') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885914 } +\tl_const:cn { c_str_encoding_iso885914_tl } + { + { A1 } { 1E02 } + { A2 } { 1E03 } + { A4 } { 010A } + { A5 } { 010B } + { A6 } { 1E0A } + { A8 } { 1E80 } + { AA } { 1E82 } + { AB } { 1E0B } + { AC } { 1EF2 } + { AF } { 0178 } + { B0 } { 1E1E } + { B1 } { 1E1F } + { B2 } { 0120 } + { B3 } { 0121 } + { B4 } { 1E40 } + { B5 } { 1E41 } + { B7 } { 1E56 } + { B8 } { 1E81 } + { B9 } { 1E57 } + { BA } { 1E83 } + { BB } { 1E60 } + { BC } { 1EF3 } + { BD } { 1E84 } + { BE } { 1E85 } + { BF } { 1E61 } + { D0 } { 0174 } + { D7 } { 1E6A } + { DE } { 0176 } + { F0 } { 0175 } + { F7 } { 1E6B } + { FE } { 0177 } + } +\tl_const:cn { c_str_encoding_iso885914_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso885914.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885915.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885915.def new file mode 100644 index 00000000000..1501f0308c2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885915.def @@ -0,0 +1,65 @@ +%% +%% This is file `l3str-iso885915.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885915') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885915 } +\tl_const:cn { c_str_encoding_iso885915_tl } + { + { A4 } { 20AC } + { A6 } { 0160 } + { A8 } { 0161 } + { B4 } { 017D } + { B8 } { 017E } + { BC } { 0152 } + { BD } { 0153 } + { BE } { 0178 } + } +\tl_const:cn { c_str_encoding_iso885915_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso885915.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885916.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885916.def new file mode 100644 index 00000000000..84d3e86d0e5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso885916.def @@ -0,0 +1,97 @@ +%% +%% This is file `l3str-iso885916.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso885916') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso885916 } +\tl_const:cn { c_str_encoding_iso885916_tl } + { + { A1 } { 0104 } + { A2 } { 0105 } + { A3 } { 0141 } + { A4 } { 20AC } + { A5 } { 201E } + { A6 } { 0160 } + { A8 } { 0161 } + { AA } { 0218 } + { AC } { 0179 } + { AE } { 017A } + { AF } { 017B } + { B2 } { 010C } + { B3 } { 0142 } + { B4 } { 017D } + { B5 } { 201D } + { B8 } { 017E } + { B9 } { 010D } + { BA } { 0219 } + { BC } { 0152 } + { BD } { 0153 } + { BE } { 0178 } + { BF } { 017C } + { C3 } { 0102 } + { C5 } { 0106 } + { D0 } { 0110 } + { D1 } { 0143 } + { D5 } { 0150 } + { D7 } { 015A } + { D8 } { 0170 } + { DD } { 0118 } + { DE } { 021A } + { E3 } { 0103 } + { E5 } { 0107 } + { F0 } { 0111 } + { F1 } { 0144 } + { F5 } { 0151 } + { F7 } { 015B } + { F8 } { 0171 } + { FD } { 0119 } + { FE } { 021B } + } +\tl_const:cn { c_str_encoding_iso885916_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso885916.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88592.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88592.def new file mode 100644 index 00000000000..cf3fdb20f03 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88592.def @@ -0,0 +1,114 @@ +%% +%% This is file `l3str-iso88592.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88592') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88592 } +\tl_const:cn { c_str_encoding_iso88592_tl } + { + { A1 } { 0104 } + { A2 } { 02D8 } + { A3 } { 0141 } + { A5 } { 013D } + { A6 } { 015A } + { A9 } { 0160 } + { AA } { 015E } + { AB } { 0164 } + { AC } { 0179 } + { AE } { 017D } + { AF } { 017B } + { B1 } { 0105 } + { B2 } { 02DB } + { B3 } { 0142 } + { B5 } { 013E } + { B6 } { 015B } + { B7 } { 02C7 } + { B9 } { 0161 } + { BA } { 015F } + { BB } { 0165 } + { BC } { 017A } + { BD } { 02DD } + { BE } { 017E } + { BF } { 017C } + { C0 } { 0154 } + { C3 } { 0102 } + { C5 } { 0139 } + { C6 } { 0106 } + { C8 } { 010C } + { CA } { 0118 } + { CC } { 011A } + { CF } { 010E } + { D0 } { 0110 } + { D1 } { 0143 } + { D2 } { 0147 } + { D5 } { 0150 } + { D8 } { 0158 } + { D9 } { 016E } + { DB } { 0170 } + { DE } { 0162 } + { E0 } { 0155 } + { E3 } { 0103 } + { E5 } { 013A } + { E6 } { 0107 } + { E8 } { 010D } + { EA } { 0119 } + { EC } { 011B } + { EF } { 010F } + { F0 } { 0111 } + { F1 } { 0144 } + { F2 } { 0148 } + { F5 } { 0151 } + { F8 } { 0159 } + { F9 } { 016F } + { FB } { 0171 } + { FE } { 0163 } + { FF } { 02D9 } + } +\tl_const:cn { c_str_encoding_iso88592_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso88592.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88593.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88593.def new file mode 100644 index 00000000000..f9c9c5cf174 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88593.def @@ -0,0 +1,92 @@ +%% +%% This is file `l3str-iso88593.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88593') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88593 } +\tl_const:cn { c_str_encoding_iso88593_tl } + { + { A1 } { 0126 } + { A2 } { 02D8 } + { A6 } { 0124 } + { A9 } { 0130 } + { AA } { 015E } + { AB } { 011E } + { AC } { 0134 } + { AF } { 017B } + { B1 } { 0127 } + { B6 } { 0125 } + { B9 } { 0131 } + { BA } { 015F } + { BB } { 011F } + { BC } { 0135 } + { BF } { 017C } + { C5 } { 010A } + { C6 } { 0108 } + { D5 } { 0120 } + { D8 } { 011C } + { DD } { 016C } + { DE } { 015C } + { E5 } { 010B } + { E6 } { 0109 } + { F5 } { 0121 } + { F8 } { 011D } + { FD } { 016D } + { FE } { 015D } + { FF } { 02D9 } + } +\tl_const:cn { c_str_encoding_iso88593_missing_tl } + { + { A5 } + { AE } + { BE } + { C3 } + { D0 } + { E3 } + { F0 } + } +%% +%% +%% End of file `l3str-iso88593.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88594.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88594.def new file mode 100644 index 00000000000..77edd29fe07 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88594.def @@ -0,0 +1,107 @@ +%% +%% This is file `l3str-iso88594.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88594') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88594 } +\tl_const:cn { c_str_encoding_iso88594_tl } + { + { A1 } { 0104 } + { A2 } { 0138 } + { A3 } { 0156 } + { A5 } { 0128 } + { A6 } { 013B } + { A9 } { 0160 } + { AA } { 0112 } + { AB } { 0122 } + { AC } { 0166 } + { AE } { 017D } + { B1 } { 0105 } + { B2 } { 02DB } + { B3 } { 0157 } + { B5 } { 0129 } + { B6 } { 013C } + { B7 } { 02C7 } + { B9 } { 0161 } + { BA } { 0113 } + { BB } { 0123 } + { BC } { 0167 } + { BD } { 014A } + { BE } { 017E } + { BF } { 014B } + { C0 } { 0100 } + { C7 } { 012E } + { C8 } { 010C } + { CA } { 0118 } + { CC } { 0116 } + { CF } { 012A } + { D0 } { 0110 } + { D1 } { 0145 } + { D2 } { 014C } + { D3 } { 0136 } + { D9 } { 0172 } + { DD } { 0168 } + { DE } { 016A } + { E0 } { 0101 } + { E7 } { 012F } + { E8 } { 010D } + { EA } { 0119 } + { EC } { 0117 } + { EF } { 012B } + { F0 } { 0111 } + { F1 } { 0146 } + { F2 } { 014D } + { F3 } { 0137 } + { F9 } { 0173 } + { FD } { 0169 } + { FE } { 016B } + { FF } { 02D9 } + } +\tl_const:cn { c_str_encoding_iso88594_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso88594.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88595.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88595.def new file mode 100644 index 00000000000..a05b410dc1b --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88595.def @@ -0,0 +1,151 @@ +%% +%% This is file `l3str-iso88595.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88595') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88595 } +\tl_const:cn { c_str_encoding_iso88595_tl } + { + { A1 } { 0401 } + { A2 } { 0402 } + { A3 } { 0403 } + { A4 } { 0404 } + { A5 } { 0405 } + { A6 } { 0406 } + { A7 } { 0407 } + { A8 } { 0408 } + { A9 } { 0409 } + { AA } { 040A } + { AB } { 040B } + { AC } { 040C } + { AE } { 040E } + { AF } { 040F } + { B0 } { 0410 } + { B1 } { 0411 } + { B2 } { 0412 } + { B3 } { 0413 } + { B4 } { 0414 } + { B5 } { 0415 } + { B6 } { 0416 } + { B7 } { 0417 } + { B8 } { 0418 } + { B9 } { 0419 } + { BA } { 041A } + { BB } { 041B } + { BC } { 041C } + { BD } { 041D } + { BE } { 041E } + { BF } { 041F } + { C0 } { 0420 } + { C1 } { 0421 } + { C2 } { 0422 } + { C3 } { 0423 } + { C4 } { 0424 } + { C5 } { 0425 } + { C6 } { 0426 } + { C7 } { 0427 } + { C8 } { 0428 } + { C9 } { 0429 } + { CA } { 042A } + { CB } { 042B } + { CC } { 042C } + { CD } { 042D } + { CE } { 042E } + { CF } { 042F } + { D0 } { 0430 } + { D1 } { 0431 } + { D2 } { 0432 } + { D3 } { 0433 } + { D4 } { 0434 } + { D5 } { 0435 } + { D6 } { 0436 } + { D7 } { 0437 } + { D8 } { 0438 } + { D9 } { 0439 } + { DA } { 043A } + { DB } { 043B } + { DC } { 043C } + { DD } { 043D } + { DE } { 043E } + { DF } { 043F } + { E0 } { 0440 } + { E1 } { 0441 } + { E2 } { 0442 } + { E3 } { 0443 } + { E4 } { 0444 } + { E5 } { 0445 } + { E6 } { 0446 } + { E7 } { 0447 } + { E8 } { 0448 } + { E9 } { 0449 } + { EA } { 044A } + { EB } { 044B } + { EC } { 044C } + { ED } { 044D } + { EE } { 044E } + { EF } { 044F } + { F0 } { 2116 } + { F1 } { 0451 } + { F2 } { 0452 } + { F3 } { 0453 } + { F4 } { 0454 } + { F5 } { 0455 } + { F6 } { 0456 } + { F7 } { 0457 } + { F8 } { 0458 } + { F9 } { 0459 } + { FA } { 045A } + { FB } { 045B } + { FC } { 045C } + { FD } { 00A7 } + { FE } { 045E } + { FF } { 045F } + } +\tl_const:cn { c_str_encoding_iso88595_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso88595.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88596.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88596.def new file mode 100644 index 00000000000..1cf3ac63bb4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88596.def @@ -0,0 +1,137 @@ +%% +%% This is file `l3str-iso88596.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88596') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88596 } +\tl_const:cn { c_str_encoding_iso88596_tl } + { + { AC } { 060C } + { BB } { 061B } + { BF } { 061F } + { C1 } { 0621 } + { C2 } { 0622 } + { C3 } { 0623 } + { C4 } { 0624 } + { C5 } { 0625 } + { C6 } { 0626 } + { C7 } { 0627 } + { C8 } { 0628 } + { C9 } { 0629 } + { CA } { 062A } + { CB } { 062B } + { CC } { 062C } + { CD } { 062D } + { CE } { 062E } + { CF } { 062F } + { D0 } { 0630 } + { D1 } { 0631 } + { D2 } { 0632 } + { D3 } { 0633 } + { D4 } { 0634 } + { D5 } { 0635 } + { D6 } { 0636 } + { D7 } { 0637 } + { D8 } { 0638 } + { D9 } { 0639 } + { DA } { 063A } + { E0 } { 0640 } + { E1 } { 0641 } + { E2 } { 0642 } + { E3 } { 0643 } + { E4 } { 0644 } + { E5 } { 0645 } + { E6 } { 0646 } + { E7 } { 0647 } + { E8 } { 0648 } + { E9 } { 0649 } + { EA } { 064A } + { EB } { 064B } + { EC } { 064C } + { ED } { 064D } + { EE } { 064E } + { EF } { 064F } + { F0 } { 0650 } + { F1 } { 0651 } + { F2 } { 0652 } + } +\tl_const:cn { c_str_encoding_iso88596_missing_tl } + { + { A1 } + { A2 } + { A3 } + { A5 } + { A6 } + { A7 } + { A8 } + { A9 } + { AA } + { AB } + { AE } + { AF } + { B0 } + { B1 } + { B2 } + { B3 } + { B4 } + { B5 } + { B6 } + { B7 } + { B8 } + { B9 } + { BA } + { BC } + { BD } + { BE } + { C0 } + { DB } + { DC } + { DD } + { DE } + { DF } + } +%% +%% +%% End of file `l3str-iso88596.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88597.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88597.def new file mode 100644 index 00000000000..3b0b119a49d --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88597.def @@ -0,0 +1,136 @@ +%% +%% This is file `l3str-iso88597.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88597') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88597 } +\tl_const:cn { c_str_encoding_iso88597_tl } + { + { A1 } { 2018 } + { A2 } { 2019 } + { A4 } { 20AC } + { A5 } { 20AF } + { AA } { 037A } + { AF } { 2015 } + { B4 } { 0384 } + { B5 } { 0385 } + { B6 } { 0386 } + { B8 } { 0388 } + { B9 } { 0389 } + { BA } { 038A } + { BC } { 038C } + { BE } { 038E } + { BF } { 038F } + { C0 } { 0390 } + { C1 } { 0391 } + { C2 } { 0392 } + { C3 } { 0393 } + { C4 } { 0394 } + { C5 } { 0395 } + { C6 } { 0396 } + { C7 } { 0397 } + { C8 } { 0398 } + { C9 } { 0399 } + { CA } { 039A } + { CB } { 039B } + { CC } { 039C } + { CD } { 039D } + { CE } { 039E } + { CF } { 039F } + { D0 } { 03A0 } + { D1 } { 03A1 } + { D3 } { 03A3 } + { D4 } { 03A4 } + { D5 } { 03A5 } + { D6 } { 03A6 } + { D7 } { 03A7 } + { D8 } { 03A8 } + { D9 } { 03A9 } + { DA } { 03AA } + { DB } { 03AB } + { DC } { 03AC } + { DD } { 03AD } + { DE } { 03AE } + { DF } { 03AF } + { E0 } { 03B0 } + { E1 } { 03B1 } + { E2 } { 03B2 } + { E3 } { 03B3 } + { E4 } { 03B4 } + { E5 } { 03B5 } + { E6 } { 03B6 } + { E7 } { 03B7 } + { E8 } { 03B8 } + { E9 } { 03B9 } + { EA } { 03BA } + { EB } { 03BB } + { EC } { 03BC } + { ED } { 03BD } + { EE } { 03BE } + { EF } { 03BF } + { F0 } { 03C0 } + { F1 } { 03C1 } + { F2 } { 03C2 } + { F3 } { 03C3 } + { F4 } { 03C4 } + { F5 } { 03C5 } + { F6 } { 03C6 } + { F7 } { 03C7 } + { F8 } { 03C8 } + { F9 } { 03C9 } + { FA } { 03CA } + { FB } { 03CB } + { FC } { 03CC } + { FD } { 03CD } + { FE } { 03CE } + } +\tl_const:cn { c_str_encoding_iso88597_missing_tl } + { + { AE } + { D2 } + } +%% +%% +%% End of file `l3str-iso88597.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88598.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88598.def new file mode 100644 index 00000000000..400122b3c14 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88598.def @@ -0,0 +1,124 @@ +%% +%% This is file `l3str-iso88598.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88598') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88598 } +\tl_const:cn { c_str_encoding_iso88598_tl } + { + { AA } { 00D7 } + { BA } { 00F7 } + { DF } { 2017 } + { E0 } { 05D0 } + { E1 } { 05D1 } + { E2 } { 05D2 } + { E3 } { 05D3 } + { E4 } { 05D4 } + { E5 } { 05D5 } + { E6 } { 05D6 } + { E7 } { 05D7 } + { E8 } { 05D8 } + { E9 } { 05D9 } + { EA } { 05DA } + { EB } { 05DB } + { EC } { 05DC } + { ED } { 05DD } + { EE } { 05DE } + { EF } { 05DF } + { F0 } { 05E0 } + { F1 } { 05E1 } + { F2 } { 05E2 } + { F3 } { 05E3 } + { F4 } { 05E4 } + { F5 } { 05E5 } + { F6 } { 05E6 } + { F7 } { 05E7 } + { F8 } { 05E8 } + { F9 } { 05E9 } + { FA } { 05EA } + { FD } { 200E } + { FE } { 200F } + } +\tl_const:cn { c_str_encoding_iso88598_missing_tl } + { + { A1 } + { BF } + { C0 } + { C1 } + { C2 } + { C3 } + { C4 } + { C5 } + { C6 } + { C7 } + { C8 } + { C9 } + { CA } + { CB } + { CC } + { CD } + { CE } + { CF } + { D0 } + { D1 } + { D2 } + { D3 } + { D4 } + { D5 } + { D6 } + { D7 } + { D8 } + { D9 } + { DA } + { DB } + { DC } + { DD } + { DE } + { FB } + { FC } + } +%% +%% +%% End of file `l3str-iso88598.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88599.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88599.def new file mode 100644 index 00000000000..1d7effe7915 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-iso88599.def @@ -0,0 +1,63 @@ +%% +%% This is file `l3str-iso88599.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `iso88599') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\str_encoding_eight_bit:n { iso88599 } +\tl_const:cn { c_str_encoding_iso88599_tl } + { + { D0 } { 011E } + { DD } { 0130 } + { DE } { 015E } + { F0 } { 011F } + { FD } { 0131 } + { FE } { 015F } + } +\tl_const:cn { c_str_encoding_iso88599_missing_tl } + { + } +%% +%% +%% End of file `l3str-iso88599.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-name.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-name.def new file mode 100644 index 00000000000..8d378c87e3d --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-name.def @@ -0,0 +1,102 @@ +%% +%% This is file `l3str-name.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `name') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\cs_set_protected:Npn \str_tmp:w #1#2#3 + { + \cs_new_protected_nopar:Npn #2 + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN #3 \g_str_result_tl + #1 ? { ? \prg_map_break: } + \prg_break_point:n { } + } + } + \cs_new_nopar:Npn #3 ##1#1##2##3 + { + \str_filter_bytes:n {##1} + \use_none:n ##3 + \str_output_byte:w " + \str_aux_hexadecimal_use:NTF ##2 + { + \str_aux_hexadecimal_use:NTF ##3 + { } + { * \c_zero + `#1 \use_i:nn } + } + { 0 + `#1 \use_i:nn } + \str_output_end: + \use_i:nnn #3 ##2##3 + } + } +\exp_after:wN \str_tmp:w \c_hash_str + \str_convert_input_name: \str_convert_input_name_aux:wNN +\str_const:Nn \c_str_convert_output_name_not_str { ! " $ & ' } %$ +\str_const:Nn \c_str_convert_output_name_str { {}/<>[] } +\cs_new_protected_nopar:Npn \str_convert_output_name: + { \str_aux_gmap_result:N \str_convert_output_name_aux:N } +\cs_new_nopar:Npn \str_convert_output_name_aux:N #1 + { + \str_convert_output_name_aux:NTF #1 {#1} + { \c_hash_str \str_output_hexadecimal:n {`#1} } + } +\prg_new_conditional:Npnn \str_convert_output_name_aux:N #1 { TF } + { + \if_num:w `#1 < "2A \exp_stop_f: + \str_if_contains_char:NNTF \c_str_convert_output_name_not_str #1 + \prg_return_true: \prg_return_false: + \else: + \if_num:w `#1 > "7E \exp_stop_f: + \prg_return_false: + \else: + \str_if_contains_char:NNTF \c_str_convert_output_name_str #1 + \prg_return_false: \prg_return_true: + \fi: + \fi: + } +%% +%% +%% End of file `l3str-name.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-string.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-string.def new file mode 100644 index 00000000000..7718a0d1b25 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-string.def @@ -0,0 +1,153 @@ +%% +%% This is file `l3str-string.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `string') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\group_begin: + \char_set_lccode:nn {`\*} {`\\} + \char_set_catcode_other:N \^^J + \char_set_catcode_other:N \^^M + \tl_to_lowercase:n + { + \cs_new_protected_nopar:Npn \str_convert_input_string: + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_convert_input_string_aux:wN + \g_str_result_tl \prg_map_break: ^^M ? + \prg_break_point:n { } + } + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_convert_input_string_aux:wNNN + \g_str_result_tl * ?? { ? \prg_map_break: } + \prg_break_point:n { } + } + } + \cs_new_nopar:Npn \str_convert_input_string_aux:wNNN #1 *#2#3#4 + } + { + \str_filter_bytes:n {#1} + \use_none:n #4 + \str_output_byte:w ' + \str_aux_octal_use:NTF #2 + { + \str_aux_octal_use:NTF #3 + { + \str_aux_octal_use:NTF #4 + { + \if_int_compare:w #2 > \c_three + - 256 + \fi: + \str_convert_input_string_aux:NNNNNN + } + { \str_convert_input_string_aux:NNNNNN ? } + } + { \str_convert_input_string_aux:NNNNNN ?? } + } + { + \prg_case_str:xxn {#2} + { + { \c_backslash_str } { 134 } + { ( } { 50 } + { ) } { 51 } + { r } { 15 } + { f } { 14 } + { n } { 12 } + { t } { 11 } + { b } { 10 } + { ^^J } { 0 - \c_one } + } + { 0 - \c_one \use_i:nn } + } + \str_output_end: + \use_i:nn \str_convert_input_string_aux:wNNN #2#3#4 + } + \cs_new_nopar:Npn \str_convert_input_string_aux:NNNNNN #1#2#3#4#5#6 + { \str_output_end: \str_convert_input_string_aux:wNNN } + \cs_new_nopar:Npn \str_convert_input_string_aux:wN #1 ^^M #2 + { + #1 ^^J + \if_charcode:w ^^J #2 + \exp_after:wN \use_i:nn + \fi: + \str_convert_input_string_aux:wN #2 + } +\group_end: +\str_const:Nx \c_str_convert_output_string_str + { \c_backslash_str ( ) } +\cs_new_protected_nopar:Npn \str_convert_output_string: + { \str_aux_gmap_result:N \str_convert_output_string_aux:N } +\cs_new_nopar:Npn \str_convert_output_string_aux:N #1 + { + \str_convert_output_string_aux:NTF #1 + { + \str_if_contains_char:NNT + \c_str_convert_output_string_str #1 + { \c_backslash_str } + #1 + } + { + \c_backslash_str + \int_div_truncate:nn {`#1} {64} + \int_mod:nn { \int_div_truncate:nn {`#1} \c_eight } \c_eight + \int_mod:nn {`#1} \c_eight + } + } +\prg_new_conditional:Npnn \str_convert_output_string_aux:N #1 { TF } + { + \if_num:w `#1 < "21 \exp_stop_f: + \prg_return_false: + \else: + \if_num:w `#1 > "7E \exp_stop_f: + \prg_return_false: + \else: + \prg_return_true: + \fi: + \fi: + } +%% +%% +%% End of file `l3str-string.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-url.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-url.def new file mode 100644 index 00000000000..bf6bf96514d --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-url.def @@ -0,0 +1,100 @@ +%% +%% This is file `l3str-url.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `url') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\cs_set_protected:Npn \str_tmp:w #1#2#3 + { + \cs_new_protected_nopar:Npn #2 + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN #3 \g_str_result_tl + #1 ? { ? \prg_map_break: } + \prg_break_point:n { } + } + } + \cs_new_nopar:Npn #3 ##1#1##2##3 + { + \str_filter_bytes:n {##1} + \use_none:n ##3 + \str_output_byte:w " + \str_aux_hexadecimal_use:NTF ##2 + { + \str_aux_hexadecimal_use:NTF ##3 + { } + { * \c_zero + `#1 \use_i:nn } + } + { 0 + `#1 \use_i:nn } + \str_output_end: + \use_i:nnn #3 ##2##3 + } + } +\exp_after:wN \str_tmp:w \c_percent_str + \str_convert_input_url: \str_convert_input_url_aux:wNN +\cs_new_protected_nopar:Npn \str_convert_output_url: + { \str_aux_gmap_result:N \str_convert_output_url_aux:N } +\cs_new_nopar:Npn \str_convert_output_url_aux:N #1 + { + \str_convert_output_url_aux:NTF #1 {#1} + { \c_percent_str \str_output_hexadecimal:n { `#1 } } + } +\prg_new_conditional:Npnn \str_convert_output_url_aux:N #1 { TF } + { + \if_num:w `#1 < "41 \exp_stop_f: + \str_if_contains_char:nNTF { "-.<> } #1 + \prg_return_true: \prg_return_false: + \else: + \if_num:w `#1 > "7E \exp_stop_f: + \prg_return_false: + \else: + \str_if_contains_char:nNTF { [ ] } #1 + \prg_return_false: \prg_return_true: + \fi: + \fi: + } +%% +%% +%% End of file `l3str-url.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf16.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf16.def new file mode 100644 index 00000000000..e2bea7ca224 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf16.def @@ -0,0 +1,186 @@ +%% +%% This is file `l3str-utf16.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `utf16') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\group_begin: + \char_set_catcode_other:N \^^fe + \char_set_catcode_other:N \^^ff + \cs_new_protected_nopar:cpx { str_convert_to_utf16: } + { + \exp_not:c { str_convert_to_utf16be: } + \exp_not:n { \tl_gput_left:Nx \g_str_result_tl { ^^fe ^^ff } } + } + \cs_new_protected_nopar:cpn { str_convert_to_utf16be: } + { + \cs_set_eq:NN \str_tmp:w \str_aux_to_utf_xvi_be:n + \str_aux_gmap_internal_result:N \str_aux_to_utf_xvi:n + } + \cs_new_protected_nopar:cpn { str_convert_to_utf16le: } + { + \cs_set_eq:NN \str_tmp:w \str_aux_to_utf_xvi_le:n + \str_aux_gmap_internal_result:N \str_aux_to_utf_xvi:n + } + \cs_new_nopar:Npn \str_aux_to_utf_xvi:n #1 + { + \if_int_compare:w #1 < "D800 \exp_stop_f: + \str_tmp:w {#1} + \else: + \if_int_compare:w #1 < "10000 \exp_stop_f: + \if_int_compare:w #1 < "E000 \exp_stop_f: + \msg_expandable_kernel_error:nnn + { str } { unicode-surrogate } {#1} + \str_tmp:w { \c_str_replacement_char_int } + \else: + \str_tmp:w {#1} + \fi: + \else: + \exp_args:Nf \str_tmp:w { \int_div_truncate:nn {#1} {"400} + "D800 } + \exp_args:Nf \str_tmp:w { \int_mod:nn {#1} {"400} + "DC00 } + \fi: + \fi: + } + \cs_new_nopar:Npn \str_aux_to_utf_xvi_be:n #1 + { + \str_output_byte:n { \int_div_truncate:nn {#1} {"100} } + \str_output_byte:n { \int_mod:nn {#1} {"100} } + } + \cs_new_nopar:Npn \str_aux_to_utf_xvi_le:n #1 + { + \str_output_byte:n { \int_mod:nn {#1} {"100} } + \str_output_byte:n { \int_div_truncate:nn {#1} {"100} } + } + \cs_new_protected_nopar:cpn { str_convert_from_utf16be: } + { \str_aux_from_utf_xvi:No 1 { \g_str_result_tl } } + \cs_new_protected_nopar:cpn { str_convert_from_utf16le: } + { \str_aux_from_utf_xvi:No 2 { \g_str_result_tl } } + \cs_new_protected_nopar:cpn { str_convert_from_utf16: } + { + \exp_after:wN \str_aux_from_utf_xvi_bom:NNw + \g_str_result_tl \scan_stop: \scan_stop: \scan_stop: + } + \cs_new_protected_nopar:Npn + \str_aux_from_utf_xvi_bom:NNw #1#2#3\scan_stop: + { + \str_if_eq:nnTF { #1#2 } { ^^ff ^^fe } + { \str_aux_from_utf_xvi:No 2 {#3} } + { + \str_if_eq:nnTF { #1#2 } { ^^fe ^^ff } + { \str_aux_from_utf_xvi:No 1 {#3} } + { \str_aux_from_utf_xvi:No 1 {#1#2#3} } + } + } + \cs_new_protected_nopar:Npn \str_aux_from_utf_xvi:No #1#2 + { + \cs_set_nopar:Npn \str_tmp:w ##1 ##2 { ` ## #1 } + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_aux_from_utf_xvi:NN + #2 \scan_stop: \scan_stop: + \prg_break_point:n { } + } + } + \cs_new:Npn \str_aux_from_utf_xvi:NN #1#2 + { + \if_meaning:w \scan_stop: #2 + \str_aux_from_utf_xvi_end:Nw #1 + \fi: + \int_use:N \int_eval:w + \if_case:w + \int_eval:w ( \str_tmp:w #1#2 - "D6 ) / \c_four \int_eval_end: + \or: \exp_after:wN \str_aux_from_utf_xvi:wNNN + \or: \exp_after:wN \str_aux_from_utf_xvi_error:wNNw + \fi: + "100 * \str_tmp:w #1#2 + \str_tmp:w #2#1 , + \str_aux_from_utf_xvi:NN + } + \cs_new:Npn \str_aux_from_utf_xvi:wNNN #1, #2#3#4 + { + \if_meaning:w \scan_stop: #4 + \str_aux_from_utf_xvi_end:wNNww #1 , #3 + \fi: + \if_num:w \int_eval:w ( \str_tmp:w #3#4 - "DA ) / \c_four = \c_one + ( #1 - "D800 ) * "400 + + \str_tmp:w #3#4 * "100 + \str_tmp:w #4#3 - "DC00 , + \exp_after:wN \use_i:nnn + \else: + \str_aux_from_utf_xvi_error:wNNw #1 , + \fi: + #2#3#4 + } + \cs_new:Npn \str_aux_from_utf_xvi_error:wNNw #1 \str_tmp:w #2#3 #4, + { + \msg_expandable_kernel_error:nnn + { str } { utf16-surrogate } { #2#3 } + \c_str_replacement_char_int , + } + \cs_new:Npn \str_aux_from_utf_xvi_end:Nw #1 \fi: + { + \fi: + \if_meaning:w \scan_stop: #1 + \else: + \msg_expandable_kernel_error:nnn + { str } { utf16-odd } {#1} + \c_str_replacement_char_int , + \fi: + \prg_map_break: + } + \cs_new:Npn \str_aux_from_utf_xvi_end:wNNww #1 `#2#3 #4, #5 \fi: + { + \fi: + \if_meaning:w \scan_stop: #5 + \msg_expandable_kernel_error:nnn + { str } { utf16-surrogate } { #2#3 } + \else: + \msg_expandable_kernel_error:nnn + { str } { utf16-odd } { #2#3#5 } + \fi: + \c_str_replacement_char_int , + \prg_map_break: + } +\group_end: +%% +%% +%% End of file `l3str-utf16.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf32.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf32.def new file mode 100644 index 00000000000..7c56d2e3929 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf32.def @@ -0,0 +1,141 @@ +%% +%% This is file `l3str-utf32.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `utf32') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\group_begin: + \char_set_catcode_other:N \^^00 + \char_set_catcode_other:N \^^fe + \char_set_catcode_other:N \^^ff + \cs_new_protected_nopar:cpx { str_convert_to_utf32: } + { + \exp_not:c { str_convert_to_utf32be: } + \exp_not:n { \tl_gput_left:Nx \g_str_result_tl { ^^00 ^^00 ^^fe ^^ff } } + } + \cs_new_protected_nopar:cpn { str_convert_to_utf32be: } + { \str_aux_gmap_internal_result:N \str_aux_to_utf_xxxii_be:n } + \cs_new_protected_nopar:cpn { str_convert_to_utf32le: } + { \str_aux_gmap_internal_result:N \str_aux_to_utf_xxxii_le:n } + \cs_new:Npn \str_aux_to_utf_xxxii_be:n #1 + { + ^^00 + \str_output_byte:n { \int_div_truncate:nn {#1} { "10000 } } + \str_output_byte:n + { \int_mod:nn { \int_div_truncate:nn {#1} {"100} } {"100} } + \str_output_byte:n { \int_mod:nn {#1} {"100} } + } + \cs_new:Npn \str_aux_to_utf_xxxii_le:n #1 + { + \str_output_byte:n { \int_mod:nn {#1} {"100} } + \str_output_byte:n + { \int_mod:nn { \int_div_truncate:nn {#1} {"100} } {"100} } + \str_output_byte:n { \int_div_truncate:nn {#1} { "10000 } } + ^^00 + } + \cs_new_protected_nopar:cpn { str_convert_from_utf32be: } + { \str_aux_from_utf_xxxii:No 1 { \g_str_result_tl } } + \cs_new_protected_nopar:cpn { str_convert_from_utf32le: } + { \str_aux_from_utf_xxxii:No 2 { \g_str_result_tl } } + \cs_new_protected_nopar:cpn { str_convert_from_utf32: } + { + \exp_after:wN \str_aux_from_utf_xxxii_bom:NNNNw \g_str_result_tl + \scan_stop: \scan_stop: \scan_stop: \scan_stop: \scan_stop: + } + \cs_new_protected_nopar:Npn + \str_aux_from_utf_xxxii_bom:NNNNw #1#2#3#4#5\scan_stop: + { + \str_if_eq:nnTF { #1#2#3#4 } { ^^ff ^^fe ^^00 ^^00 } + { \str_aux_from_utf_xxxii:No 2 {#5} } + { + \str_if_eq:nnTF { #1#2#3#4 } { ^^00 ^^00 ^^fe ^^ff } + { \str_aux_from_utf_xxxii:No 1 {#5} } + { \str_aux_from_utf_xxxii:No 1 {#1#2#3#4#5} } + } + } + \cs_new_protected_nopar:Npn \str_aux_from_utf_xxxii:No #1#2 + { + \cs_set_nopar:Npn \str_tmp:w ##1 ##2 { ` ## #1 } + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_aux_from_utf_xxxii:NNNN + #2 \scan_stop: \scan_stop: \scan_stop: \scan_stop: + \prg_break_point:n { } + } + } + \cs_new:Npn \str_aux_from_utf_xxxii:NNNN #1#2#3#4 + { + \if_meaning:w \scan_stop: #4 + \str_aux_from_utf_xxxii_end:ww #1#2#3#4 + \fi: + \int_use:N \int_eval:w + \if_num:w \int_eval:w + \str_tmp:w #1#4 * \c_two_hundred_fifty_six + + \str_tmp:w #2#3 + > \c_sixteen + \msg_expandable_kernel_error:nnn + { str } { utf32-overflow } { #1#2#3#4 } + \c_str_replacement_char_int + \else: + \str_tmp:w #2#3*"10000 + + \str_tmp:w #3#2 * \c_two_hundred_fifty_six + + \str_tmp:w #4#1 + \fi: + , + \str_aux_from_utf_xxxii:NNNN + } + \cs_new:Npn \str_aux_from_utf_xxxii_end:ww #1 \scan_stop: #2 \fi: + { + \fi: + \tl_if_empty:nF {#1} + { + \msg_expandable_kernel_error:nnn + { str } { utf32-truncated } { #1 } + } + \prg_map_break: + } +\group_end: +%% +%% +%% End of file `l3str-utf32.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf8.def b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf8.def new file mode 100644 index 00000000000..9e0f26c2346 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str-utf8.def @@ -0,0 +1,159 @@ +%% +%% This is file `l3str-utf8.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3str.dtx (with options: `utf8') +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% File: l3str.dtx Copyright (C) 2011 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 +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX3 Project. +%% +%% ----------------------------------------------------------------------- +\cs_new_protected_nopar:cpn { str_convert_to_utf8: } + { \str_aux_gmap_internal_result:N \str_aux_to_utf_viii:n } +\cs_new:Npn \str_aux_to_utf_viii:n #1 + { + \str_aux_to_utf_viii:nnnnw + {#1} { \c_minus_one + \c_zero * \use_none:n } + { 128 } { \c_zero } + { 32 } { 192 } + { 16 } { 224 } + { 8 } { 240 } + \q_stop + } +\cs_new_nopar:Npn \str_aux_to_utf_viii:nnnnw #1#2#3#4 #5 \q_stop + { + \if_num:w #1 < #3 \exp_stop_f: + \str_output_byte:n { #1 + #4 } + \else: + \exp_args:Nf \str_aux_to_utf_viii:nnnnw + { \int_div_truncate:nn {#1} {64} } + {#1} + #5 \q_stop + \fi: + \str_output_byte:n { #2 - 64 * ( #1 - \c_two ) } + } +\cs_new_protected_nopar:cpn { str_convert_from_utf8: } + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_aux_from_utf_viii:N \g_str_result_tl + { ? \prg_map_break: \q_stop \str_aux_from_utf_viii_error: } + \prg_break_point:n { } + } + } +\cs_new_nopar:Npn \str_aux_from_utf_viii:N #1 + { + \use_none:n #1 + \int_use:N \int_eval:w + \if_num:w `#1 < "C0 \exp_stop_f: + \if_num:w `#1 < "80 \exp_stop_f: + `#1 + \else: + \msg_expandable_kernel_error:nnn + { str } { utf8-extra-conti } {#1} + \c_str_replacement_char_int + \fi: + \else: + \if_num:w `#1 < "F5 \exp_stop_f: + \exp_after:wN \str_aux_from_utf_viii:wwNN + \int_use:N \int_eval:w `#1 - "C0 + \else: + \msg_expandable_kernel_error:nnn + { str } { utf8-invalid-byte } {#1} + \c_str_replacement_char_int + \fi: + \fi: + , + \use_none_delimit_by_q_stop:w + "80 , "800 , "10000 , "10FFFF , + \q_stop + \str_aux_from_utf_viii:N + } +\cs_new_nopar:Npn \str_aux_from_utf_viii:wwNN #1 , #2 \q_stop #3#4 + { + \use_none_delimit_by_q_stop:w #4 \q_stop + \exp_after:wN \str_aux_from_utf_viii:wNNww + \int_use:N \int_eval:w #1 * "40 + `#4 - "80 , + #4 + #2 + \q_stop #3 + } +\cs_new_nopar:Npn \str_aux_from_utf_viii:wNNww #1, #2 #3#4, #5, + { + \if_num:w \int_eval:w ( `#2 + \c_thirty_two ) / "40 = \c_three + \if_num:w #1 < #4 \exp_stop_f: + \str_aux_from_utf_viii_error:w #1 , + \else: + \if_num:w #1 < #5 \exp_stop_f: + #1 + \else: + \exp_after:wN \str_aux_from_utf_viii:wwNN + \int_use:N \int_eval:w #1 - #5 + \fi: + \fi: + \else: + \exp_after:wN \str_aux_from_utf_viii_error:NwN + \exp_after:wN #2 + \fi: + , #3#5, + } +\cs_new_nopar:Npn \str_aux_from_utf_viii_error:w #1 , + { + \msg_expandable_kernel_error:nnn + { str } { utf8-overlong } {#1} + \c_str_replacement_char_int + } +\cs_new_nopar:Npn \str_aux_from_utf_viii_error:NwN #1 #2 \q_stop #3 + { + \msg_expandable_kernel_error:nnn + { str } { utf8-missing-conti } {#1} + \c_str_replacement_char_int , + #3#1 + } +\cs_new_nopar:Npn \str_aux_from_utf_viii_error: + { + \msg_expandable_kernel_error:nn + { str } { utf8-premature-end } + \c_str_replacement_char_int , + \prg_map_break: + } +%% +%% +%% End of file `l3str-utf8.def'. diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty index c705f6366b3..c49601841e0 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty @@ -46,12 +46,23 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{expl3} -\GetIdInfo$Id: l3str.dtx 2921 2011-10-17 13:23:36Z bruno $ +\GetIdInfo$Id: l3str.dtx 3035 2011-12-07 11:48:46Z bruno $ {L3 Experimental Strings} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \cs_if_exist:NF \use_i:nnnnnnnn { \cs_new:Npn \use_i:nnnnnnnn #1#2#3#4#5#6#7#8 {#1} } +\int_const:Nn \c_forty_eight { 48 } +\int_const:Nn \c_fifty_eight { 58 } +\int_const:Nn \c_sixty_five { 65 } +\int_const:Nn \c_ninety_one { 91 } +\int_const:Nn \c_ninety_seven { 97 } +\int_const:Nn \c_one_hundred_twenty_three { 123 } +\int_const:Nn \c_one_hundred_twenty_seven { 127 } +\pdftex_if_engine:TF + { \int_const:Nn \c_max_char_int { 255 } } + { \int_const:Nn \c_max_char_int { 1114111 } } +\int_const:Nn \c_str_replacement_char_int { "FFFD } \group_begin: \cs_set_protected_nopar:Npn \str_tmp:w #1 { @@ -61,21 +72,35 @@ } \str_tmp:w { set } \str_tmp:w { gset } + \str_tmp:w { const } \str_tmp:w { put_left } \str_tmp:w { gput_left } \str_tmp:w { put_right } \str_tmp:w { gput_right } \group_end: \cs_new_protected_nopar:Npn \str_tmp:w { } -\tl_new:N \g_str_tmpa_tl +\tl_new:N \l_str_tmpa_tl \tl_new:N \g_str_result_tl \int_new:N \l_str_char_int -\int_new:N \l_str_bytes_int \tl_const:Nx \c_backslash_str { \cs_to_str:N \\ } \tl_const:Nx \c_lbrace_str { \cs_to_str:N \{ } \tl_const:Nx \c_rbrace_str { \cs_to_str:N \} } \tl_const:Nx \c_hash_str { \cs_to_str:N \# } +\tl_const:Nx \c_tilde_str { \cs_to_str:N \~ } \tl_const:Nx \c_percent_str { \cs_to_str:N \% } +\prop_new:N \g_str_aliases_prop +\prop_gput:Nnn \g_str_aliases_prop { latin1 } { iso88591 } +\prop_gput:Nnn \g_str_aliases_prop { latin2 } { iso88592 } +\prop_gput:Nnn \g_str_aliases_prop { latin3 } { iso88593 } +\prop_gput:Nnn \g_str_aliases_prop { latin4 } { iso88594 } +\prop_gput:Nnn \g_str_aliases_prop { latin5 } { iso88599 } +\prop_gput:Nnn \g_str_aliases_prop { latin6 } { iso885910 } +\prop_gput:Nnn \g_str_aliases_prop { latin7 } { iso885913 } +\prop_gput:Nnn \g_str_aliases_prop { latin8 } { iso885914 } +\prop_gput:Nnn \g_str_aliases_prop { latin9 } { iso885915 } +\prop_gput:Nnn \g_str_aliases_prop { latin10 } { iso885916 } +\prop_gput:Nnn \g_str_aliases_prop { hexadecimal } { hex } +\prop_gput:Nnn \g_str_aliases_prop { percent } { url } \group_begin: \char_set_lccode:nn { `\* } { `\ } \char_set_lccode:nn { `\A } { `\A } @@ -108,6 +133,61 @@ { \tl_to_other_str:n {#2} } { \tl_to_other_str:n {#3} } } +\group_begin: +\char_set_lccode:nn { `\* } { `\ } +\char_set_lccode:nn { `\A } { `\A } +\tl_to_lowercase:n + { + \group_end: + \cs_new_protected:Npn \str_aux_gset_other:Nn #1#2 + { + \tl_gset:Nx #1 + { + \exp_after:wN \str_aux_gset_other_loop:w \tl_to_str:n {#2} ~ % + A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_mark \q_stop + } + } + \cs_new_nopar:Npn \str_aux_gset_other_loop:w + #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 ~ + { + \if_meaning:w A #9 + \str_aux_gset_other_end:w + \fi: + #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * #9 + \str_aux_gset_other_loop:w * + } + \cs_new_nopar:Npn \str_aux_gset_other_end:w \fi: #1 * A #2 \q_stop + { \fi: #1 } + } +\cs_new_nopar:Npn \str_map_tokens:Nn + { \exp_args:No \str_map_tokens:nn } +\cs_new:Npn \str_map_tokens:nn #1 + { \exp_args:No \str_map_tokens_aux:nn { \tl_to_str:n {#1} } } +\cs_new:Npn \str_map_tokens_aux:nn #1#2 + { + \str_map_tokens_loop:nw {#2} #1 + { ? \use_none_delimit_by_q_recursion_stop:w } + ?~ ?~ ?~ ?~ ?~ ?~ ?~ ?~ \q_recursion_stop + } +\group_begin: + \char_set_lccode:nn { `* } { `\ } + \tl_to_lowercase:n + { + \group_end: + \cs_new:Npn \str_map_tokens_loop:nw #1 #2~ #3~ #4~ #5~ #6~ #7~ #8~ #9~ + { + \str_map_tokens_loop:nN {#1} #2* #3* #4* #5* #6* #7* #8* #9* + { ? \use_none_delimit_by_q_stop:w } \q_stop + \str_map_tokens_loop:nw {#1} + } + } +\cs_new:Npn \str_map_tokens_loop:nN #1#2 + { + \use_none:n #2 + #1 #2 + \str_map_tokens_loop:nN {#1} + } +\cs_new_eq:NN \str_map_break_do:n \use_i_delimit_by_q_recursion_stop:nw \cs_new_nopar:Npn \str_length:N { \exp_args:No \str_length:n } \cs_new:Npn \str_length:n { \str_sanitize_args:Nn \str_length_unsafe:n } \cs_new_nopar:Npn \str_length_unsafe:n #1 @@ -318,22 +398,6 @@ \fi: } } -\cs_new_nopar:Npn \str_map_tokens:Nn - { \exp_args:No \str_map_tokens:nn } -\cs_new_nopar:Npn \str_map_tokens:nn - { \str_sanitize_args:Nn \str_map_tokens_aux:nn } -\cs_new:Npn \str_map_tokens_aux:nn #1#2 - { - \str_map_tokens_loop:nN {#2} #1 - { ? \use_none_delimit_by_q_recursion_stop:w } \q_recursion_stop - } -\cs_new_nopar:Npn \str_map_tokens_loop:nN #1#2 - { - \use_none:n #2 - #1 #2 - \str_map_tokens_loop:nN {#1} - } -\cs_new_eq:NN \str_map_break_do:n \use_i_delimit_by_q_recursion_stop:nw \prg_new_conditional:Npnn \str_if_eq:NN #1#2 { p , TF , T , F } { \if_int_compare:w \pdftex_strcmp:D { \tl_to_str:N #1 } { \tl_to_str:N #2 } @@ -357,18 +421,29 @@ } \cs_new_nopar:Npn \str_if_contains_char_end:w \fi: #1 \prg_return_false: { \fi: \prg_return_true: } -\prg_new_conditional:Npnn \str_if_bytes:N #1 { p , T , F , TF } +\pdftex_if_engine:TF { - \str_map_tokens:Nn #1 { \str_if_bytes_aux:N } - \prg_return_true: + \cs_new_eq:NN \str_if_bytes_p:N \c_true_bool + \cs_new_eq:NN \str_if_bytes:NT \use_ii:nn + \cs_new_eq:NN \str_if_bytes:NF \use_none:nn + \cs_new_eq:NN \str_if_bytes:NTF \use_ii:nnn } -\cs_new_nopar:Npn \str_if_bytes_aux:N #1 { - \int_compare:nNnF {`#1} < \c_two_hundred_fifty_six + \prg_new_conditional:Npnn \str_if_bytes:N #1 { p , T , F , TF } { - \use_i_delimit_by_q_recursion_stop:nw - { \prg_return_false: \use_none:n } + \exp_args:Nf \tl_map_function:nN + { \tl_to_str:N #1 } + \str_if_bytes_aux:N + \prg_return_true: + } + \cs_new_nopar:Npn \str_if_bytes_aux:N #1 + { + \if_num:w `#1 > \c_two_hundred_fifty_five + \exp_after:wN \str_if_bytes_aux: + \fi: } + \cs_new_nopar:Npn \str_if_bytes_aux: + { \tl_map_break:n { \prg_return_false: \use_none:n } } } \prg_new_protected_conditional:Npnn \str_aux_hexadecimal_test:N #1 { TF } { @@ -388,18 +463,100 @@ \fi: } } -\prg_new_protected_conditional:Npnn \str_aux_octal_test:N #1 { TF } +\prg_new_conditional:Npnn \str_aux_octal_use:N #1 { TF } { - \if_num:w \c_seven < '1 \exp_not:N #1 \exp_stop_f: - \int_set:Nn \l_str_char_int - { \c_eight * \l_str_char_int + '#1 } - \prg_return_true: + \if_num:w \c_one < '1 #1 \exp_stop_f: + #1 \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new_protected_nopar:Npn \str_aux_char_if_octal_digit:NTF #1 - { \tl_if_in:nnTF { 01234567 } {#1} } +\prg_new_conditional:Npnn \str_aux_hexadecimal_use:N #1 { TF } + { + \if_num:w \c_two < "1 #1 \exp_stop_f: + #1 \prg_return_true: + \else: + \if_case:w \int_eval:w `#1 - `a \int_eval_end: + A \prg_return_true: + \or: B \prg_return_true: + \or: C \prg_return_true: + \or: D \prg_return_true: + \or: E \prg_return_true: + \or: F \prg_return_true: + \else: \prg_return_false: + \fi: + \fi: + } +\group_begin: + \char_set_catcode_other:n { \c_zero } + \tl_gset:Nx \g_str_result_tl { \tl_to_str:n { 0123456789ABCDEF } } + \tl_map_inline:Nn \g_str_result_tl + { \char_set_lccode:nn {`#1} {`#1} } + \tl_map_inline:Nn \g_str_result_tl + { + \tl_map_inline:Nn \g_str_result_tl + { + \char_set_lccode:nn { \c_zero } {"##1#1} + \tl_to_lowercase:n + { + \tl_const:cx + { c_str_byte_ \int_eval:n {"##1#1} _tl } + { ^^@ ##1 #1 } + } + } + } +\group_end: +\tl_const:cn { c_str_byte_-1_tl } { { } \use_none:n { } } +\cs_new:Npn \str_output_byte:n #1 + { \str_output_byte:w #1 \str_output_end: } +\cs_new_nopar:Npn \str_output_byte:w + { + \exp_after:wN \exp_after:wN + \exp_after:wN \use_i:nnn + \cs:w c_str_byte_ \int_use:N \int_eval:w + } +\cs_new:Npn \str_output_hexadecimal:n #1 + { \str_output_hexadecimal:w #1 \str_output_end: } +\cs_new_nopar:Npn \str_output_hexadecimal:w + { + \exp_after:wN \exp_after:wN + \exp_after:wN \use_none:n + \cs:w c_str_byte_ \int_use:N \int_eval:w + } +\cs_new_nopar:Npn \str_output_end: + { \int_eval_end: _tl \cs_end: } +\cs_new_protected_nopar:Npn \str_aux_gmap_result:N #1 + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_aux_gmap_result_loop:NN + \exp_after:wN #1 + \g_str_result_tl { ? \prg_map_break: } + \prg_break_point:n { } + } + } +\cs_new_nopar:Npn \str_aux_gmap_result_loop:NN #1#2 + { + \use_none:n #2 + #1#2 + \str_aux_gmap_result_loop:NN #1 + } +\cs_new_protected_nopar:Npn \str_aux_gmap_internal_result:N #1 + { + \tl_gset:Nx \g_str_result_tl + { + \exp_after:wN \str_aux_gmap_internal_result_loop:Nw + \exp_after:wN #1 + \g_str_result_tl \q_stop \prg_map_break: , + \prg_break_point:n { } + } + } +\cs_new_nopar:Npn \str_aux_gmap_internal_result_loop:Nw #1#2, + { + \use_none_delimit_by_q_stop:w #2 \q_stop + #1 {#2} + \str_aux_gmap_internal_result_loop:Nw #1 + } \cs_new_protected:Npn \str_input:Nn #1#2 { \str_aux_escape:NNNn \token_to_str:N \token_to_str:N \token_to_str:N {#2} @@ -420,7 +577,7 @@ \cs_set_nopar:Npn \str_aux_escape_escaped:N { #2 } \cs_set_nopar:Npn \str_aux_escape_raw:N { #3 } \int_set:Nn \tex_escapechar:D { 92 } - \tl_gset:Nx \g_str_result_tl { \tl_to_other_str:n {#4} } + \str_aux_gset_other:Nn \g_str_result_tl {#4} \tl_gset:Nx \g_str_result_tl { \exp_after:wN \str_aux_escape_loop:N \g_str_result_tl @@ -507,7 +664,7 @@ \exp_not:N \token_if_eq_charcode:NNTF \c_rbrace_str #1 { \exp_not:N \str_aux_escape_x_end: } { - \msg_error:nn { str } { x-missing-brace } + \msg_kernel_error:nn { str } { x-missing-brace } \exp_not:N \str_aux_escape_x_end: #1 } } @@ -515,11 +672,9 @@ \char_set_catcode_other:N \^^@ \cs_new_protected_nopar:Npn \str_aux_escape_x_end: { - \group_begin: - \char_set_lccode:nn { \c_zero } { \l_str_char_int } + \tex_lccode:D \c_zero \l_str_char_int \tl_to_lowercase:n { - \group_end: \tl_gput_right:Nx \g_str_result_tl { \if_false: } \fi: \str_aux_escape_raw:N ^^@ @@ -527,440 +682,354 @@ } } \group_end: -\group_begin: - \char_set_catcode_other:n { `\^^@ } - \cs_new_protected_nopar:Npn \str_aux_convert_store: - { - \char_set_lccode:nn { \c_zero } { \l_str_char_int } - \tl_to_lowercase:n { \tl_gput_right:Nx \g_str_result_tl {^^@} } - } - \cs_new_protected_nopar:Npn \str_aux_convert_store:NNn #1#2#3 - { - \char_set_lccode:nn { \c_zero } {#3} - \tl_to_lowercase:n { #1 #2 {^^@} } - } -\group_end: -\cs_new_nopar:Npn \str_aux_byte_to_hexadecimal:N #1 +\cs_new_protected:Npn \str_set_convert:Nnnn + { \str_convert_aux_i:NNnnn \str_set:Nx } +\cs_new_protected:Npn \str_gset_convert:Nnnn + { \str_convert_aux_i:NNnnn \str_gset:Nx } +\cs_new_protected:Npn \str_convert_aux_i:NNnnn #1#2#3#4#5 + { + \group_begin: + \str_aux_gset_other:Nn \g_str_result_tl {#5} + + \exp_after:wN \str_convert_aux_ii:wwwnn + \tl_to_str:n {#3} /// \q_stop + { from } { input } \str_convert_from_native: \use_i:nn + + \exp_after:wN \str_convert_aux_ii:wwwnn + \tl_to_str:n {#4} /// \q_stop + { to } { output } \str_convert_to_native: \use_ii:nn + + \group_end: + #1 #2 \g_str_result_tl + } +\cs_new_protected:Npn \str_convert_aux_ii:wwwnn #1 / #2 // #3 \q_stop #4#5 + { + \str_convert_aux_iii:nnF {#4} {#1} {native} + \str_convert_aux_iii:nnF {#5} {#2} { } + \exp_args:Ncc \str_convert_aux_v:NNnNN + { str_convert_#4_#1: } { str_convert_#5_#2: } {#2} + } +\cs_new_protected:Npn \str_convert_aux_iii:nnF #1#2#3 { - \int_compare:nNnTF {`#1} < { 256 } + \cs_if_exist:cF { str_convert_#1_#2: } { - \int_to_letter:n { \int_div_truncate:nn {`#1} \c_sixteen } - \int_to_letter:n { \int_mod:nn {`#1} \c_sixteen } + \exp_args:Nx \str_convert_aux_iv:nnnF + { \str_aux_lowercase_alphanum:n {#2} } + {#1} {#2} {#3} } - { \msg_expandable_error:n { Invalid~byte~`#1'. } } } -\cs_new_nopar:Npn \str_aux_byte_to_octal:N #1 +\cs_new_protected:Npn \str_convert_aux_iv:nnnF #1#2#3#4 { - \int_compare:nNnTF {`#1} < { 64 } + \cs_if_exist:cF { str_convert_#2_#1: } { - 0 - \int_to_letter:n { \int_div_truncate:nn {`#1} \c_eight } - \int_to_letter:n { \int_mod:nn {`#1} \c_eight } + \group_begin: + \str_load_catcodes: + \str_load_one:n {#1} + \group_end: } + \cs_if_exist:cTF { str_convert_#2_#1: } + { \cs_gset_eq:cc { str_convert_#2_#3: } { str_convert_#2_#1: } } { - \int_compare:nNnTF {`#1} < { 256 } - { \int_to_octal:n {`#1} } - { \msg_expandable_error:n { Invalid~byte~`#1'. } } + \msg_kernel_error:nnx { str } { unknown-#2 } {#3} + \cs_gset_eq:cc { str_convert_#2_#3: } { str_convert_#2_#4: } } } -\cs_new_protected_nopar:Npn \str_bytes_escape_hexadecimal:NN #1#2 - { - \str_set:Nx #1 - { \str_map_tokens:Nn #2 \str_aux_byte_to_hexadecimal:N } - } -\tl_const:Nx \c_str_bytes_escape_name_str - { \c_hash_str \c_percent_str \c_lbrace_str \c_rbrace_str ()/<>[] } -\cs_new_protected_nopar:Npn \str_bytes_escape_name:NN #1#2 +\cs_new_protected:Npn \str_convert_aux_v:NNnNN #1#2#3#4#5 { - \str_set:Nx #1 - { \str_map_tokens:Nn #2 \str_bytes_escape_name_aux:N } - } -\cs_new_nopar:Npn \str_bytes_escape_name_aux:N #1 - { - \int_compare:nNnTF {`#1} < { "21 } - { \c_hash_str \str_aux_byte_to_hexadecimal:N #1 } + #5 { } {#1} + \cs_if_eq:NNTF #1 #4 { - \int_compare:nNnTF {`#1} > { "7E } - { \c_hash_str \str_aux_byte_to_hexadecimal:N #1 } - { - \str_if_contains_char:NNTF \c_str_bytes_escape_name_str #1 - { \c_hash_str \str_aux_byte_to_hexadecimal:N #1 } - {#1} - } + \tl_if_empty:nF {#3} + { \msg_kernel_error:nnx { str } { native-ignore-escaping } {#3} } } + { #2 } + #5 {#1} { } } -\tl_const:Nx \c_str_bytes_escape_string_str { \c_backslash_str ( ) } -\cs_new_protected_nopar:Npn \str_bytes_escape_string:NN #1#2 +\cs_new:Npn \str_aux_lowercase_alphanum:n #1 { - \str_set:Nx #1 - { \str_map_tokens:Nn #2 \str_bytes_escape_string_aux:N } + \exp_after:wN \str_aux_lowercase_alphanum_loop:N + \tl_to_str:n {#1} { ? \prg_map_break: } + \prg_break_point:n { } } -\cs_new_nopar:Npn \str_bytes_escape_string_aux:N #1 +\cs_new:Npn \str_aux_lowercase_alphanum_loop:N #1 { - \int_compare:nNnTF {`#1} < { "21 } - { \c_backslash_str \str_aux_byte_to_octal:N #1 } - { - \int_compare:nNnTF {`#1} > { "7E } - { \c_backslash_str \str_aux_byte_to_octal:N #1 } - { - \str_if_contains_char:NNT \c_str_bytes_escape_string_str #1 - { \c_backslash_str } - #1 - } - } + \use_none:n #1 + \if_num:w `#1 < \c_ninety_one + \if_num:w `#1 < \c_sixty_five + \if_num:w \c_one < 1#1 \exp_stop_f: + #1 + \fi: + \else: + \str_output_byte:n { `#1 + \c_thirty_two } + \fi: + \else: + \if_num:w `#1 < \c_one_hundred_twenty_three + \if_num:w `#1 < \c_ninety_seven + \else: + #1 + \fi: + \fi: + \fi: + \str_aux_lowercase_alphanum_loop:N } -\cs_new_protected_nopar:Npn \str_bytes_unescape_hexadecimal:NN #1#2 +\cs_new_protected_nopar:Npn \str_convert_from_internal: { } +\cs_new_protected_nopar:Npn \str_convert_to_internal: { } +\cs_new_protected:Npn \str_load:n #1 { \group_begin: - \tl_gclear:N \g_str_result_tl - \int_zero:N \l_str_char_int - \exp_last_unbraced:Nf \str_bytes_unescape_hexadecimal_aux:N - { \tl_to_other_str:N #2 } 0 - \q_recursion_tail \q_recursion_stop - \group_end: - \tl_set_eq:NN #1 \g_str_result_tl - } -\cs_new_protected_nopar:Npn \str_bytes_unescape_hexadecimal_aux:N #1 - { - \quark_if_recursion_tail_stop:N #1 - \str_aux_hexadecimal_test:NTF #1 - { \str_bytes_unescape_hexadecimal_aux_ii:N } - { \str_bytes_unescape_hexadecimal_aux:N } - } -\cs_new_protected_nopar:Npn \str_bytes_unescape_hexadecimal_aux_ii:N #1 - { - \quark_if_recursion_tail_stop:N #1 - \str_aux_hexadecimal_test:NTF #1 - { - \str_aux_convert_store: - \int_zero:N \l_str_char_int - \str_bytes_unescape_hexadecimal_aux:N - } - { \str_bytes_unescape_hexadecimal_aux_ii:N } - } -\group_begin: - \char_set_lccode:nn {`\*} {`\#} - \tl_to_lowercase:n - { - \group_end: - \cs_new_protected_nopar:Npn \str_bytes_unescape_name:NN #1#2 - { - \group_begin: - \tl_gclear:N \g_str_result_tl - \int_zero:N \l_str_char_int - \exp_last_unbraced:Nf \str_bytes_unescape_name_aux:wN - { \tl_to_other_str:N #2 } - * \q_recursion_tail \q_recursion_stop - \group_end: - \tl_set_eq:NN #1 \g_str_result_tl - } - \cs_new_protected_nopar:Npn \str_bytes_unescape_name_aux:wN #1 * #2 + \str_load_catcodes: + \clist_map_inline:nn {#1} { - \tl_gput_right:Nx \g_str_result_tl {#1} - \quark_if_recursion_tail_stop:N #2 - \str_aux_hexadecimal_test:NTF #2 - { \str_bytes_unescape_name_aux_ii:NN #2 } - { - \tl_gput_right:Nx \g_str_result_tl { \c_hash_str } - \str_bytes_unescape_name_aux:wN #2 - } + \exp_args:Nx \str_load_one:n + { \str_aux_lowercase_alphanum:n {#1} } } - } -\cs_new_protected_nopar:Npn \str_bytes_unescape_name_aux_ii:NN #1#2 - { - \str_aux_hexadecimal_test:NTF #2 - { - \str_aux_convert_store: - \int_zero:N \l_str_char_int - \str_bytes_unescape_name_aux:wN - } - { - \tl_gput_right:Nx \g_str_result_tl { \c_hash_str #1 } - \int_zero:N \l_str_char_int - \str_bytes_unescape_name_aux:wN #2 - } + \group_end: } -\group_begin: - \char_set_lccode:nn {`\*} {`\\} - \char_set_catcode_other:N \^^J - \char_set_catcode_other:N \^^M - \tl_to_lowercase:n - { - \group_end: - \cs_new_protected_nopar:Npn \str_bytes_unescape_string:NN #1#2 - { - \group_begin: - \tl_gclear:N \g_str_result_tl - \exp_last_unbraced:Nf \str_bytes_unescape_string_aux:wN - { \tl_to_other_str:N #2 } - * \q_recursion_tail \q_recursion_stop - \group_end: - \tl_set_eq:NN #1 \g_str_result_tl - } - \cs_new_protected_nopar:Npn \str_bytes_unescape_string_aux:wN #1 * #2 - { - \tl_gput_right:Nx \g_str_result_tl {#1} - \quark_if_recursion_tail_stop:N #2 - \int_zero:N \l_str_char_int - \str_aux_octal_test:NTF #2 - { \str_bytes_unescape_string_aux_d:N } - { - \int_set:Nn \l_str_char_int - { - \prg_case_str:xxn {#2} - { - { n } { 10 } - { r } { 13 } - { t } { 9 } - { b } { 8 } - { f } { 12 } - { ( } { 40 } - { ) } { 41 } - { \c_backslash_str } { 92 } - { ^^J } { -1 } - { ^^M } { -1 } - } - {`#2} - } - \int_compare:nNnF \l_str_char_int = \c_minus_one - { \str_aux_convert_store: } - \str_bytes_unescape_string_aux:wN - } - } - } -\cs_new_protected_nopar:Npn \str_bytes_unescape_string_aux_d:N #1 +\cs_new_protected:Npn \str_load_one:n #1 { - \str_aux_octal_test:NTF #1 - { \str_bytes_unescape_string_aux_dd:N } + \cs_if_exist:cF { str_convert_from_ #1 : } { - \str_aux_convert_store: - \str_bytes_unescape_string_aux:wN #1 + \cs_if_exist:cF { str_convert_input_#1: } + { + \file_if_exist:nTF { l3str- #1 .def } + { \file_input:n { l3str- #1 .def } } + { \str_load_alias:n {#1} } + } } } -\cs_new_protected_nopar:Npn \str_bytes_unescape_string_aux_dd:N #1 +\cs_new_protected:Npn \str_load_alias:n #1 { - \str_aux_octal_test:NTF #1 - { - \str_aux_convert_store: - \str_bytes_unescape_string_aux:wN - } + \exp_args:NNx \prop_get:NnNTF \g_str_aliases_prop {#1} \l_str_tmpa_tl { - \str_aux_convert_store: - \str_bytes_unescape_string_aux:wN #1 + \str_load_one:n { \l_str_tmpa_tl } + \cs_if_exist:cTF + { str_convert_from_ \l_str_tmpa_tl : } + { + \str_load_alias_aux:nnn {#1} { \l_str_tmpa_tl } { from } + \str_load_alias_aux:nnn {#1} { \l_str_tmpa_tl } { to } + } + { + \str_load_alias_aux:nnn {#1} { \l_str_tmpa_tl } { input } + \str_load_alias_aux:nnn {#1} { \l_str_tmpa_tl } { output } + } } + { \msg_kernel_error:nnx { str } { file-not-found } {#1} } + } +\cs_new_protected:Npn \str_load_alias_aux:nnn #1#2#3 + { \cs_new_eq:cc { str_convert_#3_#1: } { str_convert_#3_#2: } } +\cs_new_protected:Npn \str_load_catcodes: + { + \char_set_catcode_escape:N \\ + \char_set_catcode_group_begin:N \{ + \char_set_catcode_group_end:N \} + \char_set_catcode_math_superscript:N \^ + \char_set_catcode_ignore:N \ % + \tl_map_function:nN { abcdefghijklmnopqrstuvwxyz_:ABCDEFN } + \char_set_catcode_letter:N + \tl_map_function:nN { 0123456789"'?*+ } + \char_set_catcode_other:N + \char_set_catcode_comment:N \% + \int_set:Nn \tex_endlinechar:D {32} + } +\int_new:N \l_str_encoding_int +\cs_new_protected:Npn \str_convert_from_eight_bit:n #1 + { + \group_begin: + \int_zero:N \l_str_encoding_int + \exp_last_unbraced:Nx \str_convert_from_eight_bit_load:nn + { \tl_use:c { c_str_encoding_#1_tl } } + { \q_stop \prg_map_break: } { } + \prg_break_point:n { } + \exp_last_unbraced:Nx \str_convert_from_eight_bit_load_missing:n + { \tl_use:c { c_str_encoding_#1_missing_tl } } + { \q_stop \prg_map_break: } + \prg_break_point:n { } + \str_aux_gmap_result:N \str_convert_from_eight_bit_aux:N + \group_end: } -\tl_const:Nx \c_str_bytes_percent_encode_str { \tl_to_str:n { [] } } -\tl_const:Nx \c_str_bytes_percent_encode_not_str { \tl_to_str:n { "-.<> } } -\cs_new_protected_nopar:Npn \str_bytes_percent_encode:NN #1#2 +\cs_new_protected_nopar:Npn \str_convert_from_eight_bit_load:nn #1#2 { - \str_set:Nx #1 - { \str_map_tokens:Nn #2 \str_bytes_percent_encode_aux:N } + \use_none_delimit_by_q_stop:w #1 \q_stop + \tex_dimen:D "#1 = \l_str_encoding_int sp \scan_stop: + \tex_skip:D \l_str_encoding_int = "#1 sp \scan_stop: + \tex_toks:D \l_str_encoding_int \exp_after:wN { \int_value:w "#2 } + \tex_advance:D \l_str_encoding_int \c_one + \str_convert_from_eight_bit_load:nn } -\cs_new_nopar:Npn \str_bytes_percent_encode_aux:N #1 +\cs_new_protected_nopar:Npn \str_convert_from_eight_bit_load_missing:n #1 { - \int_compare:nNnTF {`#1} < { "41 } - { - \str_if_contains_char:NNTF \c_str_bytes_percent_encode_not_str #1 - { #1 } - { \c_percent_str \str_aux_byte_to_hexadecimal:N #1 } - } - { - \int_compare:nNnTF {`#1} > { "7E } - { \c_percent_str \str_aux_byte_to_hexadecimal:N #1 } - { - \str_if_contains_char:NNTF \c_str_bytes_percent_encode_str #1 - { \c_percent_str \str_aux_byte_to_hexadecimal:N #1 } - { #1 } - } - } + \use_none_delimit_by_q_stop:w #1 \q_stop + \tex_dimen:D "#1 = \l_str_encoding_int sp \scan_stop: + \tex_skip:D \l_str_encoding_int = "#1 sp \scan_stop: + \tex_toks:D \l_str_encoding_int \exp_after:wN { \int_value:w "FFFD } + \tex_advance:D \l_str_encoding_int \c_one + \str_convert_from_eight_bit_load_missing:n } -\group_begin: - \char_set_lccode:nn {`\*} {`\%} - \tl_to_lowercase:n - { - \group_end: - \cs_new_protected_nopar:Npn \str_bytes_percent_decode:NN #1#2 - { - \group_begin: - \tl_gclear:N \g_str_result_tl - \exp_last_unbraced:Nf \str_bytes_percent_decode_aux:wN - { \tl_to_other_str:N #2 } - * \q_recursion_tail \q_recursion_stop - \group_end: - \tl_set_eq:NN #1 \g_str_result_tl - } - \cs_new_protected_nopar:Npn \str_bytes_percent_decode_aux:wN #1 * #2 - { - \tl_gput_right:Nx \g_str_result_tl {#1} - \quark_if_recursion_tail_stop:N #2 - \int_zero:N \l_str_char_int - \str_aux_hexadecimal_test:NTF #2 - { \str_bytes_percent_decode_aux_ii:NN #2 } - { - \tl_gput_right:Nx \g_str_result_tl { \c_percent_str } - \str_bytes_percent_decode_aux:wN #2 - } - } - } -\cs_new_protected_nopar:Npn \str_bytes_percent_decode_aux_ii:NN #1#2 +\cs_new:Npn \str_convert_from_eight_bit_aux:N #1 { - \str_aux_hexadecimal_test:NTF #2 - { - \str_aux_convert_store: - \str_bytes_percent_decode_aux:wN - } - { - \tl_gput_right:Nx \g_str_result_tl {#1} - \str_bytes_percent_decode_aux:wN #2 - } + \if_num:w \tex_dimen:D `#1 < \l_str_encoding_int + \if_num:w \tex_skip:D \tex_dimen:D `#1 = `#1 \exp_stop_f: + \tex_the:D \tex_toks:D \tex_dimen:D + \fi: + \fi: + \int_value:w `#1 , } -\cs_new_protected_nopar:Npn \str_native_from_UTF_viii:NN #1#2 +\cs_new_protected:Npn \str_convert_to_eight_bit:n #1 { \group_begin: - \tl_gclear:N \g_str_result_tl - \exp_last_unbraced:Nf \str_native_from_UTF_viii_aux_i:N - { \tl_to_other_str:N #2 } - \q_recursion_tail \q_recursion_stop + \int_zero:N \l_str_encoding_int + \exp_last_unbraced:Nx \str_convert_to_eight_bit_load:nn + { \tl_use:c { c_str_encoding_#1_tl } } + { \q_stop \prg_map_break: } { } + \prg_break_point:n { } + \str_aux_gmap_internal_result:N \str_convert_to_eight_bit_aux:n \group_end: - \tl_set_eq:NN #1 \g_str_result_tl } -\cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_i:N #1 - { - \quark_if_recursion_tail_stop:N #1 - \int_set:Nn \l_str_char_int {`#1} - \str_native_from_UTF_viii_aux_ii:nN { 128 } \c_one - \str_native_from_UTF_viii_aux_ii:nN { 64 } \c_zero - \str_native_from_UTF_viii_aux_ii:nN { 32 } \c_two - \str_native_from_UTF_viii_aux_ii:nN { 16 } \c_three - \str_native_from_UTF_viii_aux_ii:nN { 8 } \c_four - \msg_error:nnx { str } { utf8-invalid-byte } {#1} - \use_i:nnn \str_native_from_UTF_viii_aux_i:N - \q_stop - \str_native_from_UTF_viii_aux_iii:N - } -\cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_ii:nN #1#2 +\cs_new_protected_nopar:Npn \str_convert_to_eight_bit_load:nn #1#2 { - \int_compare:nNnTF \l_str_char_int < {#1} - { - \int_set_eq:NN \l_str_bytes_int #2 - \use_none_delimit_by_q_stop:w - } - { \int_sub:Nn \l_str_char_int {#1} } + \use_none_delimit_by_q_stop:w #1 \q_stop + \tex_dimen:D "#2 = \l_str_encoding_int sp \scan_stop: + \tex_skip:D \l_str_encoding_int = "#2 sp \scan_stop: + \exp_args:NNf \tex_toks:D \l_str_encoding_int + { \str_output_byte:n { "#1 } } + \tex_advance:D \l_str_encoding_int \c_one + \str_convert_to_eight_bit_load:nn } -\cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_iii:N #1 +\cs_new:Npn \str_convert_to_eight_bit_aux:n #1 { - \int_compare:nNnTF \l_str_bytes_int < \c_two - { \str_native_from_UTF_viii_aux_iv: #1 } - { - \if_meaning:w \q_recursion_tail #1 - \msg_error:nn { str } { utf8-premature-end } - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \if_num:w #1 < "8000 \exp_stop_f: + \if_num:w \tex_dimen:D #1 < \l_str_encoding_int + \if_num:w \tex_skip:D \tex_dimen:D #1 = #1 \exp_stop_f: + \tex_the:D \tex_toks:D \tex_dimen:D #1 \exp_stop_f: + \exp_after:wN \exp_after:wN \exp_after:wN \use_none:nn \fi: - \quark_if_recursion_tail_stop:N #1 - \tex_multiply:D \l_str_char_int by 64 \scan_stop: - \int_decr:N \l_str_bytes_int - \int_compare:nNnTF {`#1} < { 128 } - { \use_ii:nn } - { \int_compare:nNnTF {`#1} < { 192 } } - { - \int_add:Nn \l_str_char_int { `#1 - 128 } - \str_native_from_UTF_viii_aux_iii:N - } - { - \msg_error:nnx { str } { utf8-missing-byte } {#1} - \str_native_from_UTF_viii_aux_i:N #1 - } - } + \fi: + \str_convert_to_eight_bit_aux_ii:n {#1} + \else: + \msg_expandable_kernel_error:nnn + { str } { eight_bit-to-byte-overflow } {#1} + \fi: } -\cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_iv: +\cs_new:Npn \str_convert_to_eight_bit_aux_ii:n #1 { - \int_compare:nNnTF \l_str_bytes_int = \c_zero - { - \msg_error:nnx { str } { utf8-extra-byte } - { \int_eval:n { \l_str_char_int + 128 } } - } - { \str_native_from_UTF_viii_aux_v: } - \str_native_from_UTF_viii_aux_i:N + \if_num:w #1 < \c_two_hundred_fifty_six + \str_output_byte:n {#1} + \else: + \msg_expandable_kernel_error:nn { str } { eight-bit-to-byte } + \fi: + } +\cs_new_protected:Npn \str_encoding_eight_bit:n #1 + { + \cs_new_protected:cpn { str_convert_from_#1: } + { \str_convert_from_eight_bit:n {#1} } + \cs_new_protected:cpn { str_convert_to_#1: } + { \str_convert_to_eight_bit:n {#1} } } \pdftex_if_engine:TF + { \cs_new_eq:NN \str_filter_bytes:n \use:n } { - \cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_v: + \cs_new_nopar:Npn \str_filter_bytes:n #1 { - \int_compare:nNnTF { \l_str_char_int } < { 256 } - { \str_aux_convert_store: } - { - \msg_error:nnx { str } { utf8-pdftex-overflow } - { \int_use:N \l_str_char_int } - } + \str_filter_bytes_aux:N #1 + { ? \prg_map_break: } + \prg_break_point:n { } + } + \cs_new_nopar:Npn \str_filter_bytes_aux:N #1 + { + \use_none:n #1 + \if_num:w `#1 < 256 \exp_stop_f: #1 \fi: + \str_filter_bytes_aux:N } } +\pdftex_if_engine:TF + { \cs_new_protected_nopar:Npn \str_convert_input_: { } } { - \cs_new_protected_nopar:Npn \str_native_from_UTF_viii_aux_v: - { \str_aux_convert_store: } - } -\cs_new_protected_nopar:Npn \str_UTF_viii_from_native:NN #1#2 - { - \group_begin: - \tl_gclear:N \g_str_result_tl - \str_map_tokens:Nn #2 \str_UTF_viii_from_native_aux_i:N - \group_end: - \tl_set_eq:NN #1 \g_str_result_tl - } -\cs_new_protected_nopar:Npn \str_UTF_viii_from_native_aux_i:N #1 - { - \int_set:Nn \l_str_char_int {`#1} - \int_compare:nNnTF \l_str_char_int < { 128 } - { \tl_gput_right:Nx \g_str_result_tl {#1} } + \cs_new_protected_nopar:Npn \str_convert_input_: { - \tl_gclear:N \g_str_tmpa_tl - \int_set:Nn \l_str_bytes_int { 64 } - \str_UTF_viii_from_native_aux_ii:n { 32 } - \str_UTF_viii_from_native_aux_ii:n { 16 } - \str_UTF_viii_from_native_aux_ii:n { 8 } - \ERROR % somehow the unicode char was > "1FFFFF > "10FFFF - \tl_gclear:N \g_str_tmpa_tl - \use_none:n \q_stop - \int_add:Nn \l_str_char_int { 2 * \l_str_bytes_int } - \str_aux_convert_store: - \tl_gput_right:Nx \g_str_result_tl { \g_str_tmpa_tl } + \tl_gset:Nx \g_str_result_tl + { \exp_args:No \str_filter_bytes:n \g_str_result_tl } } } -\cs_new_protected_nopar:Npn \str_UTF_viii_from_native_aux_ii:n #1 - { - \str_aux_convert_store:NNn - \tl_gput_left:Nx \g_str_tmpa_tl - { 128 + \int_mod:nn { \l_str_char_int } { 64 } } - \tex_divide:D \l_str_char_int by 64 \scan_stop: - \int_add:Nn \l_str_bytes_int {#1} - \int_compare:nNnT \l_str_char_int < {#1} - { \use_none_delimit_by_q_stop:w } +\cs_new_eq:NN \str_convert_input_bytes: \str_convert_input_: +\cs_new_protected_nopar:Npn \str_convert_output_: { } +\cs_new_eq:NN \str_convert_output_bytes: \str_convert_output_: +\cs_new_protected_nopar:Npn \str_convert_from_native: + { \str_aux_gmap_result:N \str_convert_from_native_aux:N } +\cs_new:Npn \str_convert_from_native_aux:N #1 + { \int_value:w `#1 , } +\cs_new_protected_nopar:Npn \str_convert_to_native: + { + \tl_set_eq:NN \l_str_tmpa_tl \g_str_result_tl + \tl_gclear:N \g_str_result_tl + \tex_afterassignment:D \str_convert_to_native_aux:w + \l_str_char_int = \l_str_tmpa_tl \c_zero \prg_map_break: , + \prg_break_point:n { } } -\msg_new:nnnn { str } { x-missing-brace } +\group_begin: + \char_set_catcode_other:n { `\^^@ } + \cs_new_protected_nopar:Npn \str_convert_to_native_aux:w #1 , + { + #1 + \if_int_compare:w \l_str_char_int > \c_max_char_int + \msg_kernel_error:nnx { str } { overflow } + { \int_use:N \l_str_char_int } + \else: + \tex_lccode:D \c_zero \l_str_char_int + \tl_to_lowercase:n + { \tex_xdef:D \g_str_result_tl { \g_str_result_tl ^^@ } } + \fi: + \tex_afterassignment:D \str_convert_to_native_aux:w + \l_str_char_int = + } +\group_end: +\msg_kernel_new:nnnn { str } { x-missing-brace } { Missing~closing~brace~in~ \token_to_str:N \x ~byte~sequence. } { You~wrote~something~like~ `\iow_char:N\\x\{ \int_to_hexadecimal:n { \l_str_char_int }'.~ The~closing~brace~is~missing. } -\msg_new:nnn { str } { utf8-invalid-byte } - { - \int_compare:nNnTF {`#1} < { 256 } - { Byte~number~ \int_eval:n {`#1} ~invalid~in~utf-8~encoding. } - { The~character~number~ \int_eval:n {`#1} ~is~not~a~byte. } - } -\msg_new:nnn { str } { utf8-missing-byte } - { The~byte~number~ \int_eval:n {`#1} ~is~not~a~valid~continuation~byte. } -\msg_new:nnn { str } { utf8-extra-byte } - { The~byte~number~ \int_eval:n {`#1} ~is~only~valid~as~a~continuation~byte. } -\msg_new:nnnn { str } { utf8-premature-end } - { Incomplete~last~UTF8~character. } +\msg_kernel_new:nnnn { str } { overflow } + { Character~code~#1~too~big. } { - The~sequence~of~byte~that~to~be~converted~to~UTF8~ - ended~before~the~last~character~was~complete.~Perhaps~ - it~was~mistakenly~truncated? + \int_compare:nNnTF {#1} > { 1114111 } + { The~Unicode~standard~limits~code~points~to~1114111. } + { + 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. + } } -\msg_new:nnn { str } { utf8-pdftex-overflow } - { The~character~number~#1~is~too~big~for~pdfTeX. } +\msg_kernel_new:nnn { str } { convert-input } + { Input~scheme~`#1'~unknown. } +\msg_kernel_new:nnn { str } { convert-from } + { Encoding~`#1'~unknown. } +\msg_kernel_new:nnn { str } { convert-to } + { Encoding~`#1'~unknown.~Using~UTF-8. } +\msg_kernel_new:nnn { str } { convert-output } + { Output~scheme~`#1~unknown. } +\msg_kernel_new:nnn { str } { to-native } + { Use~\str_set_convert:Nnn to~convert~to~native~strings. } +\msg_kernel_new:nnn { str } { unicode-surrogate } + { Code~point~#1~is~an~unpaired~surrogate. } +\msg_kernel_new:nnn { str } { utf16-surrogate } + { UTF-16~unpaired~surrogate~#1. } +\msg_kernel_new:nnn { str } { utf16-odd } + { UTF-16~dangling~byte~#1. } +\msg_kernel_new:nnn { str } { utf8-extra-conti } + { UTF-8~extra~continuation~byte~#1. } +\msg_kernel_new:nnn { str } { utf8-missing-conti } + { UTF-8~missing~continuation~byte~#1. } +\msg_kernel_new:nnn { str } { utf8-invalid-byte } + { Byte~#1~cannot~appear~in~UTF-8. } +\msg_kernel_new:nnn { str } { utf8-overlong } + { Overlong~UTF-8~byte~sequence~for~code~point~#1. } +\msg_kernel_new:nnn { str } { utf8-premature-end } + { Incomplete~last~UTF-8~character. } +\msg_kernel_new:nnn { str } { utf32-overflow } + { Code~point~too~large~(UTF-32~`#1'). } +\msg_kernel_new:nnn { str } { utf32-truncated } + { Truncated~UTF-32~string~`...#1'. } \cs_set:Npn \str_length_skip_spaces:N { \exp_args:No \str_length_skip_spaces:n } \cs_set_eq:NN \str_length_skip_spaces:n \str_length_ignore_spaces:n -- cgit v1.2.3