diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-12 22:54:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-12 22:54:42 +0000 |
commit | 60ede63177ff54dd8d1934012fbecce179a633ee (patch) | |
tree | 9dbd9e4608c9a0caa9864fedf49f0a2aea36fedf /Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx | |
parent | c2d4fa6f59f3c566ccd85e3b250f0a27485bbaea (diff) |
l3 (12jul13)
git-svn-id: svn://tug.org/texlive/trunk@31181 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 | 50 |
1 files changed, 46 insertions, 4 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 1810468ff7d..19bad05b982 100644 --- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx @@ -125,7 +125,8 @@ % \texttt{iso885915}, \texttt{latin9} & \textsc{iso 8859-15} \\ % \texttt{iso885916}, \texttt{latin10} & \textsc{iso 8859-16} \\ % \midrule -% Empty & Native (Unicode) string. \\ +% \texttt{clist} & comma-list of integers \\ +% \meta{empty} & native (Unicode) string \\ % \bottomrule % \end{tabular} % \end{table} @@ -1187,6 +1188,47 @@ % \end{macrocode} % \end{macro} % +% \subsubsection{\texttt{clist}} +% +% \begin{macro}[int]{\@@_convert_decode_clist:} +% \begin{macro}[aux, rEXP]{\@@_decode_clist_char:n} +% Convert each integer to the internal form. We first turn +% \cs{g_@@_result_tl} into a clist variable, as this avoids problems +% with leading or trailing commas. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_convert_decode_clist: + { + \clist_set:No \g_@@_result_tl \g_@@_result_tl + \tl_gset:Nx \g_@@_result_tl + { + \exp_args:No \clist_map_function:nN + \g_@@_result_tl \@@_decode_clist_char:n + } + } +\cs_new:Npn \@@_decode_clist_char:n #1 + { #1 \s__tl \int_eval:n {#1} \s__tl } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[int]{\@@_convert_encode_clist:} +% \begin{macro}[aux, rEXP]{\@@_encode_clist_char:n} +% Convert the internal list of character codes to a comma-list of +% character codes. The first line produces a comma-list with a +% leading comma, removed in the next step (this also works in the +% empty case, since \cs{tl_tail:N} does not trigger an error in this +% case). +% \begin{macrocode} +\cs_new_protected_nopar:Npn \@@_convert_encode_clist: + { + \@@_convert_gmap_internal:N \@@_encode_clist_char:n + \tl_gset:Nx \g_@@_result_tl { \tl_tail:N \g_@@_result_tl } + } +\cs_new:Npn \@@_encode_clist_char:n #1 { , #1 } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsubsection{8-bit encodings} % % This section will be entirely rewritten: it is not yet clear in what @@ -1211,7 +1253,7 @@ % \end{syntax} % This declares the encoding \meta{name} to map bytes to Unicode % characters according to the \meta{mapping}, and map those bytes -% which are not mentionned in the \meta{mapping} either to the +% which are not mentioned in the \meta{mapping} either to the % replacement character (if they appear in \meta{missing}), or to % themselves. % @@ -2067,7 +2109,7 @@ % |#3| for the previous range. Otherwise, we call the % \texttt{_continuation} auxiliary again, after shifting the % \enquote{current code point} by |#4| (maximum from the range we just -% checkedd). +% checked). % % Two additional tests are needed: if we reach the end of the list of % range maxima and we are still not done, then we are faced with an @@ -2629,7 +2671,7 @@ % of a byte-order mark. If there is a byte-order mark, use that % endianness, and remove the $4$ bytes, otherwise default to % big-endian, and leave the $4$ bytes in place. The -% \cs{@@_decode_utf_xxxii:Nw} auxiliary recieves $1$ or $2$ as its +% \cs{@@_decode_utf_xxxii:Nw} auxiliary receives $1$ or $2$ as its % first argument indicating endianness, and the string to convert as % its second argument (expanded or not). It sets \cs{@@_tmp:w} to % expand to the character code of either of its two arguments |