diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-14 22:40:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-14 22:40:58 +0000 |
commit | e0c5d6d38a1f285f20a66692e46d2e607d6ff1dd (patch) | |
tree | 977232bc088d27b46d9a6330c8f4f47aa98dbb78 /Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx | |
parent | 4407d96af752e6e79a48c25c5189bd1a63fbd125 (diff) |
l3 (14may17)
git-svn-id: svn://tug.org/texlive/trunk@44351 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx | 92 |
1 files changed, 8 insertions, 84 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx index 0f5e21f0514..4e4b8c3959b 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx @@ -47,7 +47,7 @@ % }^^A % } % -% \date{Released 2017/04/01} +% \date{Released 2017/05/13} % % \maketitle % @@ -192,15 +192,6 @@ % % \section{Internal string functions} % -% \begin{function}{\__str_gset_other:Nn} -% \begin{syntax} -% \cs{__str_gset_other:Nn} \meta{tl~var} \Arg{token list} -% \end{syntax} -% Converts the \meta{token list} to an \meta{other string}, where -% spaces have category code \enquote{other}, and assigns the result to -% the \meta{tl~var}, globally. -% \end{function} -% % \begin{function}{\__str_hexadecimal_use:NTF} % \begin{syntax} % \cs{__str_hexadecimal_use:NTF} \meta{token} \Arg{true code} \Arg{false code} @@ -216,17 +207,6 @@ % \end{texnote} % \end{function} % -% \begin{function}[EXP]{\__str_output_byte:n} -% \begin{syntax} -% \cs{__str_output_byte:n} \Arg{intexpr} -% \end{syntax} -% Expands to a character token with category other and character code -% equal to the value of \meta{intexpr}. The value of \meta{intexpr} -% must be in the range $[-1, 255]$, and any value outside this range -% results in undefined behaviour. The special value $-1$ is used to -% produce an empty result. -% \end{function} -% % \section{Possibilities, and things to do} % % Encoding/escaping-related tasks. @@ -272,7 +252,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3str-convert}{2017/04/01}{} +\ProvidesExplPackage{l3str-convert}{2017/05/13}{} {L3 Experimental string encoding conversions} \RequirePackage{l3tl-analysis,l3tl-build} % \end{macrocode} @@ -330,20 +310,6 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\c_@@_ascii_min_int, \c_@@_ascii_max_control_int, \c_@@_ascii_max_int} -% \begin{macrocode} -\int_const:Nn \c_@@_ascii_min_int { 0 } -\int_const:Nn \c_@@_ascii_max_control_int { 31 } -\int_const:Nn \c_@@_ascii_max_int { 127 } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[aux]{\c_@@_ascii_lower_int} -% \begin{macrocode} -\int_const:Nn \c_@@_ascii_lower_int { `a - `A } -% \end{macrocode} -% \end{macro} -% % \begin{variable}{\g_@@_alias_prop} % To avoid needing one file per encoding/escaping alias, we keep track % of those in a property list. @@ -387,48 +353,6 @@ % \end{macrocode} % \end{variable} % -% \subsubsection{Escaping spaces} -% ^^A todo: use char_generate in this file -% \begin{macro}[int]{\@@_gset_other:Nn} -% \begin{macro}[aux,EXP]{\@@_gset_other_loop:w} -% \begin{macro}[aux,EXP]{\@@_gset_other_end:w} -% This function could be done by using \cs{@@_to_other:n} within -% an \texttt{x}-expansion, but that would take a time quadratic in the -% size of the string. Instead, we can \enquote{leave the result behind -% us} in the input stream, to be captured into the expanding -% assignment. This gives us a linear time. -% \begin{macrocode} -\group_begin: -\char_set_lccode:nn { `\* } { `\ } -\char_set_lccode:nn { `\A } { `\A } -\tex_lowercase:D - { - \group_end: - \cs_new_protected:Npn \@@_gset_other:Nn #1#2 - { - \tl_gset:Nx #1 - { - \exp_after:wN \@@_gset_other_loop:w \tl_to_str:n {#2} ~ % - A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_stop - } - } - \cs_new:Npn \@@_gset_other_loop:w - #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 ~ - { - \if_meaning:w A #9 - \@@_gset_other_end:w - \fi: - #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * #9 - \@@_gset_other_loop:w * - } - \cs_new:Npn \@@_gset_other_end:w \fi: #1 * A #2 \q_stop - { \fi: #1 } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% % \subsection{String conditionals} % % \begin{macro}[EXP]{\@@_if_contains_char:NNT, \@@_if_contains_char:NNTF} @@ -544,12 +468,12 @@ % an empty result for the input $-1$. % \begin{macrocode} \group_begin: - \tl_set:Nx \l__str_internal_tl { \tl_to_str:n { 0123456789ABCDEF } } - \tl_map_inline:Nn \l__str_internal_tl + \tl_set:Nx \l_@@_internal_tl { \tl_to_str:n { 0123456789ABCDEF } } + \tl_map_inline:Nn \l_@@_internal_tl { - \tl_map_inline:Nn \l__str_internal_tl + \tl_map_inline:Nn \l_@@_internal_tl { - \tl_const:cx { c__str_byte_ \int_eval:n {"#1##1} _tl } + \tl_const:cx { c_@@_byte_ \int_eval:n {"#1##1} _tl } { \char_generate:nn { "#1##1 } { 12 } #1 ##1 } } } @@ -783,7 +707,7 @@ { \group_begin: #1 - \@@_gset_other:Nn \g_@@_result_tl {#4} + \tl_gset:Nx \g_@@_result_tl { \@@_to_other_fast:n {#4} } \exp_after:wN \@@_convert:wwwnn \tl_to_str:n {#5} /// \q_stop { decode } { unescape } @@ -951,7 +875,7 @@ #1 \fi: \else: - \@@_output_byte:n { `#1 + \c_@@_ascii_lower_int } + \@@_output_byte:n { `#1 + `a - `A } \fi: \fi: \@@_convert_lowercase_alphanum_loop:N |