[latex3-commits] [git/LaTeX3-latex3-latex3] master: Condense \sys_if_shell code (ce1d9fe)

Bruno Le Floch bruno at le-floch.fr
Fri Apr 27 21:22:03 CEST 2018


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

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

commit ce1d9fe9e02f4d4e2d27ad55330d078d2d1f7572
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Fri Apr 27 15:22:03 2018 -0400

    Condense \sys_if_shell code


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

ce1d9fe9e02f4d4e2d27ad55330d078d2d1f7572
 l3kernel/l3candidates.dtx               |   58 +++++++------------------------
 l3kernel/testfiles/m3expl001.luatex.tlg |    6 ++--
 l3kernel/testfiles/m3expl001.ptex.tlg   |    6 ++--
 l3kernel/testfiles/m3expl001.tlg        |    6 ++--
 l3kernel/testfiles/m3expl001.uptex.tlg  |    6 ++--
 l3kernel/testfiles/m3expl001.xetex.tlg  |    6 ++--
 l3kernel/testfiles/m3expl003.luatex.tlg |    6 ++--
 l3kernel/testfiles/m3expl003.ptex.tlg   |    6 ++--
 l3kernel/testfiles/m3expl003.tlg        |    6 ++--
 l3kernel/testfiles/m3expl003.uptex.tlg  |    6 ++--
 l3kernel/testfiles/m3expl003.xetex.tlg  |    6 ++--
 11 files changed, 42 insertions(+), 76 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 0fd326d..818965c 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -2490,52 +2490,18 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}[EXP, pTF]{\sys_if_shell:}
-%   Performs a check for whether shell escape is enabled.  This
-%   returns true if either of restricted or unrestricted shell escape
-%   is enabled.
-%    \begin{macrocode}
-\prg_new_conditional:Nnn \sys_if_shell: { p , T , F , TF }
-  {
-    \if_int_compare:w \c_sys_shell_escape_int = 0 ~
-      \prg_return_false:
-    \else:
-      \prg_return_true:
-    \fi:
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP, pTF]{\sys_if_shell_unrestricted:}
-%   Performs a check for whether \emph{unrestricted} shell escape is
-%   enabled.
-%    \begin{macrocode}
-\prg_new_conditional:Nnn \sys_if_shell_unrestricted: { p , T , F , TF }
-  {
-    \if_int_compare:w \c_sys_shell_escape_int = 1 ~
-      \prg_return_true:
-    \else:
-      \prg_return_false:
-    \fi:
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP, pTF]{\sys_if_shell_restricted:}
-%   Performs a check for whether \emph{restricted} shell escape is
-%   enabled.  This returns false if unrestricted shell escape is
-%   enabled.  Unrestricted shell escape is not considered a superset
-%   of restricted shell escape in this case.  To find whether any
-%   shell escape is enabled use \cs{sys_if_shell:}.
-%    \begin{macrocode}
-\prg_new_conditional:Nnn \sys_if_shell_restricted: { p , T , F , TF }
-  {
-    \if_int_compare:w \c_sys_shell_escape_int = 2 \exp_stop_f:
-      \prg_return_true:
-    \else:
-      \prg_return_false:
-    \fi:
-  }
+% \begin{macro}[EXP, pTF]{\sys_if_shell:, \sys_if_shell_unrestricted:, \sys_if_shell_restricted:}
+%   Performs a check for whether shell escape is enabled.  The first set
+%   of functions returns true if either of restricted or unrestricted
+%   shell escape is enabled, while the other two sets of functions
+%   return true in only one of these two cases.
+%    \begin{macrocode}
+\@@_const:nn { sys_if_shell }
+  { \int_compare_p:nNn \c_sys_shell_escape_int > 0 }
+\@@_const:nn { sys_if_shell_unrestricted }
+  { \int_compare_p:nNn \c_sys_shell_escape_int = 1 }
+\@@_const:nn { sys_if_shell_restricted }
+  { \int_compare_p:nNn \c_sys_shell_escape_int = 2 }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index eaa3fb2..ad3594c 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5724,18 +5724,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
 Defining \sys_shell_shipout:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 7891577..b41a8ae 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5717,18 +5717,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 9c4052a..c8830aa 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5717,18 +5717,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 33b9901..89e01d7 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5715,18 +5715,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 91848c2..59143e1 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5698,18 +5698,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index eaa3fb2..ad3594c 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5724,18 +5724,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
 Defining \sys_shell_shipout:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 7891577..b41a8ae 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5717,18 +5717,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 9c4052a..c8830aa 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5717,18 +5717,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 33b9901..89e01d7 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5715,18 +5715,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 91848c2..59143e1 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5698,18 +5698,18 @@ Defining \sys_if_rand_exist_p: on line ...
 Defining \sys_rand_seed: on line ...
 Defining \sys_gset_rand_seed:n on line ...
 Defining \c_sys_shell_escape_int on line ...
-Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell:T on line ...
 Defining \sys_if_shell:F on line ...
 Defining \sys_if_shell:TF on line ...
-Defining \sys_if_shell_unrestricted_p: on line ...
+Defining \sys_if_shell_p: on line ...
 Defining \sys_if_shell_unrestricted:T on line ...
 Defining \sys_if_shell_unrestricted:F on line ...
 Defining \sys_if_shell_unrestricted:TF on line ...
-Defining \sys_if_shell_restricted_p: on line ...
+Defining \sys_if_shell_unrestricted_p: on line ...
 Defining \sys_if_shell_restricted:T on line ...
 Defining \sys_if_shell_restricted:F on line ...
 Defining \sys_if_shell_restricted:TF on line ...
+Defining \sys_if_shell_restricted_p: on line ...
 Defining \c__sys_shell_stream_int on line ...
 Defining \sys_shell_now:n on line ...
 Defining \sys_shell_now:x on line ...





More information about the latex3-commits mailing list