[latex3-commits] [git/LaTeX3-latex3-latex3] lmtx: Picking off LuaTeX vs LMTX conditionals (49d89a31e)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 20 18:24:21 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : lmtx
Link       : https://github.com/latex3/latex3/commit/49d89a31eeebf6c553229abc4ed8537a2574c2c6

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

commit 49d89a31eeebf6c553229abc4ed8537a2574c2c6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 20 17:24:21 2023 +0100

    Picking off LuaTeX vs LMTX conditionals


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

49d89a31eeebf6c553229abc4ed8537a2574c2c6
 l3kernel/l3cctab.dtx | 48 ++++++++++++++++++++++++++++++++++++------------
 l3kernel/l3file.dtx  | 26 ++++++++++++++++++++------
 2 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/l3kernel/l3cctab.dtx b/l3kernel/l3cctab.dtx
index 8ae5d43cf..99e411f3e 100644
--- a/l3kernel/l3cctab.dtx
+++ b/l3kernel/l3cctab.dtx
@@ -254,7 +254,9 @@
 %   In Con\TeX{}t, \tn{newcatcodetable} does not include the initialisation,
 %   so that is added explicitly.
 %    \begin{macrocode}
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new_protected:Npn \cctab_new:N #1
       {
@@ -312,7 +314,9 @@
 %   default value $13$.  In other engines we store $256$ current
 %   catcodes and the \tn{endlinechar} in an intarray variable.
 %    \begin{macrocode}
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new_protected:Npn \@@_gset:n #1
       { \exp_args:Nf \@@_gset_aux:n { \int_eval:n {#1} } }
@@ -408,7 +412,9 @@
 %   }
 % \end{verbatim}
 %    \begin{macrocode}
-\sys_if_engine_luatex:T
+\bool_lazy_if:nnT
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \@@_new:N \g_@@_internal_cctab
     \cs_new:Npn \@@_internal_cctab_name:
@@ -433,7 +439,9 @@
 \cs_new_protected:Npn \cctab_select:N #1
   { \@@_chk_if_valid:NT #1 { \@@_select:N #1 } }
 \cs_generate_variant:Nn \cctab_select:N { c }
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new_protected:Npn \@@_select:N #1
       {
@@ -477,7 +485,9 @@
 %   we must make sure to save the catcodes in a table we control and
 %   restore them at \cs{cctab_end:}.
 %    \begin{macrocode}
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new_protected:Npn \@@_begin_aux:
       {
@@ -639,7 +649,9 @@
 %   to a \tn{catcodetable} register.  In other engines, the number is
 %   extracted from the |cctab| variable.
 %    \begin{macrocode}
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   { \cs_new:Npn \@@_nesting_number:N #1 {#1} }
   {
     \cs_new:Npn \@@_nesting_number:N #1
@@ -680,7 +692,9 @@
 %    \begin{macrocode}
 \cs_new:Npn \cctab_item:Nn #1#2
   { \exp_args:Nf \@@_item:nN { \int_eval:n {#2} } #1 }
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new:Npn \@@_item:nN #1#2
       { \lua_now:e { tex.print(-2, tex.getcatcode(\int_use:N #2, #1)) } }
@@ -737,7 +751,9 @@
         \prg_return_false:
       }
   }
-\sys_if_engine_luatex:TF
+\bool_lazy_if:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new_protected:Npn \@@_chk_if_valid_aux:NTF #1
       {
@@ -819,8 +835,12 @@
     \group_begin:
       \int_set:Nn \tex_endlinechar:D { 32 }
       \char_set_catcode_invalid:n { 0 }
-      \bool_lazy_or:nnTF
-        { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: }
+      \bool_lazy_any:nTF
+        {
+          { \sys_if_engine_lmtx_p: }
+          { \sys_if_engine_luatex_p: }
+          { \sys_if_engine_xetex_p: }
+        }
         { \int_step_function:nN { 31 } \char_set_catcode_invalid:n }
         { \int_step_function:nN { 31 } \char_set_catcode_active:n }
       \int_step_function:nnN { 33 } { 64 } \char_set_catcode_other:n
@@ -845,8 +865,12 @@
       \char_set_catcode_group_end:n        { 125 } % right brace
       \char_set_catcode_space:n            { 126 } % tilde
       \char_set_catcode_invalid:n          { 127 } % ^^?
-      \bool_lazy_or:nnF
-        { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: }
+      \bool_lazy_any:nF
+        {
+          { \sys_if_engine_lmtx_p: }
+          { \sys_if_engine_luatex_p: }
+          { \sys_if_engine_xetex_p: }
+        }
         { \int_step_function:nnN { 128 } { 255 } \char_set_catcode_active:n }
       \@@_gset:n { \c_code_cctab }
     \group_end:
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 5d7a60824..28cee887f 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -1103,7 +1103,9 @@
     \tex_global:D \tex_chardef:D #1 = \exp_not:N \l_@@_stream_tl \scan_stop:
     \prop_gput:NVn \exp_not:N \g_@@_streams_prop #1 {#2}
     \tex_openin:D #1
-      \sys_if_engine_luatex:TF
+      \bool_lazy_or:nnTF
+        { \sys_if_engine_lmtx_p: }
+        { \sys_if_engine_luatex_p: }
         { {#2} }
         {  \exp_not:N \__kernel_file_name_quote:n {#2} \scan_stop: }
   }
@@ -1410,7 +1412,11 @@
 \int_const:Nn \c_term_iow
   {
     \bool_lazy_and:nnTF
-      { \sys_if_engine_luatex_p: }
+      {
+        \bool_lazy_or_p:nn
+          { \sys_if_engine_lmtx_p: }
+          { \sys_if_engine_luatex_p: }
+      }
       { \int_compare_p:nNn \tex_luatexversion:D > { 80 } }
       { 128 }
       { 16 }
@@ -2714,7 +2720,9 @@
       \exp_not:N \exp_after:wN #3
       \exp_not:N \exp_after:wN \exp_not:N \prg_do_nothing:
       \exp_not:N \tex_input:D
-      \sys_if_engine_luatex:TF
+      \bool_lazy_or:nnTF
+        { \sys_if_engine_lmtx_p: }
+        { \sys_if_engine_luatex_p: }
         { {#1} }
         { \exp_not:N \__kernel_file_name_quote:n {#1} \scan_stop: }
     \exp_not:N \if_false: } \exp_not:N \fi:
@@ -3059,7 +3067,9 @@
   }
 \cs_new:Npn \file_hex_dump:n #1
   { \exp_args:Ne \@@_hex_dump:n { \file_full_name:n {#1} } }
-\sys_if_engine_luatex:TF
+\bool_lazy_or:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \cs_new:Npn \@@_hex_dump:n #1
       {
@@ -3309,7 +3319,9 @@
       { \seq_gput_right:Nn \exp_not:N \g_@@_record_seq {#1} }
     \exp_not:N \@@_input_push:n {#1}
     \exp_not:N \tex_input:D
-    \sys_if_engine_luatex:TF
+    \bool_lazy_or:nnTF
+      { \sys_if_engine_lmtx_p: }
+      { \sys_if_engine_luatex_p: }
       { {#1} }
       { \exp_not:N \__kernel_file_name_quote:n {#1} \scan_stop: }
     \exp_not:N \@@_input_pop:
@@ -3761,7 +3773,9 @@
 %   escape and seems unlikely to be useful. This is set up here as it requires
 %   file searching.
 %    \begin{macrocode}
-\sys_if_engine_luatex:TF
+\bool_lazy_or:nnTF
+  { \sys_if_engine_lmtx_p: }
+  { \sys_if_engine_luatex_p: }
   {
     \str_const:Nx \c_sys_platform_str
       { \tex_directlua:D { tex.print(os.type) } }





More information about the latex3-commits mailing list.