[latex3-commits] [l3svn] 04/05: Switch to new \sys_if_engine... functions
noreply at latex-project.org
noreply at latex-project.org
Tue Sep 8 08:22:58 CEST 2015
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit d230e78d099aaeebc32d78c98d332eb4fae30d88
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Sep 7 22:55:38 2015 +0100
Switch to new \sys_if_engine... functions
These are all strictly one-engine tests so at present there are
a few places we have to look for XeTeX/LuaTeX as a pair.
---
l3experimental/l3sort/l3sort.dtx | 2 +-
l3experimental/l3str/l3str-convert.dtx | 108 ++++++++++++++++-----------
l3kernel/expl3.dtx | 12 +--
l3kernel/l3luatex.dtx | 4 +-
l3kernel/l3unicode-data.def | 6 +-
l3kernel/l3unicode-data.dtx | 6 +-
l3trial/l3benchmark/l3benchmark.dtx | 22 +++---
l3trial/l3kernel-extras/l3kernel-extras.dtx | 4 +-
l3trial/xfont/l3font.dtx | 4 +-
9 files changed, 100 insertions(+), 68 deletions(-)
diff --git a/l3experimental/l3sort/l3sort.dtx b/l3experimental/l3sort/l3sort.dtx
index f8f752f..0138ae6 100644
--- a/l3experimental/l3sort/l3sort.dtx
+++ b/l3experimental/l3sort/l3sort.dtx
@@ -199,7 +199,7 @@
% registers, totalling $2^{N-1}+2^{N-2}+2^{N-2}=2^{N}$ registers.
% \begin{macrocode}
\int_const:Nn \c_@@_max_length_int
- { \luatex_if_engine:TF { 49152 } { 24576 } }
+ { \sys_if_engine_luatex:TF { 49152 } { 24576 } }
% \end{macrocode}
% \end{variable}
%
diff --git a/l3experimental/l3str/l3str-convert.dtx b/l3experimental/l3str/l3str-convert.dtx
index 08816c9..8a2bab6 100644
--- a/l3experimental/l3str/l3str-convert.dtx
+++ b/l3experimental/l3str/l3str-convert.dtx
@@ -318,7 +318,15 @@
% $1114111$ for other engines.
% \begin{macrocode}
\int_const:Nn \c_max_char_int
- { \pdftex_if_engine:TF { "FF } { "10FFFF } }
+ {
+ \bool_if:nTF
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p
+ }
+ { "10FFFF }
+ { "FF }
+ }
% \end{macrocode}
% \end{variable}
%
@@ -1033,13 +1041,16 @@
%
% \begin{macro}[int, rEXP]{\@@_filter_bytes:n}
% \begin{macro}[aux, rEXP]{\@@_filter_bytes_aux:N}
-% In the case of pdf\TeX{}, every character is a byte. For
+% In the case of 8-bit engines, every character is a byte. For
% Unicode-aware engines, test the character code; non-bytes cause us
% to raise the flag \texttt{str_byte}. Spaces have already been given
% the correct category code when this function is called.
% \begin{macrocode}
-\pdftex_if_engine:TF
- { \cs_new_eq:NN \@@_filter_bytes:n \use:n }
+\bool_if:nTF
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p
+ }
{
\cs_new:Npn \@@_filter_bytes:n #1
{
@@ -1058,6 +1069,7 @@
\@@_filter_bytes_aux:N
}
}
+ { \cs_new_eq:NN \@@_filter_bytes:n \use:n }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1067,8 +1079,11 @@
% The simplest unescaping method removes non-bytes from
% \cs{g_@@_result_tl}.
% \begin{macrocode}
-\pdftex_if_engine:TF
- { \cs_new_protected_nopar:Npn \@@_convert_unescape_: { } }
+\bool_if:nTF
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p
+ }
{
\cs_new_protected_nopar:Npn \@@_convert_unescape_:
{
@@ -1078,6 +1093,7 @@
\@@_if_flag_error:nnx { str_byte } { non-byte } { bytes }
}
}
+ { \cs_new_protected_nopar:Npn \@@_convert_unescape_: { } }
\cs_new_eq:NN \@@_convert_unescape_bytes: \@@_convert_unescape_:
% \end{macrocode}
% \end{macro}
@@ -1116,42 +1132,12 @@
% \begin{macrocode}
\group_begin:
\char_set_catcode_other:n { 0 }
- \pdftex_if_engine:TF
-% \end{macrocode}
-% \begin{macro}[aux, EXP]{\@@_encode_native_char:n}
-% Since pdf\TeX{} only supports 8-bit characters, and we have a table
-% of all bytes, the conversion can be done in linear time within an
-% \texttt{x}-expanding assignment. Look out for character codes larger
-% than $255$, those characters are replaced by |?|, and raise a flag,
-% which then triggers a pdf\TeX{}-specific error.
-% \begin{macrocode}
+ \bool_if:nTF
{
- \cs_new_protected_nopar:Npn \@@_convert_encode_:
- {
- \flag_clear:n { str_error }
- \@@_convert_gmap_internal:N \@@_encode_native_char:n
- \@@_if_flag_error:nnx { str_error }
- { pdfTeX-native-overflow } { }
- }
- \cs_new:Npn \@@_encode_native_char:n #1
- {
- \if_int_compare:w #1 < \c_two_hundred_fifty_six
- \@@_output_byte:n {#1}
- \else:
- \flag_raise:n { str_error }
- ?
- \fi:
- }
- \__msg_kernel_new:nnnn { str } { pdfTeX-native-overflow }
- { Character~code~too~large~for~pdfTeX. }
- {
- The~pdfTeX~engine~only~supports~8-bit~characters:~
- valid~character~codes~are~in~the~range~[0,255].~
- To~manipulate~arbitrary~Unicode,~use~LuaTeX~or~XeTeX.
- }
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p
}
% \end{macrocode}
-% \end{macro}
% \begin{macro}[aux]{\@@_encode_native_loop:w}
% \begin{macro}[aux]{\@@_encode_native_flush:}
% \begin{macro}[aux, rEXP]{\@@_encode_native_filter:N}
@@ -1186,6 +1172,40 @@
}
}
% \end{macrocode}
+% \begin{macro}[aux, EXP]{\@@_encode_native_char:n}
+% Since pdf\TeX{} only supports 8-bit characters, and we have a table
+% of all bytes, the conversion can be done in linear time within an
+% \texttt{x}-expanding assignment. Look out for character codes larger
+% than $255$, those characters are replaced by |?|, and raise a flag,
+% which then triggers a pdf\TeX{}-specific error.
+% \begin{macrocode}
+ {
+ \cs_new_protected_nopar:Npn \@@_convert_encode_:
+ {
+ \flag_clear:n { str_error }
+ \@@_convert_gmap_internal:N \@@_encode_native_char:n
+ \@@_if_flag_error:nnx { str_error }
+ { pdfTeX-native-overflow } { }
+ }
+ \cs_new:Npn \@@_encode_native_char:n #1
+ {
+ \if_int_compare:w #1 < \c_two_hundred_fifty_six
+ \@@_output_byte:n {#1}
+ \else:
+ \flag_raise:n { str_error }
+ ?
+ \fi:
+ }
+ \__msg_kernel_new:nnnn { str } { pdfTeX-native-overflow }
+ { Character~code~too~large~for~pdfTeX. }
+ {
+ The~pdfTeX~engine~only~supports~8-bit~characters:~
+ valid~character~codes~are~in~the~range~[0,255].~
+ To~manipulate~arbitrary~Unicode,~use~LuaTeX~or~XeTeX.
+ }
+ }
+% \end{macrocode}
+% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -1423,11 +1443,15 @@
%
% Message used when the \enquote{bytes} unescaping fails because the
% string given to \cs{str_set_convert:Nnnn} contains a non-byte. This
-% cannot happen for the pdf\TeX{} engine, since that engine only
-% supports 8-bit characters. Messages used for other escapings and
+% cannot happen for the -8-bit engines.
+% Messages used for other escapings and
% encodings are defined in each definition file.
% \begin{macrocode}
-\pdftex_if_engine:F
+\bool_if:nT
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p
+ }
{
\__msg_kernel_new:nnnn { str } { non-byte }
{ String~invalid~in~escaping~'#1':~it~may~only~contain~bytes. }
diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index 69518ad..dd34574 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1323,7 +1323,7 @@
{
\tl_set:Nx \l__expl_driver_tl
{
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{ xdvipdfmx }
{
\__expl_if_pdf:TF
@@ -1335,7 +1335,7 @@
driver / dvipdfmx .code:n =
{
\tl_set:Nn \l__expl_driver_tl { dvipdfmx }
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{
\__msg_kernel_error:nnnn { expl } { wrong-driver }
{ dvipdfmx } { xdvipdfmx }
@@ -1353,7 +1353,7 @@
driver / dvips .code:n =
{
\tl_set:Nn \l__expl_driver_tl { dvips }
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{
\__msg_kernel_error:nnnn { expl } { wrong-driver }
{ dvips } { xdvipdfmx }
@@ -1373,7 +1373,7 @@
driver / pdfmode .code:n =
{
\tl_set:Nn \l__expl_driver_tl { pdfmode }
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{
\__msg_kernel_error:nnnn { expl } { wrong-driver }
{ pdfmode } { xdvipdfmx }
@@ -1391,7 +1391,7 @@
driver / xdvipdfmx .code:n =
{
\tl_set:Nn \l__expl_driver_tl { xdvipdfmx }
- \xetex_if_engine:F
+ \sys_if_engine_xetex:F
{
\__expl_if_pdf:TF
{
@@ -1735,7 +1735,7 @@
}
\tex_input:D
l3
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{ xdvipdfmx }
{
\bool_if:nTF
diff --git a/l3kernel/l3luatex.dtx b/l3kernel/l3luatex.dtx
index 89509b6..5394758 100644
--- a/l3kernel/l3luatex.dtx
+++ b/l3kernel/l3luatex.dtx
@@ -74,7 +74,7 @@
% and with it access to the \enquote{internals} of \TeX{}. In order to use
% this within the framework provided here, a family of functions is
% available. When used with \pdfTeX{} or \XeTeX{} these will raise an
-% error: use \cs{luatex_if_engine:T} to avoid this. Details of coding
+% error: use \cs{sys_if_engine_luatex:T} to avoid this. Details of coding
% the \LuaTeX{} engine are detailed in the \LuaTeX{} manual.
%
% \begin{function}[EXP, added = 2015-06-29]{\lua_now_x:n, \lua_now:n}
@@ -168,7 +168,7 @@
{ \lua_shipout_x:n { \exp_not:n {#1} } }
\cs_new:Npn \lua_escape_x:n #1 { \luatex_luaescapestring:D {#1} }
\cs_new:Npn \lua_escape:n #1 { \lua_escape_x:n { \exp_not:n {#1} } }
-\luatex_if_engine:F
+\sys_if_engine_luatex:F
{
\clist_map_inline:nn
{ \lua_now_x:n , \lua_now:n , \lua_escape_x:n , \lua_escape:n }
diff --git a/l3kernel/l3unicode-data.def b/l3kernel/l3unicode-data.def
index 399ad3d..a08bc0f 100644
--- a/l3kernel/l3unicode-data.def
+++ b/l3kernel/l3unicode-data.def
@@ -12,7 +12,11 @@
%% Generated on 2015-07-20.
%%
\ProvidesExplFile {l3unicode-data.def} {2015/07/20} {5676} {L3 Unicode data}
-\pdftex_if_engine:T
+\bool_if:nF
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p:
+ }
{
\group_begin:
\cs_set_protected:Npn \__unicode_tmp:NN #1#2
diff --git a/l3kernel/l3unicode-data.dtx b/l3kernel/l3unicode-data.dtx
index 6a0827e..79959c4 100644
--- a/l3kernel/l3unicode-data.dtx
+++ b/l3kernel/l3unicode-data.dtx
@@ -407,7 +407,11 @@
% range), no-op data is included (as the \emph{output} would be out-of-range).
% \begin{macrocode}
\__unicode_verb:
-\pdftex_if_engine:T
+\bool_if:nF
+ {
+ \sys_if_engine_luatex_p: ||
+ \sys_if_engine_xetex_p:
+ }
{
\group_begin:
\cs_set_protected:Npn \__unicode_tmp:NN #1#2
diff --git a/l3trial/l3benchmark/l3benchmark.dtx b/l3trial/l3benchmark/l3benchmark.dtx
index 95caad5..765aea0 100644
--- a/l3trial/l3benchmark/l3benchmark.dtx
+++ b/l3trial/l3benchmark/l3benchmark.dtx
@@ -140,7 +140,7 @@
% Load Heiko's \pkg{pdftexcmds} to get \tn{pdf at elapsedtime} and
% \tn{pdf at resettimer}.
% \begin{macrocode}
-\luatex_if_engine:T { \RequirePackage{pdftexcmds} \scan_stop: }
+\sys_if_engine_luatex:T { \RequirePackage{pdftexcmds} \scan_stop: }
% \end{macrocode}
%
% \begin{variable}{\l_benchmark_time_fail_bool}
@@ -151,7 +151,7 @@
% read.
% \begin{macrocode}
\bool_new:N \l_benchmark_time_fail_bool
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\cs_if_exist:NTF \shellescape
{
@@ -211,9 +211,9 @@
% \LuaTeX{}, rescale the value of \tn{pdfelapsedtime} or
% \tn{pdf at elapsedtime}.
% \begin{macrocode}
-\xetex_if_engine:F
+\sys_if_engine_xetex:F
{
- \pdftex_if_engine:TF
+ \sys_if_engine_pdftex:TF
{
\cs_new_protected:Npn \clock_get:N #1
{ \tl_set:Nx #1 { \fp_to_decimal:n { \pdfelapsedtime / 65536 } } }
@@ -233,9 +233,9 @@
% We postpone the definition for \XeTeX{}. For \pdfTeX{} and
% \LuaTeX{}, call \tn{pdfresettimer} or \tn{pdf at resettimer}.
% \begin{macrocode}
-\xetex_if_engine:F
+\sys_if_engine_xetex:F
{
- \pdftex_if_engine:TF
+ \sys_if_engine_pdftex:TF
{ \cs_new_protected_nopar:Npn \clock_zero: { \pdfresettimer } }
{ \cs_new_protected_nopar:Npn \clock_zero: { \pdf at resettimer } }
}
@@ -247,7 +247,7 @@
% \begin{variable}{\c_@@_lua_file_tl, \c_@@_time_file_tl}
% File names.
% \begin{macrocode}
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\tl_const:Nx \c_@@_lua_file_tl { \c_job_name_tl . lua }
\tl_const:Nx \c_@@_time_file_tl { \c_job_name_tl . timestamp }
@@ -258,7 +258,7 @@
% \begin{variable}{\l_@@_iow}
% Write the \Lua{} file.
% \begin{macrocode}
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\iow_new:N \l_@@_iow
\iow_open:Nn \l_@@_iow { \c_@@_lua_file_tl }
@@ -285,7 +285,7 @@
% \cs{l_@@_tl}. Then assign it globally to the floating point
% |#1|.
% \begin{macrocode}
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\ior_new:N \l_@@_ior
\tl_new:N \l_@@_tl
@@ -309,7 +309,7 @@
% Resetting the timer amounts to changing the \enquote{base time},
% used as an offset when reporting the time in \cs{_@@_get:N}.
% \begin{macrocode}
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\fp_new:N \g_@@_base_fp
\cs_new_protected_nopar:Npn \clock_zero:
@@ -324,7 +324,7 @@
% Get the current clock time, then compute the difference with the
% base time.
% \begin{macrocode}
-\xetex_if_engine:T
+\sys_if_engine_xetex:T
{
\fp_new:N \g_@@_fp
\cs_new_protected:Npn \clock_get:N #1
diff --git a/l3trial/l3kernel-extras/l3kernel-extras.dtx b/l3trial/l3kernel-extras/l3kernel-extras.dtx
index 0b101cf..5c080ad 100644
--- a/l3trial/l3kernel-extras/l3kernel-extras.dtx
+++ b/l3trial/l3kernel-extras/l3kernel-extras.dtx
@@ -741,7 +741,7 @@
% \cs{iow_newline:} within the argument of \cs{luatex_luaescapestring:D}
% if wanted.
% \begin{macrocode}
-\luatex_if_engine:T
+\sys_if_engine_luatex:T
{
\cs_gset:Npn \__msg_expandable_warning:n #1
{
@@ -763,7 +763,7 @@
% could even include an error text (|tex.error| can take a second
% argument, which is a table of strings, for the help text).
% \begin{macrocode}
-\luatex_if_engine:T
+\sys_if_engine_luatex:T
{
\cs_gset:Npx \__msg_expandable_error:n #1
{
diff --git a/l3trial/xfont/l3font.dtx b/l3trial/xfont/l3font.dtx
index 5c18c9d..22d7c26 100644
--- a/l3trial/xfont/l3font.dtx
+++ b/l3trial/xfont/l3font.dtx
@@ -434,7 +434,7 @@
% The name of the integer parameter to control differs between \XeTeX{}
% and \LuaTeX{}. In \pdfTeX{}, the functions produce an error message.
% \begin{macrocode}
-\luatex_if_engine:TF
+\sys_if_engine_luatex:TF
{
\cs_new_protected:Npn \font_suppress_not_found_error:
{ \luatexsuppressfontnotfounderror = \c_one }
@@ -442,7 +442,7 @@
{ \luatexsuppressfontnotfounderror = \c_zero }
}
{
- \xetex_if_engine:TF
+ \sys_if_engine_xetex:TF
{
\cs_new_protected:Npn \font_suppress_not_found_error:
{ \suppressfontnotfounderror = \c_one }
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list