[latex3-commits] [git/LaTeX3-latex3-latex3] master: Fix cctab tests for LuaTeX (b8c53a23c)

Phelype Oleinik phe.h.o1 at gmail.com
Tue Sep 10 04:12:42 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/b8c53a23c9b519d60f870928b182f69cf54ea12e

>---------------------------------------------------------------

commit b8c53a23c9b519d60f870928b182f69cf54ea12e
Author: Phelype Oleinik <phe.h.o1 at gmail.com>
Date:   Mon Sep 9 23:12:42 2019 -0300

    Fix cctab tests for LuaTeX


>---------------------------------------------------------------

b8c53a23c9b519d60f870928b182f69cf54ea12e
 l3experimental/l3cctab/l3cctab.dtx                    | 19 +++++++++++++++++--
 .../l3cctab/testfiles/m3cctab002.luatex.tlg           | 15 +++++++++++----
 l3experimental/l3cctab/testfiles/m3cctab002.tlg       |  2 +-
 3 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/l3experimental/l3cctab/l3cctab.dtx b/l3experimental/l3cctab/l3cctab.dtx
index cf952ed50..347af3dc7 100644
--- a/l3experimental/l3cctab/l3cctab.dtx
+++ b/l3experimental/l3cctab/l3cctab.dtx
@@ -427,7 +427,22 @@
       { TF , T , F }
       {
         \cctab_if_exist:NTF #1
-          { \prg_return_true: }
+          {
+%<*initex>
+            \bool_lazy_and:nnTF
+              { \int_if_odd_p:n {#1} }
+              { \int_compare_p:nNn {#1-1} < { \g_@@_allocate_int } }
+%</initex>
+%<*package>
+            \int_compare:nNnTF {#1-1} < { \e at alloc@ccodetable at count }
+%</package>
+              { \prg_return_true: }
+              {
+                \__kernel_msg_error:nnx { kernel } { invalid-cctab }
+                  { \token_to_str:N #1 }
+                \prg_return_false:
+              }
+          }
           {
             \__kernel_msg_error:nnx { kernel } { command-not-defined }
               { \token_to_str:N #1 }
@@ -524,7 +539,7 @@
     \iow_char:N\\cctab_begin:N.~This~command~will~be~ignored.
   }
 \__kernel_msg_new:nnnn { kernel } { invalid-cctab }
-  { Invalid~\iow_char:N\\catcode:~table. }
+  { Invalid~\iow_char:N\\catcode~table. }
   {
     You~can~only~switch~to~a~\iow_char:N\\catcode~table~that~is~
     initialized~using~\iow_char:N\\cctab_new:N~or~
diff --git a/l3experimental/l3cctab/testfiles/m3cctab002.luatex.tlg b/l3experimental/l3cctab/testfiles/m3cctab002.luatex.tlg
index 1a5484ff1..05aec363f 100644
--- a/l3experimental/l3cctab/testfiles/m3cctab002.luatex.tlg
+++ b/l3experimental/l3cctab/testfiles/m3cctab002.luatex.tlg
@@ -25,13 +25,20 @@ this has not been defined yet.
 ============================================================
 TEST 2: Another undefined cctab for \cctab_end:N 
 ============================================================
-! Invalid \catcode table.
-<recently read> \l_tmpa_int 
+! LaTeX3 Error: Invalid \catcode table.
+For immediate help type H <return>.
+ ...                                              
 l. ...  }
-You can only switch to a \catcode table that is initialized
-using \savecatcodetable or \initcatcodetable, or to table 0
+You can only switch to a \catcode table that is initialized using \cctab_new:N
+or \cctab_const:Nn.
 ============================================================
 ============================================================
 TEST 3: Extra \cctab_end: 
 ============================================================
+! LaTeX3 Error: Extra \cctab_end: ignored on line ....
+For immediate help type H <return>.
+ ...                                              
+l. ...  { \cctab_end: }
+LaTeX came across a \cctab_end: without a matching \cctab_begin:N. This
+command will be ignored.
 ============================================================
diff --git a/l3experimental/l3cctab/testfiles/m3cctab002.tlg b/l3experimental/l3cctab/testfiles/m3cctab002.tlg
index 6e2ca8b9f..b5b5a89ef 100644
--- a/l3experimental/l3cctab/testfiles/m3cctab002.tlg
+++ b/l3experimental/l3cctab/testfiles/m3cctab002.tlg
@@ -20,7 +20,7 @@ this has not been defined yet.
 ============================================================
 TEST 2: Another undefined cctab for \cctab_end:N 
 ============================================================
-! LaTeX3 Error: Invalid \catcode: table.
+! LaTeX3 Error: Invalid \catcode table.
 For immediate help type H <return>.
  ...                                              
 l. ...  }





More information about the latex3-commits mailing list