[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use direct copies of \directlua and \luaescapestring (d60ebee)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 19 18:41:11 CEST 2018


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

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

commit d60ebeec45fbdaf55d9436f8d80ee820086e26f2
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 19 17:41:11 2018 +0100

    Use direct copies of \directlua and \luaescapestring
    
    Putting a one-level redirect here makes using these with a known number
    of expansions tricky. Moreover, it doesn't actually help when we are not
    using LuaTeX: a test is still required 'up front'.


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

d60ebeec45fbdaf55d9436f8d80ee820086e26f2
 l3kernel/l3luatex.dtx                   |   42 +++++++++----------------------
 l3kernel/l3str.dtx                      |    4 +--
 l3kernel/testfiles/m3expl001.luatex.tlg |    9 +++----
 l3kernel/testfiles/m3expl001.ptex.tlg   |    7 +-----
 l3kernel/testfiles/m3expl001.tlg        |    7 +-----
 l3kernel/testfiles/m3expl001.uptex.tlg  |    7 +-----
 l3kernel/testfiles/m3expl001.xetex.tlg  |    7 +-----
 l3kernel/testfiles/m3expl003.luatex.tlg |    9 +++----
 l3kernel/testfiles/m3expl003.ptex.tlg   |    7 +-----
 l3kernel/testfiles/m3expl003.tlg        |    7 +-----
 l3kernel/testfiles/m3expl003.uptex.tlg  |    7 +-----
 l3kernel/testfiles/m3expl003.xetex.tlg  |    7 +-----
 12 files changed, 28 insertions(+), 92 deletions(-)

diff --git a/l3kernel/l3luatex.dtx b/l3kernel/l3luatex.dtx
index 035156a..11102fc 100644
--- a/l3kernel/l3luatex.dtx
+++ b/l3kernel/l3luatex.dtx
@@ -58,7 +58,8 @@
 %
 % \subsection{\TeX{} code interfaces}
 %
-% \begin{function}[EXP, added = 2015-06-29]{\lua_now_x:n, \lua_now:n}
+% \begin{function}[EXP, added = 2015-06-29, updated = 2018-04-19]
+%   {\lua_now_x:n, \lua_now:n}
 %   \begin{syntax}
 %     \cs{lua_now:n} \Arg{token list}
 %   \end{syntax}
@@ -74,9 +75,8 @@
 %   by \TeX{} in an \texttt{x}-type manner \emph{but} the function remains
 %   fully expandable.
 %   \begin{texnote}
-%     \cs{lua_now_x:n} is a macro wrapper around \tn{directlua}: when
-%     \LuaTeX{} is in use two expansions are required to yield the
-%     result of the \Lua{} code.
+%     \cs{lua_now_x:n} is the primitive \tn{directlua}, and thus
+%     acts in one expansion.
 %   \end{texnote}
 % \end{function}
 %
@@ -103,7 +103,8 @@
 %   \end{texnote}
 % \end{function}
 %
-% \begin{function}[EXP, added = 2015-06-29]{\lua_escape_x:n, \lua_escape:n}
+% \begin{function}[EXP, added = 2015-06-29, updated = 2018-04-19]
+%   {\lua_escape_x:n, \lua_escape:n}
 %   \begin{syntax}
 %     \cs{lua_escape:n} \Arg{token list}
 %   \end{syntax}
@@ -117,9 +118,8 @@
 %   by \TeX{} in an \texttt{x}-type manner \emph{but} the function remains
 %   fully expandable.
 %   \begin{texnote}
-%     \cs{lua_escape_x:n} is a macro wrapper around \tn{luaescapestring}:
-%     when \LuaTeX{} is in use two expansions are required to yield the
-%     result of the \Lua{} code.
+%     \cs{lua_escape_x:n} is the primitive \tn{luaescapestring}, and thus
+%     acts in one expansion.
 %   \end{texnote}
 % \end{function}
 %
@@ -193,35 +193,17 @@
 %<@@=luatex>
 %    \end{macrocode}
 %
-% \begin{macro}[EXP]{\@@_escape_x:n, \@@_now_x:n, \@@_shipout_x:n}
-%   Copies of primitives.
-%    \begin{macrocode}
-\cs_new_eq:NN \@@_escape_x:n  \luatex_luaescapestring:D
-\cs_new_eq:NN \@@_now_x:n     \luatex_directlua:D
-\cs_new_eq:NN \@@_shipout_x:n \luatex_latelua:D
-%    \end{macrocode}
-% \end{macro}
-%
-% These functions are set up in \pkg{l3str} for bootstrapping: we want to
-% replace them with a \enquote{proper} version at this stage, so clean up.
-%    \begin{macrocode}
-\cs_undefine:N \lua_escape_x:n
-\cs_undefine:N \lua_now_x:n
-%    \end{macrocode}
-%
 % \begin{macro}[EXP]{\lua_now_x:n, \lua_now:n}
 % \begin{macro}{\lua_shipout_x:n, \lua_shipout:n}
 % \begin{macro}[EXP]{\lua_escape_x:n, \lua_escape:n}
-%   Wrappers around the primitives. As with engines other than \LuaTeX{}
-%   these have to be macros, we give them the same status in all cases.
-%   When \LuaTeX{} is not in use, simply give an error message/
+%   Primitives or equivalent wrappers. Note that \cs{lua_escape_x:n}
+%   and \cs{lua_now_x:n} are covered in \pkg{l3str} (for bootstrapping
+%   purposes).
 %    \begin{macrocode}
-\cs_new:Npn \lua_now_x:n #1 { \@@_now_x:n {#1} }
+\cs_new_eq:NN \lua_shipout_x:n \luatex_latelua:D
 \cs_new:Npn \lua_now:n #1   { \lua_now_x:n { \exp_not:n {#1} } }
-\cs_new_protected:Npn \lua_shipout_x:n #1 { \@@_shiphout_x:n {#1} }
 \cs_new_protected:Npn \lua_shipout:n #1
   { \lua_shipout_x:n { \exp_not:n {#1} } }
-\cs_new:Npn \lua_escape_x:n #1 { \@@_escape_x:n {#1} }
 \cs_new:Npn \lua_escape:n #1 { \lua_escape_x:n { \exp_not:n {#1} } }
 \sys_if_engine_luatex:F
   {
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index c1e969a..a307e1f 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -1039,8 +1039,8 @@
 \cs_new:Npn \@@_if_eq_x:nn #1#2 { \pdftex_strcmp:D {#1} {#2} }
 \cs_if_exist:NT \luatex_luatexversion:D
    {
-     \cs_set_eq:NN \lua_escape_x:n \luatex_luaescapestring:D
-     \cs_set_eq:NN \lua_now_x:n    \luatex_directlua:D
+     \cs_new_eq:NN \lua_escape_x:n \luatex_luaescapestring:D
+     \cs_new_eq:NN \lua_now_x:n    \luatex_directlua:D
      \cs_set:Npn \@@_if_eq_x:nn #1#2
        {
           \lua_now_x:n
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 58ed2ae..2886c24 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -717,6 +717,8 @@ Defining \str_if_empty:cT on line ...
 Defining \str_if_empty:cF on line ...
 Defining \str_if_empty:cTF on line ...
 Defining \__str_if_eq_x:nn on line ...
+Defining \lua_escape_x:n on line ...
+Defining \lua_now_x:n on line ...
 Defining \__str_escape_x:n on line ...
 Defining \str_if_eq_p:nn on line ...
 Defining \str_if_eq:nnT on line ...
@@ -5243,14 +5245,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index fc04083..2c49ba0 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5499,14 +5499,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 2006e41..c122d31 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5499,14 +5499,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index c4e1a29..56344e8 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5497,14 +5497,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index fc9f4d9..5dd6242 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5217,14 +5217,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 58ed2ae..2886c24 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -717,6 +717,8 @@ Defining \str_if_empty:cT on line ...
 Defining \str_if_empty:cF on line ...
 Defining \str_if_empty:cTF on line ...
 Defining \__str_if_eq_x:nn on line ...
+Defining \lua_escape_x:n on line ...
+Defining \lua_now_x:n on line ...
 Defining \__str_escape_x:n on line ...
 Defining \str_if_eq_p:nn on line ...
 Defining \str_if_eq:nnT on line ...
@@ -5243,14 +5245,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index fc04083..2c49ba0 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5499,14 +5499,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 2006e41..c122d31 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5499,14 +5499,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index c4e1a29..56344e8 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5497,14 +5497,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index fc9f4d9..5dd6242 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5217,14 +5217,9 @@ Defining \sys_if_output_pdf:F on line ...
 Defining \sys_if_output_pdf:TF on line ...
 Defining \sys_if_output_pdf_p: on line ...
 Defining \c_sys_output_str on line ...
-Defining \__luatex_escape_x:n on line ...
-Defining \__luatex_now_x:n on line ...
-Defining \__luatex_shipout_x:n on line ...
-Defining \lua_now_x:n on line ...
-Defining \lua_now:n on line ...
 Defining \lua_shipout_x:n on line ...
+Defining \lua_now:n on line ...
 Defining \lua_shipout:n on line ...
-Defining \lua_escape_x:n on line ...
 Defining \lua_escape:n on line ...
 Defining message LaTeX/kernel/luatex-required on line ...
 Defining \g__char_data_ior on line ...





More information about the latex3-commits mailing list