[latex3-commits] [git/LaTeX3-latex3-latex3] master: Avoid Lua-related :D internals (7e86f25)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Apr 13 16:40:52 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/7e86f25f75c7171e8ce57a1395a00e8ebfa3b4fa
>---------------------------------------------------------------
commit 7e86f25f75c7171e8ce57a1395a00e8ebfa3b4fa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Apr 13 15:40:52 2018 +0100
Avoid Lua-related :D internals
In particular, the string comparison auxiliary should use
\lua_now_x:n etc.
>---------------------------------------------------------------
7e86f25f75c7171e8ce57a1395a00e8ebfa3b4fa
l3kernel/l3luatex.dtx | 46 ++++++++++++++++++++++++++++---
l3kernel/l3str.dtx | 12 ++++----
l3kernel/testfiles/m3expl001.luatex.tlg | 5 ++++
l3kernel/testfiles/m3expl001.ptex.tlg | 5 ++++
l3kernel/testfiles/m3expl001.tlg | 5 ++++
l3kernel/testfiles/m3expl001.uptex.tlg | 5 ++++
l3kernel/testfiles/m3expl001.xetex.tlg | 5 ++++
l3kernel/testfiles/m3expl003.luatex.tlg | 5 ++++
l3kernel/testfiles/m3expl003.ptex.tlg | 5 ++++
l3kernel/testfiles/m3expl003.tlg | 5 ++++
l3kernel/testfiles/m3expl003.uptex.tlg | 5 ++++
l3kernel/testfiles/m3expl003.xetex.tlg | 5 ++++
12 files changed, 98 insertions(+), 10 deletions(-)
diff --git a/l3kernel/l3luatex.dtx b/l3kernel/l3luatex.dtx
index 07907ea..702d822 100644
--- a/l3kernel/l3luatex.dtx
+++ b/l3kernel/l3luatex.dtx
@@ -103,6 +103,19 @@
% \end{texnote}
% \end{function}
%
+% \begin{function}[EXP, added = 2018-04-13]{\lua_exp_x:n}
+% \begin{syntax}
+% \cs{lua_exp_x:n} \Arg{token list}
+% \end{syntax}
+% Fully expands the \meta{token list} an \texttt{x}-type manner \emph{but} the
+% function remains fully expandable.
+% \begin{texnote}
+% \cs{lua_exp_x:n} is a macro wrapper around \tn{expanded}:
+% when \LuaTeX{} is in use two expansions are required to yield the
+% result.
+% \end{texnote}
+% \end{function}
+%
% \begin{function}[EXP, added = 2015-06-29]{\lua_escape_x:n, \lua_escape:n}
% \begin{syntax}
% \cs{lua_escape:n} \Arg{token list}
@@ -189,24 +202,48 @@
%<*tex>
% \end{macrocode}
%
+% \begin{macro}[EXP]{\@@_exp_x:n, \@@_escape_x:n, \@@_now_x:n, \@@_shipout_x:n}
+% Copies of primitives.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_exp_x:n \luatex_expanded:D
+\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_exp_x:n
+\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_exp_x: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/
% \begin{macrocode}
-\cs_new:Npn \lua_now_x:n #1 { \luatex_directlua:D {#1} }
+\cs_new:Npn \lua_now_x:n #1 { \@@_now_x:n {#1} }
\cs_new:Npn \lua_now:n #1 { \lua_now_x:n { \exp_not:n {#1} } }
-\cs_new_protected:Npn \lua_shipout_x:n #1 { \luatex_latelua:D {#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 { \luatex_luaescapestring:D {#1} }
+\cs_new:Npn \lua_exp_x:n #1 { \@@_exp_x: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
{
\clist_map_inline:nn
- { \lua_now_x:n , \lua_now:n , \lua_escape_x:n , \lua_escape:n }
+ {
+ \lua_exp_x:n ,
+ \lua_escape_x:n , \lua_escape:n ,
+ \lua_now_x:n , \lua_now:n
+ }
{
\cs_set:Npn #1 ##1
{
@@ -228,6 +265,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Messages}
%
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index e7989e8..9e4138d 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -1039,9 +1039,12 @@
\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_exp_x:n \luatex_expanded:D
+ \cs_set_eq:NN \lua_escape_x:n \luatex_luaescapestring:D
+ \cs_set_eq:NN \lua_now_x:n \luatex_directlua:D
\cs_set:Npn \@@_if_eq_x:nn #1#2
{
- \luatex_directlua:D
+ \lua_now_x:n
{
l3kernel.strcmp
(
@@ -1052,11 +1055,8 @@
}
\cs_new:Npn \@@_escape_x:n #1
{
- \luatex_luaescapestring:D
- {
- \__kernel_tl_to_str:w \exp_after:wN
- { \luatex_expanded:D {#1} }
- }
+ \lua_escape_x:n
+ { \__kernel_tl_to_str:w \lua_exp_x:n { {#1 } } }
}
}
% \end{macrocode}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 07d4f43..5cee75c 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5244,10 +5244,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 8579d73..0b708ac 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5500,10 +5500,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index ef9f9d6..9ae50ad 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5500,10 +5500,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 867c0ff..dfd4c89 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5498,10 +5498,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 5012194..daa1243 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5217,10 +5217,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 07d4f43..5cee75c 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5244,10 +5244,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 8579d73..0b708ac 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5500,10 +5500,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index ef9f9d6..9ae50ad 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5500,10 +5500,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 867c0ff..dfd4c89 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5498,10 +5498,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 5012194..daa1243 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5217,10 +5217,15 @@ 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 \__coffin_exp_x:n on line ...
+Defining \__coffin_escape_x:n on line ...
+Defining \__coffin_now_x:n on line ...
+Defining \__coffin_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_shipout:n on line ...
+Defining \lua_exp_x:n on line ...
Defining \lua_escape_x:n on line ...
Defining \lua_escape:n on line ...
Defining message LaTeX/kernel/luatex-required on line ...
More information about the latex3-commits
mailing list