[latex3-commits] [l3svn] r6699 - Provide \c_max_char_int in l3kernel (fixes #309)

noreply at latex-project.org noreply at latex-project.org
Wed Sep 7 18:03:16 CEST 2016


Author: bruno
Date: 2016-09-07 18:03:15 +0200 (Wed, 07 Sep 2016)
New Revision: 6699

Modified:
   trunk/l3experimental/l3str/l3regex.dtx
   trunk/l3experimental/l3str/l3str-convert.dtx
   trunk/l3kernel/l3int.dtx
   trunk/l3kernel/testfiles/m3expl001.luatex.tlg
   trunk/l3kernel/testfiles/m3expl001.ptex.tlg
   trunk/l3kernel/testfiles/m3expl001.tlg
   trunk/l3kernel/testfiles/m3expl001.uptex.tlg
   trunk/l3kernel/testfiles/m3expl001.xetex.tlg
   trunk/l3kernel/testfiles/m3expl003.luatex.tlg
   trunk/l3kernel/testfiles/m3expl003.ptex.tlg
   trunk/l3kernel/testfiles/m3expl003.tlg
   trunk/l3kernel/testfiles/m3expl003.uptex.tlg
   trunk/l3kernel/testfiles/m3expl003.xetex.tlg
Log:
Provide \c_max_char_int in l3kernel (fixes #309)

This simply moves \c_max_char_int from the experimental
l3str to the kernel l3int.  In pTeX and upTeX characters
with character codes larger than 255 are possible, but
many primitives do not allow such arguments.  In l3regex
it may make sense in the future to test more precisely
whether a given character code >255 can match any kanji.


Modified: trunk/l3experimental/l3str/l3regex.dtx
===================================================================
--- trunk/l3experimental/l3str/l3regex.dtx	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3experimental/l3str/l3regex.dtx	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1444,7 +1444,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-%
+% ^^A todo: use char_generate in above and rest of file
 % \begin{macro}[aux]{\@@_escape_x_test:N, \@@_escape_x_testii:N}
 %   Find out whether the first character is a left brace (allowing any
 %   number of hexadecimal digits), or not (allowing up to two

Modified: trunk/l3experimental/l3str/l3str-convert.dtx
===================================================================
--- trunk/l3experimental/l3str/l3str-convert.dtx	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3experimental/l3str/l3str-convert.dtx	2016-09-07 16:03:15 UTC (rev 6699)
@@ -207,11 +207,6 @@
 %   encoding. Instead, the \meta{false code} is performed.
 % \end{function}
 %
-% \begin{variable}{\c_max_char_int}
-%   The maximum valid character code, $255$ for pdf\TeX{}, and $1114111$
-%   for \XeTeX{} and \LuaTeX{}.
-% \end{variable}
-%
 % \section{Internal string functions}
 %
 % \begin{function}{\__str_gset_other:Nn}
@@ -313,23 +308,6 @@
 %
 % \subsubsection{Variables and constants}
 %
-% \begin{variable}{\c_max_char_int}
-%   The maximum valid character code is $255$ for pdf\TeX{}, and
-%   $1114111$ for other engines.
-%    \begin{macrocode}
-\int_const:Nn \c_max_char_int
-  {
-    \bool_if:nTF
-      {
-        \sys_if_engine_luatex_p: ||
-        \sys_if_engine_xetex_p:
-      }
-      { "10FFFF }
-      { "FF }
-  }
-%    \end{macrocode}
-% \end{variable}
-%
 % \begin{macro}{\@@_tmp:w}
 % \begin{variable}{\l_@@_internal_int}
 % \begin{variable}{\l_@@_internal_tl}
@@ -425,7 +403,7 @@
 % \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}

Modified: trunk/l3kernel/l3int.dtx
===================================================================
--- trunk/l3kernel/l3int.dtx	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/l3int.dtx	2016-09-07 16:03:15 UTC (rev 6699)
@@ -832,6 +832,10 @@
 %   Maximum number of registers.
 % \end{variable}
 %
+% \begin{variable}{\c_max_char_int}
+%   Maximum character code completely supported by the engine.
+% \end{variable}
+%
 % \section{Scratch integers}
 %
 % \begin{variable}{\l_tmpa_int, \l_tmpb_int}
@@ -2434,6 +2438,25 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \begin{variable}{\c_max_char_int}
+%   The largest character code is $1114111$ (hexadecimal |10FFFF|) in
+%   \XeTeX{} and \LuaTeX{} and $255$ in other engines.  In many places
+%   \pTeX{} and \upTeX{} support larger character codes but for instance
+%   the values of \tn{lccode} are restricted to $[0,255]$.
+%    \begin{macrocode}
+\int_const:Nn \c_max_char_int
+  {
+    \if_int_odd:w 0
+      \cs_if_exist:NT \luatex_luatexversion:D  { 1 }
+      \cs_if_exist:NT \xetex_XeTeXversion:D    { 1 } ~
+      "10FFFF
+    \else:
+      "FF
+    \fi:
+  }
+%    \end{macrocode}
+% \end{variable}
+%
 % \subsection{Scratch integers}
 %
 % \begin{variable}{\l_tmpa_int, \l_tmpb_int}

Modified: trunk/l3kernel/testfiles/m3expl001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1630,6 +1630,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count113
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count114
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl001.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count113
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count114
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1628,6 +1628,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1630,6 +1630,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count113
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count114
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl003.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1365,6 +1365,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count113
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count114
 Defining \l_tmpb_int on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2016-09-06 12:40:44 UTC (rev 6698)
+++ trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2016-09-07 16:03:15 UTC (rev 6699)
@@ -1628,6 +1628,7 @@
 Defining \c_ten_thousand on line ...
 Defining \c_max_int on line ...
 \c_max_int=\count112
+Defining \c_max_char_int on line ...
 Defining \l_tmpa_int on line ...
 \l_tmpa_int=\count113
 Defining \l_tmpb_int on line ...



More information about the latex3-commits mailing list