summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-27 21:53:40 +0000
committerKarl Berry <karl@freefriends.org>2019-03-27 21:53:40 +0000
commitf163f9fe30ea30e94aac851cc8ecac09eeec84d0 (patch)
tree1bedbdc1b29e9ea9d69058ba3b4e66b9197cc0e1 /Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
parentfdf72eb7326451df89152180380aeea978386658 (diff)
l3kernel (27mar19)
git-svn-id: svn://tug.org/texlive/trunk@50620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3sys.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sys.dtx92
1 files changed, 58 insertions, 34 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
index b2000f8f1b7..19ff9708ab0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-03-05}
+% \date{Released 2019-03-26}
%
% \maketitle
%
@@ -160,39 +160,6 @@
% \end{macrocode}
% \end{variable}
%
-% \subsection{Time and date}
-%
-% \begin{variable}
-% {
-% \c_sys_minute_int,
-% \c_sys_hour_int,
-% \c_sys_day_int,
-% \c_sys_month_int,
-% \c_sys_year_int,
-% }
-% Copies of the information provided by \TeX{}.
-% \begin{macrocode}
-%<*initex>
-\int_const:Nn \c_sys_minute_int
- { \int_mod:nn { \tex_time:D } { 60 } }
-\int_const:Nn \c_sys_hour_int
- { \int_div_truncate:nn { \tex_time:D } { 60 } }
-\int_const:Nn \c_sys_day_int { \tex_day:D }
-\int_const:Nn \c_sys_month_int { \tex_month:D }
-\int_const:Nn \c_sys_year_int { \tex_year:D }
-%</initex>
-%<*package>
-\int_const:Nn \c_sys_minute_int
- { \int_mod:nn { \tex_primitive:D \time } { 60 } }
-\int_const:Nn \c_sys_hour_int
- { \int_div_truncate:nn { \tex_primitive:D \time } { 60 } }
-\int_const:Nn \c_sys_day_int { \tex_primitive:D \day }
-\int_const:Nn \c_sys_month_int { \tex_primitive:D \month }
-\int_const:Nn \c_sys_year_int { \tex_primitive:D \year }
-%</package>
-% \end{macrocode}
-% \end{variable}
-%
% \subsection{Detecting the engine}
%
% \begin{macro}{\@@_const:nn}
@@ -256,6 +223,63 @@
% \end{variable}
% \end{macro}
%
+% \subsection{Time and date}
+%
+% \begin{variable}
+% {
+% \c_sys_minute_int,
+% \c_sys_hour_int,
+% \c_sys_day_int,
+% \c_sys_month_int,
+% \c_sys_year_int,
+% }
+% Copies of the information provided by \TeX{}. There is a lot of defensive
+% code in package mode: someone may have moved the primitives, and they can
+% only be recovered if we have \tn{primitive} and it is working correctly.
+% \begin{macrocode}
+%<*initex>
+\int_const:Nn \c_sys_minute_int
+ { \int_mod:nn { \tex_time:D } { 60 } }
+\int_const:Nn \c_sys_hour_int
+ { \int_div_truncate:nn { \tex_time:D } { 60 } }
+\int_const:Nn \c_sys_day_int { \tex_day:D }
+\int_const:Nn \c_sys_month_int { \tex_month:D }
+\int_const:Nn \c_sys_year_int { \tex_year:D }
+%</initex>
+%<*package>
+\group_begin:
+ \cs_set:Npn \@@_tmp:w #1
+ {
+ \str_if_eq:eeTF { \cs_meaning:N #1 } { \token_to_str:N #1 }
+ { #1 }
+ {
+ \cs_if_exist:NTF \tex_primitive:D
+ {
+ \bool_lazy_and:nnTF
+ { \sys_if_engine_xetex_p: }
+ {
+ \int_compare_p:nNn
+ { \exp_after:wN \use_none:n \tex_XeTeXrevision:D }
+ < { 99999 }
+ }
+ { 0 }
+ { \tex_primitive:D #1 }
+ }
+ { 0 }
+ }
+ }
+ \int_const:Nn \c_sys_minute_int
+ { \int_mod:nn { \@@_tmp:w \time } { 60 } }
+ \int_const:Nn \c_sys_hour_int
+ { \int_div_truncate:nn { \@@_tmp:w \time } { 60 } }
+ \int_const:Nn \c_sys_day_int { \@@_tmp:w \day }
+ \int_const:Nn \c_sys_month_int { \@@_tmp:w \month }
+ \int_const:Nn \c_sys_year_int { \@@_tmp:w \year }
+\group_end:
+%</package>
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Detecting the output}
%
% \begin{macro}[pTF, EXP]