From 87d871a3d83784d48b71fa3712b9f525bfc710d2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 23 Feb 2018 21:54:14 +0000 Subject: l3 (22feb18) git-svn-id: svn://tug.org/texlive/trunk@46720 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/l3kernel/expl3.dtx | 30 +- Master/texmf-dist/source/latex/l3kernel/l3.ins | 9 +- .../texmf-dist/source/latex/l3kernel/l3alloc.dtx | 4 +- .../texmf-dist/source/latex/l3kernel/l3basics.dtx | 460 +++++++------- .../source/latex/l3kernel/l3bootstrap.dtx | 8 +- Master/texmf-dist/source/latex/l3kernel/l3box.dtx | 68 +-- .../source/latex/l3kernel/l3candidates.dtx | 26 +- .../texmf-dist/source/latex/l3kernel/l3clist.dtx | 4 +- .../texmf-dist/source/latex/l3kernel/l3coffins.dtx | 16 +- .../source/latex/l3kernel/l3color-base.dtx | 199 ++++++ .../texmf-dist/source/latex/l3kernel/l3color.dtx | 169 ------ .../source/latex/l3kernel/l3deprecation.dtx | 27 +- Master/texmf-dist/source/latex/l3kernel/l3doc.dtx | 84 ++- .../source/latex/l3kernel/l3docstrip.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3drivers.dtx | 331 ++++------ .../texmf-dist/source/latex/l3kernel/l3expan.dtx | 29 +- Master/texmf-dist/source/latex/l3kernel/l3file.dtx | 59 +- .../texmf-dist/source/latex/l3kernel/l3final.dtx | 10 +- Master/texmf-dist/source/latex/l3kernel/l3flag.dtx | 18 +- .../texmf-dist/source/latex/l3kernel/l3format.ins | 8 +- .../source/latex/l3kernel/l3fp-assign.dtx | 2 +- .../texmf-dist/source/latex/l3kernel/l3fp-aux.dtx | 262 ++++++-- .../source/latex/l3kernel/l3fp-basics.dtx | 72 ++- .../source/latex/l3kernel/l3fp-convert.dtx | 163 ++++- .../texmf-dist/source/latex/l3kernel/l3fp-expo.dtx | 2 +- .../source/latex/l3kernel/l3fp-extended.dtx | 2 +- .../source/latex/l3kernel/l3fp-logic.dtx | 23 +- .../source/latex/l3kernel/l3fp-parse.dtx | 667 ++++++++++++++------- .../source/latex/l3kernel/l3fp-random.dtx | 32 +- .../source/latex/l3kernel/l3fp-round.dtx | 20 +- .../source/latex/l3kernel/l3fp-traps.dtx | 26 +- .../texmf-dist/source/latex/l3kernel/l3fp-trig.dtx | 54 +- Master/texmf-dist/source/latex/l3kernel/l3fp.dtx | 6 +- Master/texmf-dist/source/latex/l3kernel/l3int.dtx | 115 ++-- .../source/latex/l3kernel/l3intarray.dtx | 8 +- Master/texmf-dist/source/latex/l3kernel/l3keys.dtx | 58 +- .../texmf-dist/source/latex/l3kernel/l3luatex.dtx | 8 +- Master/texmf-dist/source/latex/l3kernel/l3msg.dtx | 380 ++++++------ .../texmf-dist/source/latex/l3kernel/l3names.dtx | 17 +- .../source/latex/l3kernel/l3oldmodules.dtx | 5 +- Master/texmf-dist/source/latex/l3kernel/l3prg.dtx | 18 +- Master/texmf-dist/source/latex/l3kernel/l3prop.dtx | 6 +- .../texmf-dist/source/latex/l3kernel/l3quark.dtx | 8 +- .../texmf-dist/source/latex/l3kernel/l3regex.dtx | 228 +++---- Master/texmf-dist/source/latex/l3kernel/l3seq.dtx | 8 +- Master/texmf-dist/source/latex/l3kernel/l3skip.dtx | 277 ++++++--- Master/texmf-dist/source/latex/l3kernel/l3sort.dtx | 24 +- Master/texmf-dist/source/latex/l3kernel/l3str.dtx | 10 +- Master/texmf-dist/source/latex/l3kernel/l3sys.dtx | 2 +- .../source/latex/l3kernel/l3tl-analysis.dtx | 4 +- .../source/latex/l3kernel/l3tl-build.dtx | 2 +- Master/texmf-dist/source/latex/l3kernel/l3tl.dtx | 84 +-- .../texmf-dist/source/latex/l3kernel/l3token.dtx | 21 +- 53 files changed, 2424 insertions(+), 1751 deletions(-) create mode 100644 Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx delete mode 100644 Master/texmf-dist/source/latex/l3kernel/l3color.dtx (limited to 'Master/texmf-dist/source/latex/l3kernel') diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 21436da3cfb..67af1e5da46 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -21,7 +21,7 @@ % for those people who are interested. % %<*driver|generic|package> -\def\ExplFileDate{2017/12/16}% +\def\ExplFileDate{2018/02/21}% % %<*driver> \documentclass[full]{l3doc} @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1297,7 +1297,7 @@ % foo}). The checks on driver choice are set up here, so when actually % the driver it's a straight forward operation. % \begin{macrocode} -\__msg_kernel_new:nnnn { expl } { wrong-driver } +\__kernel_msg_new:nnnn { expl } { wrong-driver } { Driver~request~inconsistent~with~engine:~using~'#2'~driver. } { You~have~requested~driver~'#1',~but~this~is~not~suitable~for~use~with~the~ @@ -1331,14 +1331,14 @@ \tl_set:Nn \l__expl_driver_tl { dvipdfmx } \sys_if_engine_xetex:TF { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvipdfmx } { xdvipdfmx } \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { \sys_if_output_pdf:T { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvipdfmx } { pdfmode } \tl_set:Nn \l__expl_driver_tl { pdfmode } } @@ -1349,14 +1349,14 @@ \tl_set:Nn \l__expl_driver_tl { dvips } \sys_if_engine_xetex:TF { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvips } { xdvipdfmx } \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { \sys_if_output_pdf:T { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvips } { pdfmode } \tl_set:Nn \l__expl_driver_tl { pdfmode } } @@ -1367,14 +1367,14 @@ \tl_set:Nn \l__expl_driver_tl { dvisvgm } \sys_if_engine_xetex:TF { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvips } { xdvipdfmx } \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { \sys_if_output_pdf:T { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { dvips } { pdfmode } \tl_set:Nn \l__expl_driver_tl { pdfmode } } @@ -1387,14 +1387,14 @@ \tl_set:Nn \l__expl_driver_tl { pdfmode } \sys_if_engine_xetex:TF { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { pdfmode } { xdvipdfmx } \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } { \sys_if_output_pdf:F { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { pdfmode } { dvips } \tl_set:Nn \l__expl_driver_tl { dvips } } @@ -1407,12 +1407,12 @@ { \sys_if_output_pdf:TF { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { xdvipdfmx } { pdfmode } \tl_set:Nn \l__expl_driver_tl { pdfmode } } { - \__msg_kernel_error:nnnn { expl } { wrong-driver } + \__kernel_msg_error:nnnn { expl } { wrong-driver } { xdvipdfmx } { dvips } \tl_set:Nn \l__expl_driver_tl { dvips } } @@ -1454,7 +1454,7 @@ \str_if_eq:VnTF \l__expl_driver_tl { latex2e } { \tl_gput_left:Nn \@begindocumenthook { \RequirePackage { graphics } } - \__msg_kernel_new:nnnn { box } { clipping-not-available } + \__kernel_msg_new:nnnn { box } { clipping-not-available } { Box~clipping~not~available. } { The~\box_clip:N~function~is~only~available~when~loading~expl3~ @@ -1463,7 +1463,7 @@ \cs_set_protected:Npn \box_clip:N #1 { \hbox_set:Nn #1 { \box_use:N #1 } - \__msg_kernel_error:nn { box } { clipping-not-available } + \__kernel_msg_error:nn { box } { clipping-not-available } } \cs_set_protected:Npn \box_rotate:Nn #1#2 { \hbox_set:Nn #1 { \rotatebox {#2} { \box_use:N #1 } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins index 29f65550cee..e2db89df344 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins @@ -1,6 +1,6 @@ \iffalse meta-comment -File l3.ins Copyright (C) 2011,2012,2014-2017 The LaTeX3 Project +File l3.ins Copyright (C) 2011,2012,2014-2018 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -33,7 +33,7 @@ license information is placed in the derived files. \preamble -Copyright (C) 1990-2017 The LaTeX3 Project +Copyright (C) 1990-2018 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of @@ -83,6 +83,7 @@ and all files in that bundle must be distributed together. \from{l3fp-traps.dtx} {package} \from{l3fp-round.dtx} {package} \from{l3fp-parse.dtx} {package} + \from{l3fp-assign.dtx} {package} \from{l3fp-logic.dtx} {package} \from{l3fp-basics.dtx} {package} \from{l3fp-extended.dtx}{package} @@ -90,14 +91,13 @@ and all files in that bundle must be distributed together. \from{l3fp-trig.dtx} {package} \from{l3fp-convert.dtx} {package} \from{l3fp-random.dtx} {package} - \from{l3fp-assign.dtx} {package} \from{l3sort.dtx} {package} \from{l3tl-build.dtx} {package} \from{l3tl-analysis.dtx}{package} \from{l3regex.dtx} {package} \from{l3box.dtx} {package} \from{l3coffins.dtx} {package} - \from{l3color.dtx} {package} + \from{l3color-base.dtx} {package} \from{l3sys.dtx} {package} \from{l3deprecation.dtx}{package} \from{l3candidates.dtx} {package} @@ -131,7 +131,6 @@ and all files in that bundle must be distributed together. \generate{\file{l3candidates.sty} {\from{l3oldmodules.dtx} {l3candidates,oldmodules}}} \generate{\file{l3clist.sty} {\from{l3oldmodules.dtx} {l3clist,oldmodules}}} \generate{\file{l3coffins.sty} {\from{l3oldmodules.dtx} {l3coffins,oldmodules}}} -\generate{\file{l3color.sty} {\from{l3oldmodules.dtx} {l3color,oldmodules}}} \generate{\file{l3expan.sty} {\from{l3oldmodules.dtx} {l3expan,oldmodules}}} \generate{\file{l3file.sty} {\from{l3oldmodules.dtx} {l3file,oldmodules}}} \generate{\file{l3fp.sty} {\from{l3oldmodules.dtx} {l3fp,oldmodules}}} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index 6079cba8274..3edc736eeb9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -175,7 +175,7 @@ \int_use:c { g_@@_ #1 _int } } } - { \__msg_kernel_fatal:nnx { kernel } { out-of-registers } {#1} } + { \__kernel_msg_fatal:nnx { kernel } { out-of-registers } {#1} } } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index cff05458c4d..7b2b8bb3948 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3basics.dtx Copyright (C) 1990-2017 The LaTeX3 project +%% File: l3basics.dtx Copyright (C) 1990-2018 The LaTeX3 project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -737,6 +737,7 @@ % \cs{cs_if_exist_use:NTF} \meta{control sequence} \Arg{true code} \Arg{false code} % \end{syntax} % Tests whether the \meta{control sequence} is currently defined +% according to the conditional \cs{cs_if_exist:NTF} % (whether as a function or another control sequence type), and if it % is inserts the \meta{control sequence} into the input stream followed % by the \meta{true code}. Otherwise the \meta{false code} is used. @@ -1051,8 +1052,8 @@ % \end{syntax} % Tests whether the \meta{control sequence} is currently defined % (whether as a function or another control sequence type). Any -% valid definition of \meta{control sequence} evaluates as -% \texttt{true}. +% definition of \meta{control sequence} other than \tn{relax} +% evaluates as \texttt{true}. % \end{function} % % \begin{function}[EXP,pTF]{\cs_if_free:N, \cs_if_free:c} @@ -1212,9 +1213,9 @@ % normally (spaces, characters with category other). % \end{function} % -% \begin{function}{\__debug:TF} +% \begin{function}{\__kernel_debug:TF} % \begin{syntax} -% \cs{__debug:TF} \Arg{true code} \Arg{false code} +% \cs{__kernel_debug:TF} \Arg{true code} \Arg{false code} % \end{syntax} % Runs the \meta{true code} if debugging is enabled, namely only in % \LaTeXe{} package mode with one of the options @@ -1224,18 +1225,18 @@ % conditional. % \end{function} % -% \begin{function}{\__debug_chk_cs_exist:N, \__debug_chk_cs_exist:c} +% \begin{function}{\__kernel_chk_cs_exist:N, \__kernel_chk_cs_exist:c} % \begin{syntax} -% \cs{__debug_chk_cs_exist:N} \meta{cs} +% \cs{__kernel_chk_cs_exist:N} \meta{cs} % \end{syntax} % This function is only created if debugging is enabled. It checks % that \meta{cs} exists according to the criteria for % \cs{cs_if_exist_p:N}, and if not raises a kernel-level error. % \end{function} % -% \begin{function}{\__debug_chk_expr:nNnN} +% \begin{function}{\__kernel_chk_expr:nNnN} % \begin{syntax} -% \cs{__debug_chk_expr:nNnN} \Arg{expr} \meta{eval} \Arg{convert} \meta{caller} +% \cs{__kernel_chk_expr:nNnN} \Arg{expr} \meta{eval} \Arg{convert} \meta{caller} % \end{syntax} % This function is only created if debugging is enabled. By default % it is equivalent to \cs{use_i:nnnn}. When expression checking is @@ -1250,18 +1251,18 @@ % purposes. % \end{function} % -% \begin{function}{\__debug_chk_var_exist:N} +% \begin{function}{\__kernel_chk_var_exist:N} % \begin{syntax} -% \cs{__debug_chk_var_exist:N} \meta{var} +% \cs{__kernel_chk_var_exist:N} \meta{var} % \end{syntax} % This function is only created if debugging is enabled. It checks % that \meta{var} is defined according to the criteria for % \cs{cs_if_exist_p:N}, and if not raises a kernel-level error. % \end{function} % -% \begin{function}{\__debug_chk_var_scope:NN} +% \begin{function}{\__kernel_chk_var_scope:NN} % \begin{syntax} -% \cs{__debug_chk_var_scope:NN} \meta{scope} \meta{var} +% \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var} % \end{syntax} % Checks the \meta{var} has the correct \meta{scope}, and if not % raises a kernel-level error. This function is only created if @@ -1276,19 +1277,19 @@ % different scopes a kernel error will result. % \end{function} % -% \begin{function}{\__debug_chk_var_local:N, \__debug_chk_var_global:N} +% \begin{function}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N} % \begin{syntax} -% \cs{__debug_chk_var_local:N} \meta{var} -% \cs{__debug_chk_var_global:N} \meta{var} +% \cs{__kernel_chk_var_local:N} \meta{var} +% \cs{__kernel_chk_var_global:N} \meta{var} % \end{syntax} -% Applies \cs{__debug_chk_var_exist:N} \meta{var}, then -% \cs{__debug_chk_var_scope:NN} \meta{scope} \meta{var}, where +% Applies \cs{__kernel_chk_var_exist:N} \meta{var}, then +% \cs{__kernel_chk_var_scope:NN} \meta{scope} \meta{var}, where % \meta{scope} is |l| or~|g|. % \end{function} % -% \begin{function}{\__debug_log:x} +% \begin{function}{\__kernel_debug_log:x} % \begin{syntax} -% \cs{__debug_log:x} \Arg{message text} +% \cs{__kernel_debug_log:x} \Arg{message text} % \end{syntax} % If the \texttt{log-functions} option is active, this function writes % the \meta{message text} to the log file using \cs{iow_log:x}. @@ -1296,9 +1297,9 @@ % This function is only created if debugging is enabled. % \end{function} % -% \begin{function}{\__debug_patch:nnNNpn} +% \begin{function}{\__kernel_patch:nnNNpn} % \begin{syntax} -% \cs{__debug_patch:nnNNpn} \Arg{before} \Arg{after} +% \cs{__kernel_patch:nnNNpn} \Arg{before} \Arg{after} % \meta{definition} \meta{function} \meta{parameters} \Arg{code} % \end{syntax} % If debugging is not enabled, this function ignores the \meta{before} @@ -1311,24 +1312,24 @@ % needed. % \end{function} % -% \begin{function}{\__debug_patch_conditional:nNNpnn} +% \begin{function}{\__kernel_patch_conditional:nNNpnn} % \begin{syntax} -% \cs{__debug_patch_conditional:nNNpnn} \Arg{before} +% \cs{__kernel_patch_conditional:nNNpnn} \Arg{before} % \meta{definition} \meta{conditional} \meta{parameters} \Arg{type} \Arg{code} % \end{syntax} -% Similar to \cs{__debug_patch:nnNNpn} for conditionals, namely +% Similar to \cs{__kernel_patch:nnNNpn} for conditionals, namely % \meta{definition} must be \cs{prg_new_conditional:Npnn} or its % \texttt{_protected} counterpart. There is no \meta{after} code % because that would interfere with the action of the conditional. % \end{function} % % \begin{function} -% {\__debug_patch_args:nNNpn, \__debug_patch_conditional_args:nNNpnn} +% {\__kernel_patch_args:nNNpn, \__kernel_patch_conditional_args:nNNpnn} % \begin{syntax} -% \cs{__debug_patch_args:nNNpn} \Arg{arguments} +% \cs{__kernel_patch_args:nNNpn} \Arg{arguments} % \meta{definition} \meta{function} \meta{parameters} \Arg{code} % \end{syntax} -% Like \cs{__debug_patch:nnNNpn}, this tweaks the following +% Like \cs{__kernel_patch:nnNNpn}, this tweaks the following % definition, but from the \enquote{inside out} (and if debugging is % not enabled, the \meta{arguments} are ignored). It replaces |#1|, % |#2| and so on in the \meta{code} of the definition as indicated by @@ -1338,25 +1339,25 @@ % front of the \meta{arguments} is used instead of the \meta{code} % when defining the actual function. For instance, % \begin{quote} -% \cs{__debug_patch_args:nNNpn} |{ { (#1) } }| \\ +% \cs{__kernel_patch_args:nNNpn} |{ { (#1) } }| \\ % \cs{cs_new:Npn} \cs{int_eval:n} |#1| \\ % ~~|{ \__int_value:w \__int_eval:w #1 \__int_eval_end: }| % \end{quote} % would replace |#1| by |(#1)| in the definition of \cs{int_eval:n} when % debugging is enabled. This fails if the \meta{code} contains~|##|. -% The \cs{__debug_patch_conditional_args:nNNpnn} function is for use +% The \cs{__kernel_patch_conditional_args:nNNpnn} function is for use % before \cs{prg_new_conditional:Npnn} or its \texttt{_protected} % counterpart. % \end{function} % % \begin{function} -% {\__debug_patch_args:nnnNNpn, \__debug_patch_conditional_args:nnnNNpnn} +% {\__kernel_patch_args:nnnNNpn, \__kernel_patch_conditional_args:nnnNNpnn} % \begin{syntax} -% \cs{__debug_patch_args:nnnNNpn} \Arg{before} \Arg{after} \Arg{arguments} +% \cs{__kernel_patch_args:nnnNNpn} \Arg{before} \Arg{after} \Arg{arguments} % \meta{definition} \meta{function} \meta{parameters} \Arg{code} % \end{syntax} -% A combination of \cs{__debug_patch:nnNNpn} and -% \cs{__debug_patch_args:nNNpn}. +% A combination of \cs{__kernel_patch:nnNNpn} and +% \cs{__kernel_patch_args:nNNpn}. % \end{function} % % \begin{function}{\__kernel_check_defined:NT} @@ -1781,7 +1782,7 @@ %<@@=debug> % \end{macrocode} % -% \begin{macro}{\@@:TF} +% \begin{macro}{\__kernel_debug:TF} % A more meaningful test of whether debugging is enabled than messing % up with guards. We can also more easily change the logic in one % place then. At present, debugging is disabled in the format and in @@ -1789,10 +1790,10 @@ % options \texttt{enable-debug}, \texttt{log-functions} or % \texttt{check-declarations} was given. % \begin{macrocode} -\cs_set_protected:Npn \@@:TF #1#2 {#2} +\cs_set_protected:Npn \__kernel_debug:TF #1#2 {#2} %<*package> \tex_ifodd:D \l@expl@enable@debug@bool - \cs_set_protected:Npn \@@:TF #1#2 {#1} + \cs_set_protected:Npn \__kernel_debug:TF #1#2 {#1} \fi: % % \end{macrocode} @@ -1801,34 +1802,34 @@ % \begin{macro}{\debug_on:n, \debug_off:n} % % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { \cs_set_protected:Npn \debug_on:n #1 { \exp_args:No \clist_map_inline:nn { \tl_to_str:n {#1} } { - \cs_if_exist_use:cF { @@_##1_on: } - { \__msg_kernel_error:nnn { kernel } { debug } {##1} } + \cs_if_exist_use:cF { __debug_##1_on: } + { \__kernel_msg_error:nnn { kernel } { debug } {##1} } } } \cs_set_protected:Npn \debug_off:n #1 { \exp_args:No \clist_map_inline:nn { \tl_to_str:n {#1} } { - \cs_if_exist_use:cF { @@_##1_off: } - { \__msg_kernel_error:nnn { kernel } { debug } {##1} } + \cs_if_exist_use:cF { __debug_##1_off: } + { \__kernel_msg_error:nnn { kernel } { debug } {##1} } } } } { \cs_set_protected:Npn \debug_on:n #1 { - \__msg_kernel_error:nnx { kernel } { enable-debug } + \__kernel_msg_error:nnx { kernel } { enable-debug } { \tl_to_str:n { \debug_on:n {#1} } } } \cs_set_protected:Npn \debug_off:n #1 { - \__msg_kernel_error:nnx { kernel } { enable-debug } + \__kernel_msg_error:nnx { kernel } { enable-debug } { \tl_to_str:n { \debug_off:n {#1} } } } } @@ -1836,32 +1837,32 @@ % \end{macro} % % \begin{macro}{\debug_suspend:, \debug_resume:} -% \begin{macro}{\@@_suspended:T} -% \begin{macro}{\l_@@_suspended_tl} +% \begin{macro}{\__debug_suspended:T} +% \begin{macro}{\l__debug_suspended_tl} % Suspend and resume locally all debug-related errors and logging % except deprecation errors. The \cs{debug_suspend:} and \cs{debug_resume:} % pairs can be nested. We keep track of nesting in a token list % containing a number of periods. At first begin with the -% \enquote{non-suspended} version of \cs{@@_suspended:T}. +% \enquote{non-suspended} version of \cs{__debug_suspended:T}. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \cs_set_nopar:Npn \l_@@_suspended_tl { } + \cs_set_nopar:Npn \l__debug_suspended_tl { } \cs_set_protected:Npn \debug_suspend: { - \tl_put_right:Nn \l_@@_suspended_tl { . } - \cs_set_eq:NN \@@_suspended:T \use:n + \tl_put_right:Nn \l__debug_suspended_tl { . } + \cs_set_eq:NN \__debug_suspended:T \use:n } \cs_set_protected:Npn \debug_resume: { - \tl_set:Nx \l_@@_suspended_tl - { \tl_tail:N \l_@@_suspended_tl } - \tl_if_empty:NT \l_@@_suspended_tl + \tl_set:Nx \l__debug_suspended_tl + { \tl_tail:N \l__debug_suspended_tl } + \tl_if_empty:NT \l__debug_suspended_tl { - \cs_set_eq:NN \@@_suspended:T \use_none:n + \cs_set_eq:NN \__debug_suspended:T \use_none:n } } - \cs_set:Npn \@@_suspended:T #1 { } + \cs_set:Npn \__debug_suspended:T #1 { } } { \cs_set_protected:Npn \debug_suspend: { } @@ -1873,76 +1874,76 @@ % \end{macro} % % \begin{macro} -% {\@@_check-declarations_on:, \@@_check-declarations_off:} -% \begin{macro}{\@@_chk_var_exist:N} -% \begin{macro}{\@@_chk_cs_exist:N, \@@_chk_cs_exist:c} -% \begin{macro}{\@@_chk_var_local:N, \@@_chk_var_global:N} -% \begin{macro}{\@@_chk_var_scope:NN} +% {\__debug_check-declarations_on:, \__debug_check-declarations_off:} +% \begin{macro}{\__kernel_chk_var_exist:N} +% \begin{macro}{\__kernel_chk_cs_exist:N, \__kernel_chk_cs_exist:c} +% \begin{macro}{\__kernel_chk_var_local:N, \__kernel_chk_var_global:N} +% \begin{macro}{\__kernel_chk_var_scope:NN} % When debugging is enabled these two functions set up functions that % test their argument (when \texttt{check-declarations} is active) % \begin{itemize} -% \item \cs{@@_chk_var_exist:N} and \cs{@@_chk_cs_exist:N}, two +% \item \cs{__kernel_chk_var_exist:N} and \cs{__kernel_chk_cs_exist:N}, two % functions that test that their argument is defined; -% \item \cs{@@_chk_var_scope:NN} that checks that its argument |#2| +% \item \cs{__kernel_chk_var_scope:NN} that checks that its argument |#2| % has scope |#1|. -% \item \cs{@@_chk_var_local:N} and \cs{@@_chk_var_global:N} that +% \item \cs{__kernel_chk_var_local:N} and \cs{__kernel_chk_var_global:N} that % perform both checks. % \end{itemize} % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \exp_args:Nc \cs_set_protected:Npn { @@_check-declarations_on: } + \exp_args:Nc \cs_set_protected:Npn { __debug_check-declarations_on: } { - \cs_set_protected:Npn \@@_chk_var_exist:N ##1 + \cs_set_protected:Npn \__kernel_chk_var_exist:N ##1 { - \@@_suspended:T \use_none:nnn + \__debug_suspended:T \use_none:nnn \cs_if_exist:NF ##1 { - \__msg_kernel_error:nnx { kernel } { non-declared-variable } + \__kernel_msg_error:nnx { kernel } { non-declared-variable } { \token_to_str:N ##1 } } } - \cs_set_protected:Npn \@@_chk_cs_exist:N ##1 + \cs_set_protected:Npn \__kernel_chk_cs_exist:N ##1 { - \@@_suspended:T \use_none:nnn + \__debug_suspended:T \use_none:nnn \cs_if_exist:NF ##1 { - \__msg_kernel_error:nnx { kernel } { command-not-defined } + \__kernel_msg_error:nnx { kernel } { command-not-defined } { \token_to_str:N ##1 } } } - \cs_set_protected:Npn \@@_chk_var_scope:NN + \cs_set_protected:Npn \__kernel_chk_var_scope:NN { - \@@_suspended:T \use_none:nnn - \@@_chk_var_scope_aux:NN + \__debug_suspended:T \use_none:nnn + \__debug_chk_var_scope_aux:NN } - \cs_set_protected:Npn \@@_chk_var_local:N ##1 + \cs_set_protected:Npn \__kernel_chk_var_local:N ##1 { - \@@_suspended:T \use_none:nnnnn - \@@_chk_var_exist:N ##1 - \@@_chk_var_scope_aux:NN l ##1 + \__debug_suspended:T \use_none:nnnnn + \__kernel_chk_var_exist:N ##1 + \__debug_chk_var_scope_aux:NN l ##1 } - \cs_set_protected:Npn \@@_chk_var_global:N ##1 + \cs_set_protected:Npn \__kernel_chk_var_global:N ##1 { - \@@_suspended:T \use_none:nnnnn - \@@_chk_var_exist:N ##1 - \@@_chk_var_scope_aux:NN g ##1 + \__debug_suspended:T \use_none:nnnnn + \__kernel_chk_var_exist:N ##1 + \__debug_chk_var_scope_aux:NN g ##1 } } - \exp_args:Nc \cs_set_protected:Npn { @@_check-declarations_off: } + \exp_args:Nc \cs_set_protected:Npn { __debug_check-declarations_off: } { - \cs_set_protected:Npn \@@_chk_var_exist:N ##1 { } - \cs_set_protected:Npn \@@_chk_cs_exist:N ##1 { } - \cs_set_protected:Npn \@@_chk_var_local:N ##1 { } - \cs_set_protected:Npn \@@_chk_var_global:N ##1 { } - \cs_set_protected:Npn \@@_chk_var_scope:NN ##1##2 { } + \cs_set_protected:Npn \__kernel_chk_var_exist:N ##1 { } + \cs_set_protected:Npn \__kernel_chk_cs_exist:N ##1 { } + \cs_set_protected:Npn \__kernel_chk_var_local:N ##1 { } + \cs_set_protected:Npn \__kernel_chk_var_global:N ##1 { } + \cs_set_protected:Npn \__kernel_chk_var_scope:NN ##1##2 { } } - \cs_set_protected:Npn \@@_chk_cs_exist:c - { \exp_args:Nc \@@_chk_cs_exist:N } + \cs_set_protected:Npn \__kernel_chk_cs_exist:c + { \exp_args:Nc \__kernel_chk_cs_exist:N } \tex_ifodd:D \l@expl@check@declarations@bool - \use:c { @@_check-declarations_on: } + \use:c { __debug_check-declarations_on: } \else: - \use:c { @@_check-declarations_off: } + \use:c { __debug_check-declarations_off: } \fi: } { } @@ -1953,13 +1954,13 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_chk_var_scope_aux:NN} -% \begin{macro}{\@@_chk_var_scope_aux:Nn} -% \begin{macro}{\@@_chk_var_scope_aux:NNn} +% \begin{macro}{\__debug_chk_var_scope_aux:NN} +% \begin{macro}{\__debug_chk_var_scope_aux:Nn} +% \begin{macro}{\__debug_chk_var_scope_aux:NNn} % First check whether the name of the variable |#2| starts with % \meta{letter}|_|. If it does then pass that letter, the % \meta{scope}, and the variable name to -% \cs{@@_chk_var_scope_aux:NNn}. That function compares the two +% \cs{__debug_chk_var_scope_aux:NNn}. That function compares the two % letters and triggers an error if they differ (the \cs{scan_stop:} % case is not reachable here). If the second character was not |_| % then pass the same data to the same auxiliary, except for its first @@ -1969,30 +1970,30 @@ % letter \meta{scope} according to what the first assignment to the % given variable was. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \cs_set_protected:Npn \@@_chk_var_scope_aux:NN #1#2 - { \exp_args:NNf \@@_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } } - \cs_set_protected:Npn \@@_chk_var_scope_aux:Nn #1#2 + \cs_set_protected:Npn \__debug_chk_var_scope_aux:NN #1#2 + { \exp_args:NNf \__debug_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } } + \cs_set_protected:Npn \__debug_chk_var_scope_aux:Nn #1#2 { \if:w _ \use_i:nn \use_i_delimit_by_q_stop:nw #2 ? ? \q_stop - \exp_after:wN \@@_chk_var_scope_aux:NNn + \exp_after:wN \__debug_chk_var_scope_aux:NNn \use_i_delimit_by_q_stop:nw #2 ? \q_stop #1 {#2} \else: - \exp_args:Nc \@@_chk_var_scope_aux:NNn - { @@_chk_/ #2 } + \exp_args:Nc \__debug_chk_var_scope_aux:NNn + { __debug_chk_/ #2 } #1 {#2} \fi: } - \cs_set_protected:Npn \@@_chk_var_scope_aux:NNn #1#2#3 + \cs_set_protected:Npn \__debug_chk_var_scope_aux:NNn #1#2#3 { \if:w #1 #2 \else: \if:w #1 \scan_stop: \cs_gset_nopar:Npn #1 {#2} \else: - \__msg_kernel_error:nnxxx { kernel } { local-global } + \__kernel_msg_error:nnxxx { kernel } { local-global } {#1} {#2} { \iow_char:N \\ #3 } \fi: \fi: @@ -2005,11 +2006,11 @@ % \end{macro} % % \begin{macro} -% {\@@_check-expressions_on:, \@@_check-expressions_off:} -% \begin{macro}{\@@_chk_expr:nNnN} -% \begin{macro}{\@@_chk_expr_aux:nNnN} +% {\__debug_check-expressions_on:, \__debug_check-expressions_off:} +% \begin{macro}{\__kernel_chk_expr:nNnN} +% \begin{macro}{\__debug_chk_expr_aux:nNnN} % When debugging is enabled these two functions set -% \cs{@@_chk_expr:nNnN} to test or not whether the given +% \cs{__kernel_chk_expr:nNnN} to test or not whether the given % expression is valid. The idea is to evaluate the expression within % a brace group (to catch trailing \cs{use_none:nn} or similar), then % test that the result is what we expect. This is done by turning it @@ -2027,22 +2028,22 @@ % |1+2\relax+3| would incorrectly be accepted as a valid integer % expression. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \exp_args:Nc \cs_set_protected:Npn { @@_check-expressions_on: } + \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_on: } { - \cs_set:Npn \@@_chk_expr:nNnN ##1##2 + \cs_set:Npn \__kernel_chk_expr:nNnN ##1##2 { - \@@_suspended:T { ##1 \use_none:nnnnnnn } - \exp_after:wN \@@_chk_expr_aux:nNnN + \__debug_suspended:T { ##1 \use_none:nnnnnnn } + \exp_after:wN \__debug_chk_expr_aux:nNnN \exp_after:wN { \tex_the:D ##2 ##1 \tex_relax:D } ##2 } } - \exp_args:Nc \cs_set_protected:Npn { @@_check-expressions_off: } - { \cs_set:Npn \@@_chk_expr:nNnN ##1##2##3##4 {##1} } - \use:c { @@_check-expressions_off: } - \cs_set:Npn \@@_chk_expr_aux:nNnN #1#2#3#4 + \exp_args:Nc \cs_set_protected:Npn { __debug_check-expressions_off: } + { \cs_set:Npn \__kernel_chk_expr:nNnN ##1##2##3##4 {##1} } + \use:c { __debug_check-expressions_off: } + \cs_set:Npn \__debug_chk_expr_aux:nNnN #1#2#3#4 { \tl_if_empty:oF { @@ -2051,7 +2052,7 @@ \__int_value:w #3 #2 #1 \tex_relax:D } { - \__msg_kernel_expandable_error:nnnn + \__kernel_msg_expandable_error:nnnn { kernel } { expr } {#4} {#1} } #1 @@ -2063,29 +2064,29 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_log-functions_on:, \@@_log-functions_off:} -% \begin{macro}{\@@_log:x} +% \begin{macro}{\__debug_log-functions_on:, \__debug_log-functions_off:} +% \begin{macro}{\__kernel_debug_log:x} % These two functions (corresponding to the \pkg{expl3} option -% \texttt{log-functions}) control whether \cs{@@_log:x} writes to the +% \texttt{log-functions}) control whether \cs{__kernel_debug_log:x} writes to the % log file or not. Since \cs{iow_log:x} does not yet have its final % definition we do not use \cs{cs_set_eq:NN} (not defined yet anyway). % Once everything is defined, turn logging on or off depending on what % option was given. When debugging is not enabled, simply produce an % error. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \exp_args:Nc \cs_set_protected:Npn { @@_log-functions_on: } + \exp_args:Nc \cs_set_protected:Npn { __debug_log-functions_on: } { - \cs_set_protected:Npn \@@_log:x - { \@@_suspended:T \use_none:nn \iow_log:x } + \cs_set_protected:Npn \__kernel_debug_log:x + { \__debug_suspended:T \use_none:nn \iow_log:x } } - \exp_args:Nc \cs_set_protected:Npn { @@_log-functions_off: } - { \cs_set_protected:Npn \@@_log:x { \use_none:n } } + \exp_args:Nc \cs_set_protected:Npn { __debug_log-functions_off: } + { \cs_set_protected:Npn \__kernel_debug_log:x { \use_none:n } } \tex_ifodd:D \l@expl@log@functions@bool - \use:c { @@_log-functions_on: } + \use:c { __debug_log-functions_on: } \else: - \use:c { @@_log-functions_off: } + \use:c { __debug_log-functions_off: } \fi: } { } @@ -2093,33 +2094,42 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_deprecation_on:, \@@_deprecation_off:} -% \begin{variable}{\g_@@_deprecation_on_tl, \g_@@_deprecation_off_tl} +% \begin{macro}{\__debug_deprecation_on:, \__debug_deprecation_off:} +% \begin{macro}{\__kernel_deprecation_code:nn} +% \begin{variable}{\g__debug_deprecation_on_tl, \g__debug_deprecation_off_tl} % Some commands were more recently deprecated and not yet removed; % only make these into errors if the user requests it. This relies on % two token lists, mostly filled up by calls to -% \cs{@@_deprecation:nnNNpn} in each module. +% \cs{__kernel_patch_deprecation:nnNNpn} in each module. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \cs_set_protected:Npn \@@_deprecation_on: - { \g_@@_deprecation_on_tl } - \cs_set_protected:Npn \@@_deprecation_off: - { \g_@@_deprecation_off_tl } - \cs_set_nopar:Npn \g_@@_deprecation_on_tl { } - \cs_set_nopar:Npn \g_@@_deprecation_off_tl { } + \cs_set_protected:Npn \__debug_deprecation_on: + { \g__debug_deprecation_on_tl } + \cs_set_protected:Npn \__debug_deprecation_off: + { \g__debug_deprecation_off_tl } + \cs_set_nopar:Npn \g__debug_deprecation_on_tl { } + \cs_set_nopar:Npn \g__debug_deprecation_off_tl { } + \cs_set_protected:Npn \__kernel_deprecation_code:nn #1#2 + { + \tl_gput_right:Nn \g__debug_deprecation_on_tl {#1} + \tl_gput_right:Nn \g__debug_deprecation_off_tl {#2} + } + } + { + \cs_set_protected:Npn \__kernel_deprecation_code:nn #1#2 { } } - { } % \end{macrocode} % \end{variable} % \end{macro} +% \end{macro} % -% \begin{macro}{\@@_deprecation:nnNNpn} -% \begin{macro}{\@@_deprecation_aux:nnNnn} +% \begin{macro}{\__kernel_patch_deprecation:nnNNpn} +% \begin{macro}{\__debug_deprecation_aux:nnNnn} % Grab a definition (at present, must be \cs{cs_new_protected:Npn}). -% Add to \cs{g_@@_deprecation_on_tl} some code that makes the +% Add to \cs{g__debug_deprecation_on_tl} some code that makes the % defined macro |#3| outer (and defines it as an error). Add to -% \cs{g_@@_deprecation_off_tl} the definition itself. In both +% \cs{g__debug_deprecation_off_tl} the definition itself. In both % cases we undefine the token with \cs{tex_let:D} to avoid taking a % potentially outer macro as the argument of some \pkg{expl3} % function. Finally define the macro itself to produce a warning then @@ -2127,35 +2137,35 @@ % together with the \texttt{x}-expanding assignment and \cs{exp_not:n} % this gives a convenient way of storing the macro's definition in % itself in order to only produce the warning once for each macro. -% If debugging is disabled, \cs{@@_deprecation:nnNNpn} lets the +% If debugging is disabled, \cs{__kernel_patch_deprecation:nnNNpn} lets the % definition happen. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \cs_set_protected:Npn \@@_deprecation:nnNNpn #1#2#3#4#5# + \cs_set_protected:Npn \__kernel_patch_deprecation:nnNNpn #1#2#3#4#5# { \if_meaning:w \cs_new_protected:Npn #3 \else: - \__msg_kernel_error:nnx { kernel } { debug-unpatchable } + \__kernel_msg_error:nnx { kernel } { debug-unpatchable } { \token_to_str:N #3 ~(for~deprecation) } \fi: - \@@_deprecation_aux:nnNnn {#1} {#2} #4 {#5} + \__debug_deprecation_aux:nnNnn {#1} {#2} #4 {#5} } - \cs_set_protected:Npn \@@_deprecation_aux:nnNnn #1#2#3#4#5 + \cs_set_protected:Npn \__debug_deprecation_aux:nnNnn #1#2#3#4#5 { - \tl_gput_right:Nn \g_@@_deprecation_on_tl + \tl_gput_right:Nn \g__debug_deprecation_on_tl { \tex_let:D #3 \scan_stop: \__deprecation_error:Nnn #3 {#2} {#1} } - \tl_gput_right:Nn \g_@@_deprecation_off_tl + \tl_gput_right:Nn \g__debug_deprecation_off_tl { \tex_let:D #3 \scan_stop: \cs_set_protected:Npn #3 #4 {#5} } \cs_new_protected:Npx #3 { - \exp_not:N \__msg_kernel_warning:nnxxx + \exp_not:N \__kernel_msg_warning:nnxxx { kernel } { deprecated-command } {#1} { \token_to_str:N #3 } { \tl_to_str:n {#2} } \exp_not:n { \cs_gset_protected:Npn #3 #4 {#5} } @@ -2163,87 +2173,87 @@ } } } - { \cs_set_protected:Npn \@@_deprecation:nnNNpn #1#2 { } } + { \cs_set_protected:Npn \__kernel_patch_deprecation:nnNNpn #1#2 { } } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro} -% {\@@_patch:nnNNpn, \@@_patch_conditional:nNNpnn} +% {\__kernel_patch:nnNNpn, \__kernel_patch_conditional:nNNpnn} % \begin{macro} -% {\@@_patch_aux:nnnn, \@@_patch_auxii:nnnn} -% When debugging is not enabled, \cs{@@_patch:nnNNpn} and -% \cs{@@_patch_conditional:nNNpnn} throw the patch away. +% {\__debug_patch_aux:nnnn, \__debug_patch_auxii:nnnn} +% When debugging is not enabled, \cs{__kernel_patch:nnNNpn} and +% \cs{__kernel_patch_conditional:nNNpnn} throw the patch away. % Otherwise they can be followed by \cs{cs_new:Npn} (or similar), and % \cs{prg_new_conditional:Npnn} (or similar), respectively. In each % case, grab the name of the function to be defined and its parameters % then insert tokens before and/or after the definition. % \begin{macrocode} -\@@:TF +\__kernel_debug:TF { - \cs_set_protected:Npn \@@_patch:nnNNpn #1#2#3#4#5# - { \@@_patch_aux:nnnn {#1} {#2} { #3 #4 #5 } } - \cs_set_protected:Npn \@@_patch_conditional:nNNpnn #1#2#3#4# - { \@@_patch_auxii:nnnn {#1} { #2 #3 #4 } } - \cs_set_protected:Npn \@@_patch_aux:nnnn #1#2#3#4 + \cs_set_protected:Npn \__kernel_patch:nnNNpn #1#2#3#4#5# + { \__debug_patch_aux:nnnn {#1} {#2} { #3 #4 #5 } } + \cs_set_protected:Npn \__kernel_patch_conditional:nNNpnn #1#2#3#4# + { \__debug_patch_auxii:nnnn {#1} { #2 #3 #4 } } + \cs_set_protected:Npn \__debug_patch_aux:nnnn #1#2#3#4 { #3 { #1 #4 #2 } } - \cs_set_protected:Npn \@@_patch_auxii:nnnn #1#2#3#4 + \cs_set_protected:Npn \__debug_patch_auxii:nnnn #1#2#3#4 { #2 {#3} { #1 #4 } } } { - \cs_set_protected:Npn \@@_patch:nnNNpn #1#2 { } - \cs_set_protected:Npn \@@_patch_conditional:nNNpnn #1 { } + \cs_set_protected:Npn \__kernel_patch:nnNNpn #1#2 { } + \cs_set_protected:Npn \__kernel_patch_conditional:nNNpnn #1 { } } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro} -% {\@@_patch_args:nNNpn, \@@_patch_conditional_args:nNNpnn} +% {\__kernel_patch_args:nNNpn, \__kernel_patch_conditional_args:nNNpnn} % \begin{macro} -% {\@@_patch_args:nnnNNpn, \@@_patch_conditional_args:nnnNNpnn} +% {\__kernel_patch_args:nnnNNpn, \__kernel_patch_conditional_args:nnnNNpnn} % \begin{macro} % { -% \@@_tmp:w, -% \@@_patch_args_aux:nnnNNnn, -% \@@_patch_args_aux:nnnNNnnn, -% \@@_patch_args_aux:nnnn +% \__debug_tmp:w, +% \__debug_patch_args_aux:nnnNNnn, +% \__debug_patch_args_aux:nnnNNnnn, +% \__debug_patch_args_aux:nnnn % } -% See \cs{@@_patch:nnNNpn}. The first argument is something like +% See \cs{__kernel_patch:nnNNpn}. The first argument is something like % |{#1}{(#2)}|. Define a temporary macro using the \meta{parameters} % and \meta{code} of the definition that follows, then expand that % temporary macro in front of the first argument to obtain new % \meta{code}. Then perform the definition as if that new \meta{code} % was directly typed in the file. % \begin{macrocode} -\cs_set_protected:Npn \@@_patch_args:nNNpn - { \@@_patch_args:nnnNNpn { } { } } -\cs_set_protected:Npn \@@_patch_conditional_args:nNNpnn - { \@@_patch_conditional_args:nnnNNpnn { } { } } -\@@:TF +\cs_set_protected:Npn \__kernel_patch_args:nNNpn + { \__kernel_patch_args:nnnNNpn { } { } } +\cs_set_protected:Npn \__kernel_patch_conditional_args:nNNpnn + { \__kernel_patch_conditional_args:nnnNNpnn { } { } } +\__kernel_debug:TF { - \cs_set_protected:Npn \@@_patch_args:nnnNNpn #1#2#3#4#5#6# - { \@@_patch_args_aux:nnnNNnn {#1} {#2} {#3} #4 #5 {#6} } - \cs_set_protected:Npn \@@_patch_conditional_args:nnnNNpnn #1#2#3#4#5#6# - { \@@_patch_args_aux:nnnNNnnn {#1} {#2} {#3} #4 #5 {#6} } - \cs_set_protected:Npn \@@_patch_args_aux:nnnNNnn #1#2#3#4#5#6#7 + \cs_set_protected:Npn \__kernel_patch_args:nnnNNpn #1#2#3#4#5#6# + { \__debug_patch_args_aux:nnnNNnn {#1} {#2} {#3} #4 #5 {#6} } + \cs_set_protected:Npn \__kernel_patch_conditional_args:nnnNNpnn #1#2#3#4#5#6# + { \__debug_patch_args_aux:nnnNNnnn {#1} {#2} {#3} #4 #5 {#6} } + \cs_set_protected:Npn \__debug_patch_args_aux:nnnNNnn #1#2#3#4#5#6#7 { - \cs_set:Npn \@@_tmp:w #6 {#7} - \exp_after:wN \@@_patch_args_aux:nnnn \exp_after:wN - { \@@_tmp:w #3 } { #4 #5 #6 } {#1} {#2} + \cs_set:Npn \__debug_tmp:w #6 {#7} + \exp_after:wN \__debug_patch_args_aux:nnnn \exp_after:wN + { \__debug_tmp:w #3 } { #4 #5 #6 } {#1} {#2} } - \cs_set_protected:Npn \@@_patch_args_aux:nnnNNnnn #1#2#3#4#5#6#7#8 + \cs_set_protected:Npn \__debug_patch_args_aux:nnnNNnnn #1#2#3#4#5#6#7#8 { - \cs_set:Npn \@@_tmp:w #6 {#8} - \exp_after:wN \@@_patch_args_aux:nnnn \exp_after:wN - { \@@_tmp:w #3 } { #4 #5 #6 {#7} } {#1} {#2} + \cs_set:Npn \__debug_tmp:w #6 {#8} + \exp_after:wN \__debug_patch_args_aux:nnnn \exp_after:wN + { \__debug_tmp:w #3 } { #4 #5 #6 {#7} } {#1} {#2} } - \cs_set_protected:Npn \@@_patch_args_aux:nnnn #1#2#3#4 + \cs_set_protected:Npn \__debug_patch_args_aux:nnnn #1#2#3#4 { #2 { #3 #1 #4 } } } { - \cs_set_protected:Npn \@@_patch_args:nnnNNpn #1#2#3 { } - \cs_set_protected:Npn \@@_patch_conditional_args:nnnNNpnn #1#2#3 { } + \cs_set_protected:Npn \__kernel_patch_args:nnnNNpn #1#2#3 { } + \cs_set_protected:Npn \__kernel_patch_conditional_args:nnnNNpnn #1#2#3 { } } % \end{macrocode} % \end{macro} @@ -2376,7 +2386,7 @@ { \@@_generate_conditional:nnNnnnnn {#1} {#2} #3 {#4} {#5} } { \tl_count:n {#2} } { - \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments } + \__kernel_msg_error:nnxx { kernel } { bad-number-of-arguments } { \token_to_str:c { #1 : #2 } } { \tl_count:n {#2} } \use_none:nn @@ -2405,7 +2415,7 @@ \cs_set_protected:Npn \@@_generate_conditional:nnNnnnnn #1#2#3#4#5#6#7#8 { \if_meaning:w \c_false_bool #3 - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } \exp_after:wN \use_none:nn \fi: @@ -2434,7 +2444,7 @@ \use:c { @@_generate_ #7 _form:wnnnnnn } \tl_if_empty:nF {#7} { - \__msg_kernel_error:nnxx + \__kernel_msg_error:nnxx { kernel } { conditional-form-unknown } {#7} { \token_to_str:c { #3 : #4 } } } @@ -2476,7 +2486,7 @@ { #7 \exp_end: \c_true_bool \c_false_bool } } { - \__msg_kernel_error:nnx { kernel } { protected-predicate } + \__kernel_msg_error:nnx { kernel } { protected-predicate } { \token_to_str:c { #4 _p: #5 } } } } @@ -2556,12 +2566,12 @@ \cs_set_protected:Npn \@@_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6 { \if_meaning:w \c_false_bool #3 - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: \if_meaning:w \c_false_bool #6 - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#4} } \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: @@ -2575,7 +2585,7 @@ \use:c { @@_set_eq_conditional_ #6 _form:wNnnnn } \tl_if_empty:nF {#6} { - \__msg_kernel_error:nnxx + \__kernel_msg_error:nnxx { kernel } { conditional-form-unknown } {#6} { \token_to_str:c { #1 : #2 } } } @@ -2584,20 +2594,20 @@ #5 {#1} {#2} {#3} {#4} \@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5 } -\__debug_patch:nnNNpn - { \__debug_chk_cs_exist:c { #5 _p : #6 } } { } +\__kernel_patch:nnNNpn + { \__kernel_chk_cs_exist:c { #5 _p : #6 } } { } \cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6 { #2 { #3 _p : #4 } { #5 _p : #6 } } -\__debug_patch:nnNNpn - { \__debug_chk_cs_exist:c { #5 : #6 TF } } { } +\__kernel_patch:nnNNpn + { \__kernel_chk_cs_exist:c { #5 : #6 TF } } { } \cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6 { #2 { #3 : #4 TF } { #5 : #6 TF } } -\__debug_patch:nnNNpn - { \__debug_chk_cs_exist:c { #5 : #6 T } } { } +\__kernel_patch:nnNNpn + { \__kernel_chk_cs_exist:c { #5 : #6 T } } { } \cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6 { #2 { #3 : #4 T } { #5 : #6 T } } -\__debug_patch:nnNNpn - { \__debug_chk_cs_exist:c { #5 : #6 F } } { } +\__kernel_patch:nnNNpn + { \__kernel_chk_cs_exist:c { #5 : #6 F } } { } \cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6 { #2 { #3 : #4 F } { #5 : #6 F } } % \end{macrocode} @@ -2880,14 +2890,14 @@ % only temporary, they will be redefined later on. % % \begin{macro} -% {\__msg_kernel_error:nnxx, \__msg_kernel_error:nnx, \__msg_kernel_error:nn} +% {\__kernel_msg_error:nnxx, \__kernel_msg_error:nnx, \__kernel_msg_error:nn} % If an internal error occurs before \LaTeX3 has loaded \pkg{l3msg} then % the code should issue a usable if terse error message and halt. This % can only happen if a coding error is made by the team, so this is % a reasonable response. Setting the \tn{newlinechar} is needed, to % turn |^^J| into a proper line break in plain \TeX{}. % \begin{macrocode} -\cs_set_protected:Npn \__msg_kernel_error:nnxx #1#2#3#4 +\cs_set_protected:Npn \__kernel_msg_error:nnxx #1#2#3#4 { \tex_newlinechar:D = `\^^J \tex_relax:D \tex_errmessage:D @@ -2900,10 +2910,10 @@ } \tex_end:D } -\cs_set_protected:Npn \__msg_kernel_error:nnx #1#2#3 - { \__msg_kernel_error:nnxx {#1} {#2} {#3} { } } -\cs_set_protected:Npn \__msg_kernel_error:nn #1#2 - { \__msg_kernel_error:nnxx {#1} {#2} { } { } } +\cs_set_protected:Npn \__kernel_msg_error:nnx #1#2#3 + { \__kernel_msg_error:nnxx {#1} {#2} {#3} { } } +\cs_set_protected:Npn \__kernel_msg_error:nn #1#2 + { \__kernel_msg_error:nnxx {#1} {#2} { } { } } % \end{macrocode} % \end{macro} % @@ -2936,13 +2946,13 @@ % issued. We have to make sure we don't put the argument into the % conditional processing since it may be an |\if...| type function! % \begin{macrocode} -\__debug_patch:nnNNpn { } - { \__debug_log:x { Defining~\token_to_str:N #1~ \msg_line_context: } } +\__kernel_patch:nnNNpn { } + { \__kernel_debug_log:x { Defining~\token_to_str:N #1~ \msg_line_context: } } \cs_set_protected:Npn \__chk_if_free_cs:N #1 { \cs_if_free:NF #1 { - \__msg_kernel_error:nnxx { kernel } { command-already-defined } + \__kernel_msg_error:nnxx { kernel } { command-already-defined } { \token_to_str:N #1 } { \token_to_meaning:N #1 } } } @@ -3238,7 +3248,7 @@ { \@@_parm_from_arg_count:nnF { \use:nnn #2 #1 } {#3} { - \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments } + \__kernel_msg_error:nnxx { kernel } { bad-number-of-arguments } { \token_to_str:N #1 } { \int_eval:n {#3} } \use_none:n } @@ -3314,14 +3324,14 @@ \str_if_eq_x:nnF { } { \tl_map_function:nN {#2} \@@_generate_from_signature:n } { - \__msg_kernel_error:nnx { kernel } { non-base-function } + \__kernel_msg_error:nnx { kernel } { non-base-function } { \token_to_str:N #5 } } \cs_generate_from_arg_count:NNnn #5 #4 { \tl_count:n {#2} } {#6} } { - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:N #5 } } } @@ -3452,7 +3462,7 @@ \cs_if_exist:NTF #1 {#2} { - \__msg_kernel_error:nnx { kernel } { variable-not-defined } + \__kernel_msg_error:nnx { kernel } { variable-not-defined } { \token_to_str:N #1 } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index e6262cbd3e8..f4c05b9ab39 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -138,7 +138,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -562,12 +562,6 @@ \global\lccode23 = 23 % \endgroup \fi -% \end{macrocode} -% In all cases it makes sense to set up |-| to map to itself: this allows -% hyphenation of the rest of a word following it (suggested by -% Lars Helstr\"om). -% \begin{macrocode} -\global\lccode`\- = `\- % % % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index fcba0ecaa6f..d214f8551e0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3box.dtx Copyright (C) 2005-2017 The LaTeX3 Project +%% File: l3box.dtx Copyright (C) 2005-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -901,10 +901,10 @@ % \testfile* % Assigning the contents of a box to be another box. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \box_set_eq:NN #1#2 { \tex_setbox:D #1 \tex_copy:D #2 } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \box_gset_eq:NN #1#2 { \tex_global:D \tex_setbox:D #1 \tex_copy:D #2 } \cs_generate_variant:Nn \box_set_eq:NN { c , Nc , cc } @@ -928,10 +928,10 @@ % Assigning the contents of a box to be another box. % This clears the second box globally (that's how \TeX{} does it). % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \box_set_eq_clear:NN #1#2 { \tex_setbox:D #1 \tex_box:D #2 } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \box_gset_eq_clear:NN #1#2 { \tex_global:D \tex_setbox:D #1 \tex_box:D #2 } \cs_generate_variant:Nn \box_set_eq_clear:NN { c , Nc , cc } @@ -1078,10 +1078,10 @@ % \testfile* % Set a box to the previous box. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \box_set_to_last:N #1 { \tex_setbox:D #1 \tex_lastbox:D } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \box_gset_to_last:N #1 { \tex_global:D \tex_setbox:D #1 \tex_lastbox:D } \cs_generate_variant:Nn \box_set_to_last:N { c } @@ -1175,7 +1175,7 @@ \group_end: } { - \__msg_kernel_error:nnx { kernel } { variable-not-defined } + \__kernel_msg_error:nnx { kernel } { variable-not-defined } { \token_to_str:N #2 } } } @@ -1198,10 +1198,10 @@ % \begin{macro}{\hbox_gset:Nn, \hbox_gset:cn} % \testfile* % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_hbox:D { \group_begin: #2 \group_end: } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset:Nn #1#2 { \tex_global:D \tex_setbox:D #1 \tex_hbox:D { \group_begin: #2 \group_end: } } \cs_generate_variant:Nn \hbox_set:Nn { c } @@ -1216,13 +1216,13 @@ % Storing material in a horizontal box with a specified width. % Again, put the dimension expression in parentheses when debugging. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3 { \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} { \group_begin: #3 \group_end: } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset_to_wd:Nnn #1#2#3 { \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} @@ -1241,14 +1241,14 @@ % Storing material in a horizontal box. This type is useful in % environment definitions. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set:Nw #1 { \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token \group_begin: } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset:Nw #1 { \tex_global:D \tex_setbox:D #1 \tex_hbox:D @@ -1272,14 +1272,14 @@ % \begin{macro}{\hbox_gset_to_wd:Nnw, \hbox_gset_to_wd:cnw} % Combining the above ideas. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set_to_wd:Nnw #1#2 { \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} \c_group_begin_token \group_begin: } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset_to_wd:Nnw #1#2 { \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} @@ -1376,13 +1376,13 @@ % \testfile* % Storing material in a vertical box with a natural height. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_vbox:D { \group_begin: #2 \par \group_end: } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset:Nn #1#2 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D @@ -1400,13 +1400,13 @@ % Storing material in a vertical box with a natural height and reference % point at the baseline of the first object in the box. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_top:Nn #1#2 { \tex_setbox:D #1 \tex_vtop:D { \group_begin: #2 \par \group_end: } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_top:Nn #1#2 { \tex_global:D \tex_setbox:D #1 \tex_vtop:D @@ -1423,13 +1423,13 @@ % \testfile* % Storing material in a vertical box with a specified height. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3 { \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} { \group_begin: #3 \par \group_end: } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_to_ht:Nnn #1#2#3 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} @@ -1448,14 +1448,14 @@ % Storing material in a vertical box. This type is useful in % environment definitions. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set:Nw #1 { \tex_setbox:D #1 \tex_vbox:D \c_group_begin_token \group_begin: } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset:Nw #1 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D @@ -1480,14 +1480,14 @@ % \begin{macro}{\vbox_gset_to_ht:Nnw, \vbox_gset_to_ht:cnw} % A combination of the above ideas. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_to_ht:Nnw #1#2 { \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} \c_group_begin_token \group_begin: } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_to_ht:Nnw #1#2 { \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} @@ -1517,7 +1517,7 @@ % \testfile* % Splitting a vertical box in two. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3 { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:n {#3} } % \end{macrocode} @@ -2063,19 +2063,19 @@ % \begin{macro}[deprecated = 2018-12-31]{\box_resize:Nnn, \box_resize:cnn} % \begin{macro}[deprecated = 2018-12-31]{\box_use_clear:N, \box_use_clear:c} % \begin{macrocode} -\__debug_deprecation:nnNNpn +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \box_resize_to_wd_and_ht_plus_dp:Nnn } \cs_new_protected:Npn \box_resize:Nnn { \box_resize_to_wd_and_ht_plus_dp:Nnn } -\__debug_deprecation:nnNNpn +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \box_resize_to_wd_and_ht_plus_dp:cnn } \cs_new_protected:Npn \box_resize:cnn { \box_resize_to_wd_and_ht_plus_dp:cnn } -\__debug_deprecation:nnNNpn - { 2018-12-31 } { \box_use_clear:N } +\__kernel_patch_deprecation:nnNNpn + { 2018-12-31 } { \box_use_drop:N } \cs_new_protected:Npn \box_use_clear:N { \box_use_drop:N } -\__debug_deprecation:nnNNpn - { 2018-12-31 } { \box_use_clear:c } +\__kernel_patch_deprecation:nnNNpn + { 2018-12-31 } { \box_use_drop:c } \cs_new_protected:Npn \box_use_clear:c { \box_use_drop:c } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index e7539a4bec2..e8d226189ac 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3candidates.dtx Copyright (C) 2012-2017 The LaTeX3 Project +%% File: l3candidates.dtx Copyright (C) 2012-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1825,13 +1825,13 @@ \cs_set_protected:Npn \@@_get_details:nnN #1#2#3 { \tl_clear:N #3 - \__msg_kernel_error:nnx + \__kernel_msg_error:nnx { kernel } { xetex-primitive-not-available } { \exp_not:c { pdffile #2 } } } } } -\__msg_kernel_new:nnnn { kernel } { xetex-primitive-not-available } +\__kernel_msg_new:nnnn { kernel } { xetex-primitive-not-available } { Primitive~\token_to_str:N #1 not~available } { XeTeX~does~not~currently~provide~functionality~equivalent~to~the~ @@ -1865,7 +1865,7 @@ % \begin{macro}[deprecated = 2017-12-31]{\file_if_exist_input:nT, \file_if_exist_input:nTF} % For removal after 2017-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2017-12-31 } +\__kernel_patch_deprecation:nnNNpn { 2017-12-31 } { \file_if_exist:nTF and~ \file_input:n } \cs_new_protected:Npn \file_if_exist_input:nTF #1#2#3 { @@ -1873,7 +1873,7 @@ \str_if_empty:NTF \l_@@_full_name_str {#3} { #2 \@@_input:V \l_@@_full_name_str } } -\__debug_deprecation:nnNNpn { 2017-12-31 } +\__kernel_patch_deprecation:nnNNpn { 2017-12-31 } { \file_if_exist:nT and~ \file_input:n } \cs_new_protected:Npn \file_if_exist_input:nT #1#2 { @@ -1918,10 +1918,10 @@ % \begin{macrocode} \cs_if_exist:NTF \pdftex_uniformdeviate:D { - \__debug_patch_args:nNNpn + \__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_rand:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_rand:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_rand:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_rand:nn } } \cs_new:Npn \int_rand:nn #1#2 { @@ -1933,7 +1933,7 @@ { \int_compare:nNnTF {#1} > {#2} { - \__msg_kernel_expandable_error:nnnn + \__kernel_msg_expandable_error:nnnn { kernel } { backward-range } {#1} {#2} \@@_rand:ww #2; #1; } @@ -1968,7 +1968,7 @@ { \cs_new:Npn \int_rand:nn #1#2 { - \__msg_kernel_expandable_error:nn { kernel } { fp-no-random } + \__kernel_msg_expandable_error:nn { kernel } { fp-no-random } \int_eval:n {#1} } } @@ -1980,7 +1980,7 @@ % \begin{macrocode} \cs_if_exist:NT \pdftex_uniformdeviate:D { - \__msg_kernel_new:nnn { kernel } { backward-range } + \__kernel_msg_new:nnn { kernel } { backward-range } { Bounds~ordered~backwards~in~\int_rand:nn {#1}~{#2}. } } % \end{macrocode} @@ -2094,7 +2094,7 @@ % \begin{macro}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn} % A merger between \cs{tl_const:Nn} and \cs{bool_set:Nn}. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \bool_const:Nn #1#2 { \__chk_if_free_cs:N #1 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index f0ee5ad54b5..431df952a3c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1696,7 +1696,7 @@ } } { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#1} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 3f45836f0d6..db42fb4981b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -479,7 +479,7 @@ \coffin_if_exist:NTF #1 { #2 } { - \__msg_kernel_error:nnx { kernel } { unknown-coffin } + \__kernel_msg_error:nnx { kernel } { unknown-coffin } { \token_to_str:N #1 } } } @@ -735,7 +735,7 @@ \prop_get:cnNF { l_@@_poles_ \__int_value:w #1 _prop } {#2} #3 { - \__msg_kernel_error:nnxx { kernel } { unknown-coffin-pole } + \__kernel_msg_error:nnxx { kernel } { unknown-coffin-pole } {#2} { \token_to_str:N #1 } \tl_set:Nn #3 { { 0pt } { 0pt } { 0pt } { 0pt } } } @@ -901,7 +901,7 @@ \l_@@_pole_a_tl \l_@@_pole_b_tl \bool_if:NT \l_@@_error_bool { - \__msg_kernel_error:nn { kernel } { no-pole-intersection } + \__kernel_msg_error:nn { kernel } { no-pole-intersection } \dim_zero:N \l_@@_x_dim \dim_zero:N \l_@@_y_dim } @@ -1695,7 +1695,7 @@ % \subsection{Messages} % % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { no-pole-intersection } +\__kernel_msg_new:nnnn { kernel } { no-pole-intersection } { No~intersection~between~coffin~poles. } { \c__msg_coding_error_text_tl @@ -1703,17 +1703,17 @@ but~they~do~not~have~a~unique~meeting~point:~ the~value~(0~pt,~0~pt)~will~be~used. } -\__msg_kernel_new:nnnn { kernel } { unknown-coffin } +\__kernel_msg_new:nnnn { kernel } { unknown-coffin } { Unknown~coffin~'#1'. } { The~coffin~'#1'~was~never~defined. } -\__msg_kernel_new:nnnn { kernel } { unknown-coffin-pole } +\__kernel_msg_new:nnnn { kernel } { unknown-coffin-pole } { Pole~'#1'~unknown~for~coffin~'#2'. } { \c__msg_coding_error_text_tl LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~ but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong. } -\__msg_kernel_new:nnn { kernel } { show-coffin } +\__kernel_msg_new:nnn { kernel } { show-coffin } { Size~of~coffin~#1 : #2 \\ Poles~of~coffin~#1 : #3 . diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx new file mode 100644 index 00000000000..b3e88c1a7ee --- /dev/null +++ b/Master/texmf-dist/source/latex/l3kernel/l3color-base.dtx @@ -0,0 +1,199 @@ +% \iffalse meta-comment +% +%% File: l3color-base.dtx Copyright(C) 2011,2012,2014,2016-2018 The LaTeX3 Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% This file is part of the "l3kernel bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/latex3 +% +% for those people who are interested. +% +%<*driver> +\documentclass[full,kernel]{l3doc} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \title{^^A +% The \textsf{l3color-base} package\\ Color support^^A +% } +% +% \author{^^A +% The \LaTeX3 Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Released 2018/02/21} +% +% \maketitle +% +% \begin{documentation} +% +% This module provides support for color in \LaTeX3{}. At present, the +% material here is mainly intended to support a small number of low-level +% requirements in other \pkg{l3kernel} modules. +% +% \section{Color in boxes} +% +% Controlling the color of text in boxes requires a small number of control +% functions, so that the boxed material uses the color at the point where +% it is set, rather than where it is used. +% +% \begin{function}[added = 2011-09-03]{\color_group_begin:, \color_group_end:} +% \begin{syntax} +% \cs{color_group_begin:} +% \ldots +% \cs{color_group_end:} +% \end{syntax} +% Creates a color group: one used to \enquote{trap} color settings. +% \end{function} +% +% \begin{function}[added = 2011-09-03]{\color_ensure_current:} +% \begin{syntax} +% \cs{color_ensure_current:} +% \end{syntax} +% Ensures that material inside a box uses the foreground color +% at the point where the box is set, rather than that in force when the +% box is used. This function should usually be used within a +% \cs{color_group_begin:} \ldots \cs{color_group_end:} group. +% \end{function} +% +% \subsection{Internal functions} +% +% \begin{variable}[added = 2017-06-15, updated = 2017-10-02] +% {\l_@@_current_tl} +% The color currently active for foreground (text, \emph{etc.}) material. +% This is stored in the form of a color model followed by one or more +% values. There are four pre-defined models, three of which take numerical +% values in the range $[0,1]$: +% \begin{itemize} +% \item \texttt{gray \meta{gray}} Grayscale color with the \meta{gray} +% value running from $0$ (fully black) to $1$ (fully white) +% \item \texttt{cmyk \meta{cyan} \meta{magenta} \meta{yellow} \meta{black}} +% \item \texttt{rgb \meta{red} \meta{green} \meta{blue}} +% \end{itemize} +% Notice that the value are separated by spaces. There is a fourth pre-defined +% model using a string value and a numerical one: +% \begin{itemize} +% \item \texttt{spot \meta{name} \meta{tint}} A pre-defined spot color, +% where the \meta{name} should be a pre-defined string color name and the +% \meta{tint} should be in the range $[0,1]$. +% \end{itemize} +% +% Additional models may be created to allow mixing of spot colors. The +% number of data entries these require will depend on the number of +% colors to be mixed. +% \begin{texnote} +% The content of \cs{l_@@_current_tl} is space-separated as +% this allows it to be used directly in specials in many common cases. +% This internal representation is close to that used by the \texttt{dvips} +% program. +% \end{texnote} +% \end{variable} +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3color-base} Implementation} +% +% \begin{macrocode} +%<*initex|package> +% \end{macrocode} +% +% \begin{macrocode} +%<@@=color> +% \end{macrocode} +% +% \begin{macro}{\color_group_begin:, \color_group_end:} +% Grouping for color is almost the same as using the basic \cs{group_begin:} +% and \cs{group_end:} functions. However, in vertical mode the end-of-group +% needs a \tn{par}, which in horizontal mode does nothing. +% \begin{macrocode} +\cs_new_eq:NN \color_group_begin: \group_begin: +\cs_new_protected:Npn \color_group_end: + { + \par + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\color_ensure_current:} +% A driver-independent wrapper for setting the foreground color to the +% current color \enquote{now}. +% \begin{macrocode} +\cs_new_protected:Npn \color_ensure_current: + { +%<*package> + \driver_color_pickup:N \l_@@_current_tl +% + \@@_select:V \l_@@_current_tl + \group_insert_after:N \driver_color_reset: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_select:n, \@@_select:V} +% \begin{macro}{\@@_select:w} +% \begin{macro} +% {\@@_select_cmyk:w, \@@_select_gray:w, \@@_select_rgb:w, \@@_select_spot:w} +% Take an internal color specification and pass it to the driver. This code +% is needed to ensure the current color but will also be used by the +% higher-level experimental material. +% \begin{macrocode} +\cs_new_protected:Npn \@@_select:n #1 + { \@@_select:w #1 \q_stop } +\cs_generate_variant:Nn \@@_select:n { V } +\cs_new_protected:Npn \@@_select:w #1 ~ #2 \q_stop + { \use:c { @@_select_ #1 :w } #2 \q_stop } +\cs_new_protected:Npn \@@_select_cmyk:w #1 ~ #2 ~ #3 ~ #4 \q_stop + { \driver_color_cmyk:nnnn {#1} {#2} {#3} {#4} } +\cs_new_protected:Npn \@@_select_gray:w #1 \q_stop + { \driver_color_gray:n {#1} } +\cs_new_protected:Npn \@@_select_rgb:w #1 ~ #2 ~ #3 \q_stop + { \driver_color_rgb:nnn {#1} {#2} {#3} } +\cs_new_protected:Npn \@@_select_spot:w #1 ~ #2 \q_stop + { \driver_color_spot:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{variable}{\l_@@_current_tl} +% As the setting data is used only +% for specials, and those are always space-separated, it makes most sense to +% hold the internal information in that form. Any splitting is done by a +% delimited function but often the entire \texttt{tl} can be used as-is: +% see \texttt{l3drivers.dtx}. +% \begin{macrocode} +\tl_new:N \l_@@_current_tl +\tl_set:Nn \l_@@_current_tl { gray~0 } +% \end{macrocode} +% \end{variable} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx deleted file mode 100644 index 9ed12f0f551..00000000000 --- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx +++ /dev/null @@ -1,169 +0,0 @@ -% \iffalse meta-comment -% -%% File: l3color.dtx Copyright(C) 2011,2012,2014,2016,2017 The LaTeX3 Project -% -% It may be distributed and/or modified under the conditions of the -% LaTeX Project Public License (LPPL), either version 1.3c of this -% license or (at your option) any later version. The latest version -% of this license is in the file -% -% https://www.latex-project.org/lppl.txt -% -% This file is part of the "l3kernel bundle" (The Work in LPPL) -% and all files in that bundle must be distributed together. -% -% ----------------------------------------------------------------------- -% -% The development version of the bundle can be found at -% -% https://github.com/latex3/latex3 -% -% for those people who are interested. -% -%<*driver> -\documentclass[full,kernel]{l3doc} -\begin{document} - \DocInput{\jobname.dtx} -\end{document} -% -% \fi -% -% \title{^^A -% The \textsf{l3color} package\\ Color support^^A -% } -% -% \author{^^A -% The \LaTeX3 Project\thanks -% {^^A -% E-mail: -% \href{mailto:latex-team@latex-project.org} -% {latex-team@latex-project.org}^^A -% }^^A -% } -% -% \date{Released 2017/12/16} -% -% \maketitle -% -% \begin{documentation} -% -% This module provides support for color in \LaTeX3{}. At present, the -% material here is mainly intended to support a small number of low-level -% requirements in other \pkg{l3kernel} modules. -% -% \section{Color in boxes} -% -% Controlling the color of text in boxes requires a small number of control -% functions, so that the boxed material uses the color at the point where -% it is set, rather than where it is used. -% -% \begin{function}[added = 2011-09-03]{\color_group_begin:, \color_group_end:} -% \begin{syntax} -% \cs{color_group_begin:} -% \ldots -% \cs{color_group_end:} -% \end{syntax} -% Creates a color group: one used to \enquote{trap} color settings. -% \end{function} -% -% \begin{function}[added = 2011-09-03]{\color_ensure_current:} -% \begin{syntax} -% \cs{color_ensure_current:} -% \end{syntax} -% Ensures that material inside a box uses the foreground color -% at the point where the box is set, rather than that in force when the -% box is used. This function should usually be used within a -% \cs{color_group_begin:} \ldots \cs{color_group_end:} group. -% \end{function} -% -% \subsection{Internal functions} -% -% \begin{variable}[added = 2017-06-15, updated = 2017-10-02] -% {\l__color_current_tl} -% The color currently active for foreground (text, \emph{etc.}) material. -% This is stored in the form of a color model followed by one or more -% values. There are four pre-defined models, three of which take numerical -% values in the range $[0,1]$: -% \begin{itemize} -% \item \texttt{gray \meta{gray}} Grayscale color with the \meta{gray} -% value running from $0$ (fully black) to $1$ (fully white) -% \item \texttt{cmyk \meta{cyan} \meta{magenta} \meta{yellow} \meta{black}} -% \item \texttt{rgb \meta{red} \meta{green} \meta{blue}} -% \end{itemize} -% Notice that the value are separated by spaces. There is a fourth pre-defined -% model using a string value and a numerical one: -% \begin{itemize} -% \item \texttt{spot \meta{name} \meta{tint}} A pre-defined spot color, -% where the \meta{name} should be a pre-defined string color name and the -% \meta{tint} should be in the range $[0,1]$. -% \end{itemize} -% -% Additional models may be created to allow mixing of spot colors. The -% number of data entries these require will depend on the number of -% colors to be mixed. -% \begin{texnote} -% The content of \cs{l__color_current_tl} is space-separated as -% this allows it to be used directly in specials in many common cases. -% This internal representation is close to that used by the \texttt{dvips} -% program. -% \end{texnote} -% \end{variable} -% -% \end{documentation} -% -% \begin{implementation} -% -% \section{\pkg{l3color} Implementation} -% -% \begin{macrocode} -%<*initex|package> -% \end{macrocode} -% -% \begin{macro}{\color_group_begin:, \color_group_end:} -% Grouping for color is almost the same as using the basic \cs{group_begin:} -% and \cs{group_end:} functions. However, in vertical mode the end-of-group -% needs a \tn{par}, which in horizontal mode does nothing. -% \begin{macrocode} -\cs_new_eq:NN \color_group_begin: \group_begin: -\cs_new_protected:Npn \color_group_end: - { - \par - \group_end: - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\color_ensure_current:} -% A driver-independent wrapper for setting the foreground color to the -% current color \enquote{now}. -% \begin{macrocode} -\cs_new_protected:Npn \color_ensure_current: - { -%<*package> - \__driver_color_pickup:N \l__color_current_tl -% - \__driver_color_select:V \l__color_current_tl - \group_insert_after:N \__driver_color_reset: - } -% \end{macrocode} -% \end{macro} -% -% \begin{variable}{\l__color_current_tl} -% As the setting data is used only -% for specials, and those are always space-separated, it makes most sense to -% hold the internal information in that form. Any splitting is done by a -% delimited function but often the entire \texttt{tl} can be used as-is: -% see \texttt{l3drivers.dtx}. -% \begin{macrocode} -\tl_new:N \l__color_current_tl -\tl_set:Nn \l__color_current_tl { gray~0 } -% \end{macrocode} -% \end{variable} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \end{implementation} -% -% \PrintIndex diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index c4bfa10758a..1ab74d3b67b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3deprecation.dtx (C) Copyright 2017 The LaTeX3 Project +%% File: l3deprecation.dtx (C) Copyright 2017-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -75,10 +75,10 @@ { \etex_protected:D \tex_outer:D \tex_edef:D #1 { - \exp_not:N \__msg_kernel_expandable_error:nnnnn + \exp_not:N \__kernel_msg_expandable_error:nnnnn { kernel } { deprecated-command } { \tl_to_str:n {#3} } { \token_to_str:N #1 } { \tl_to_str:n {#2} } - \exp_not:N \__msg_kernel_error:nnxxx + \exp_not:N \__kernel_msg_error:nnxxx { kernel } { deprecated-command } { \tl_to_str:n {#3} } { \token_to_str:N #1 } { \tl_to_str:n {#2} } } @@ -120,20 +120,15 @@ % This is left-over from \pkg{l3expan}. It cannot be done there because % \pkg{l3tl} is not loaded at that time. % \begin{macrocode} -\__debug:TF +\__kernel_deprecation_code:nn { - \tl_gput_right:Nn \g__debug_deprecation_on_tl - { - \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx - { \__msg_kernel_error:nnxxxx } - } - \tl_gput_right:Nn \g__debug_deprecation_off_tl - { - \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx - { \__msg_kernel_warning:nnxxxx } - } + \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx + { \__kernel_msg_error:nnxxxx } + } + { + \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx + { \__kernel_msg_warning:nnxxxx } } - { } % \end{macrocode} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 7f600a15642..4341ff018a1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3doc.dtx Copyright (C) 1990-2017 The LaTeX3 project +%% File: l3doc.dtx Copyright (C) 1990-2018 The LaTeX3 project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -70,14 +70,14 @@ and all files in that bundle must be distributed together. % This isn't included in the typeset documentation because it's a bit % ugly: %<*class> -\ProvidesExplClass{l3doc}{2017/12/16}{} +\ProvidesExplClass{l3doc}{2018/02/21}{} {L3 Experimental documentation class} % % \fi % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % \maketitle % \tableofcontents % @@ -949,7 +949,7 @@ and all files in that bundle must be distributed together. \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o } \cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o } \cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V } -\cs_generate_variant:Nn \tl_if_in:nnTF { no } +\cs_generate_variant:Nn \tl_if_in:nnTF { no , oo } \cs_generate_variant:Nn \tl_if_in:NnTF { No } \cs_generate_variant:Nn \tl_if_in:NnT { No } \cs_generate_variant:Nn \tl_if_in:NnF { No } @@ -995,6 +995,22 @@ and all files in that bundle must be distributed together. % \end{macrocode} % \end{macro} % +% \begin{macro}[TF]{\@@_str_if_begin:nn, \@@_str_if_begin:oo} +% True if the first string starts with the second. +% \begin{macrocode} +\prg_new_protected_conditional:Npnn \@@_str_if_begin:nn #1#2 { TF , T , F } + { + \tl_if_in:ooTF + { \exp_after:wN \scan_stop: \tl_to_str:n {#1} } + { \exp_after:wN \scan_stop: \tl_to_str:n {#2} } + { \prg_return_true: } + { \prg_return_false: } + } +\prg_generate_conditional_variant:Nnn \@@_str_if_begin:nn + { oo } { TF , T , F } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_replace_at_at:N} % \begin{macro}{\@@_replace_at_at_aux:Nn} % The goal is to replace |@@| by the current module name. We take @@ -1035,14 +1051,16 @@ and all files in that bundle must be distributed together. % \end{macro} % \end{macro} % -% \begin{macro}{\@@_detect_internals:N} +% \begin{macro}{\@@_detect_internals:N, \@@_if_detect_internals_ok:NF} % After splitting at each |__| and removing the leading item from the % sequence (since it does not follow |__|), remove everything after % any space or end-of-line to get a good approximation of the control -% sequence (for the warning message), then remove anything after any -% |_| or |:| (with either catcode) to get the module name. If that -% name is not empty and differs from the current |@@| name then -% complain. +% sequence (for the warning message). Then check if that starts with +% something allowed: |@@| module name and |:| or |_|, or if the +% relevant boolean is set |kernel_| (it seems safe to assume we will +% not define a |\__kernel:...| command). For the message itself +% remove anything after any |_| or |:| (with either catcode) to get a +% guess of the module name. % \begin{macrocode} \group_begin: \char_set_catcode_active:N \^^M @@ -1057,32 +1075,38 @@ and all files in that bundle must be distributed together. \@@_trim_right:No \l_@@_detect_internals_tl \c_catcode_active_space_tl \@@_trim_right:Nn \l_@@_detect_internals_tl ^^M - \tl_set_eq:NN \l_@@_detect_internals_cs_tl \l_@@_detect_internals_tl - \@@_trim_right:Nn \l_@@_detect_internals_tl _ - \@@_trim_right:Nn \l_@@_detect_internals_tl : - \@@_trim_right:No \l_@@_detect_internals_tl { \token_to_str:N : } - \tl_if_empty:NF \l_@@_detect_internals_tl + \@@_if_detect_internals_ok:NF \l_@@_detect_internals_tl { - \str_if_eq:NNF \l_@@_detect_internals_tl \g_@@_module_name_tl - { - \bool_lazy_and:nnF - { \g_@@_kernel_bool } - { - \str_if_eq_x_p:nn - { \tl_to_str:N \l_@@_detect_internals_tl } - { kernel } - } - { - \msg_warning:nnxxx { l3doc } { foreign-internal } - { \tl_to_str:N \l_@@_detect_internals_cs_tl } - { \tl_to_str:N \l_@@_detect_internals_tl } - { \tl_to_str:N \g_@@_module_name_tl } - } - } + \tl_set_eq:NN \l_@@_detect_internals_cs_tl \l_@@_detect_internals_tl + \@@_trim_right:Nn \l_@@_detect_internals_tl _ + \@@_trim_right:Nn \l_@@_detect_internals_tl : + \@@_trim_right:No \l_@@_detect_internals_tl { \token_to_str:N : } + \msg_warning:nnxxx { l3doc } { foreign-internal } + { \tl_to_str:N \l_@@_detect_internals_cs_tl } + { \tl_to_str:N \l_@@_detect_internals_tl } + { \tl_to_str:N \g_@@_module_name_tl } } } } \group_end: +\prg_new_protected_conditional:Npnn \@@_if_detect_internals_ok:N #1 { F } + { + \@@_str_if_begin:ooTF {#1} { \g_@@_module_name_tl _ } + { \prg_return_true: } + { + \@@_str_if_begin:ooTF {#1} { \g_@@_module_name_tl : } + { \prg_return_true: } + { + \bool_if:NTF \g_@@_kernel_bool + { + \@@_str_if_begin:ooTF {#1} { kernel _ } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_false: } + } + } + } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index d11bd14e7f9..5295a5553fd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx index 5ccd56959c7..8b5aa7d53c1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx @@ -22,10 +22,6 @@ % %<*driver> \documentclass[full,kernel]{l3doc} -% -%<*driver|package> -% -%<*driver> \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -45,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -126,20 +122,50 @@ % % \section{Color support} % -% \begin{function}[added = 2017-10-25] -% {\__driver_color_select:n, \__driver_color_select:V} +% \begin{function}[added = 2018-02-20]{\driver_color_cmyk:nnnn} +% \begin{syntax} +% \cs{driver_color_cmyk:nnnn} \Arg{cyan} \Arg{magenta} \Arg{yellow} +% \Arg{black} +% \end{syntax} +% Sets the color to the CMYK values specified, all of which are +% fp denotations in the range $0$ and $1$. For drawing colors, see +% \cs{driver_draw_color_cmyk:nnnn}, \emph{etc.} +% \end{function} +% +% \begin{function}[added = 2018-02-20]{\driver_color_gray:n} +% \begin{syntax} +% \cs{driver_color_gray:n} \Arg{gray} +% \end{syntax} +% Sets the color to the grayscale value specified, which is +% fp denotations in the range $0$ and $1$. For drawing colors, see +% \cs{driver_draw_color_gray:n}, \emph{etc.} +% \end{function} +% +% \begin{function}[added = 2018-02-20]{\driver_color_rgb:nnn} % \begin{syntax} -% \cs{__driver_color_select:n} \Arg{color} +% \cs{driver_color_rgb:nnn} \Arg{red} \Arg{green} \Arg{blue} % \end{syntax} -% Selects the \meta{color} (which is given in low-level format: a -% \meta{model} followed by a space and one or more space-separated -% axes). +% Sets the color to the RGB values specified, all of which are +% fp denotations in the range $0$ and $1$. For drawing colors, see +% \cs{driver_draw_color_rgb:nnn}, \emph{etc.} % \end{function} % -% \begin{function}[added = 2017-10-25] -% {\__driver_color_pickup:N} +% \begin{function}[added = 2018-02-20]{\driver_color_reset:} % \begin{syntax} -% \cs{__driver_color_pickup:N} \meta{tl} +% \cs{driver_color_reset:} +% \end{syntax} +% Resets the active color to that before a call to +% \cs{driver_color_\meta{model}:n(nnn)}. This function should be inserted +% after the \TeX{} group setting a color, \emph{i.e.}~normally +% \begin{verbatim} +% % Use of \driver_color_rgb:nnn, etc. +% \group_insert_after:N \driver_color_reset: +% \end{verbatim} +% \end{function} +% +% \begin{function}[added = 2018-02-20]{\driver_color_pickup:N} +% \begin{syntax} +% \cs{driver_color_pickup:N} \meta{tl} % \end{syntax} % In \LaTeXe{} package mode, collects data on the current color from % \tn{current@color} and stores it in the low-level format used by \pkg{expl3} @@ -383,11 +409,11 @@ % \driver_draw_stroke_cmyk:nnnn % } % \begin{syntax} -% \cs{driver_draw_color_cmyk:nnnn} \Arg{cyan} \Arg{magneta} \Arg{yellow} +% \cs{driver_draw_color_cmyk:nnnn} \Arg{cyan} \Arg{magenta} \Arg{yellow} % \Arg{black} % \end{syntax} % Sets the color for drawing to the CMYK values specified, all of which are -% fp expressions which should evaluate to between $0$ and $1$. The +% fp denotations in the range $0$ and $1$. The % \texttt{fill} and \texttt{stroke} versions set only the color for those % operations. Note that the general setting is more efficient with some % drivers so should in most cases be preferred. @@ -403,7 +429,7 @@ % \cs{driver_draw_color_gray:n} \Arg{gray} % \end{syntax} % Sets the color for drawing to the grayscale value specified, which is -% fp expressions which should evaluate to between $0$ and $1$. The +% fp denotations in the range $0$ and $1$. The % \texttt{fill} and \texttt{stroke} versions set only the color for those % operations. Note that the general setting is more efficient with some % drivers so should in most cases be preferred. @@ -419,7 +445,7 @@ % \cs{driver_draw_color_rgb:nnn} \Arg{red} \Arg{green} \Arg{blue} % \end{syntax} % Sets the color for drawing to the RGB values specified, all of which are -% fp expressions which should evaluate to between $0$ and $1$. The +% fp denotations in the range $0$ and $1$. The % \texttt{fill} and \texttt{stroke} versions set only the color for those % operations. Note that the general setting is more efficient with some % drivers so should in most cases be preferred. @@ -521,18 +547,19 @@ %<*dvisvgm|dvipdfmx|dvips|xdvipdfmx> % \end{macrocode} % -% \begin{macro}{\@@_color_pickup:N} +% \begin{macro}{\driver_color_pickup:N} +% \begin{macro}{\@@_color_pickup:w} % Allow for \LaTeXe{} color. Here, the possible input values are limited: % \texttt{dvips}-style colors can mainly be taken as-is with the exception % spot ones (here we need a model and a tint). % \begin{macrocode} %<*package> -\cs_new_protected:Npn \@@_color_pickup:N #1 { } +\cs_new_protected:Npn \driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_set_protected:Npn \@@_color_pickup:N #1 + \cs_set_protected:Npn \driver_color_pickup:N #1 { \exp_args:NV \tl_if_head_is_space:nTF \current@color { @@ -542,9 +569,9 @@ \exp_after:wN \use:n \current@color \c_space_tl 1 } } - { \exp_after:wN \@@_color_pickup_aux:w \current@color \q_stop #1 } + { \exp_after:wN \@@_color_pickup:w \current@color \q_stop #1 } } - \cs_new_protected:Npn \@@_color_pickup_aux:w #1 ~ #2 \q_stop #3 + \cs_new_protected:Npn \@@_color_pickup:w #1 ~ #2 \q_stop #3 { \tl_set:Nn #3 { #1 ~ #2 } } } { } @@ -552,36 +579,27 @@ % % \end{macrocode} % \end{macro} +% \end{macro} % -% \begin{macro}{\@@_color_select:n, \@@_color_select:V} -% \begin{macro}[EXP]{\@@_convert_model:w} -% \begin{macro}[EXP]{\@@_color_convert_spot:} -% \begin{macro}[EXP]{\@@_color_convert_spot:w} -% \begin{macro}{\@@_color_reset:} -% Mainly no conversation but a little work with \texttt{spot} colors as they -% can't have a tint level here! The easy route of just picking up -% \texttt{spot} as a model won't work as there could be additional models -% created for mixing named colors. (They would not be supported at the moment, -% but still need to be handled.) +% \begin{macro}{\driver_color_cmyk:nnnn} +% \begin{macro}{\driver_color_gray:n} +% \begin{macro}{\driver_color_rgb:nnn} +% \begin{macro}{\driver_color_spot:nn} +% \begin{macro}{\@@_color_select:n} +% \begin{macro}{\driver_color_reset:} +% Simply dump the data. % \begin{macrocode} +\cs_new_protected:Npn \driver_color_cmyk:nnnn #1#2#3#4 + { \@@_color_select:n { cmyk~ #1 ~ #2 ~ #3 ~ #4 } } +\cs_new_protected:Npn \driver_color_gray:n #1 + { \@@_color_select:n { gray~ #1 } } +\cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3 + { \@@_color_select:n { rgb~ #1 ~ #2 ~ #3 } } +\cs_new_protected:Npn \driver_color_spot:nn #1#2 + { \@@_color_select:n { color~push~\c_space_tl #1 } } \cs_new_protected:Npn \@@_color_select:n #1 - { - \tex_special:D - { - color~push~ - \cs_if_exist_use:cF - { @@_color_convert_ \@@_convert_model:w #1 \q_stop :n } - { \use:n } - {#1} - } - } -\cs_generate_variant:Nn \@@_color_select:n { V } -\cs_new:Npn \@@_convert_model:w #1 ~ #2 \q_stop {#1} -\cs_new:Npn \@@_color_convert_spot:n #1 - { \@@_color_convert_spot:w #1 \q_stop } -\cs_new:Npn \@@_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop - { \c_space_tl #2 } -\cs_new_protected:Npn \@@_color_reset: + { \tex_special:D { color~push~ #1 } } +\cs_new_protected:Npn \driver_color_reset: { \tex_special:D { color~pop } } % \end{macrocode} % \end{macro} @@ -589,6 +607,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macrocode} % @@ -600,27 +619,27 @@ %<*pdfmode> % \end{macrocode} % -% \begin{macro}{\@@_color_pickup:N} -% \begin{macro}{\@@_color_pickup_aux:w} +% \begin{macro}{\driver_color_pickup:N} +% \begin{macro}{\@@_color_pickup:w} % The current color in driver-dependent format: pick up the package-mode % data if available. We end up converting back and forward in this route as % we store our color data in \texttt{dvips} format. % The \tn{current@color} needs to be \texttt{x}-expanded before -% \cs{@@_color_pickup_aux:w} breaks it apart, because for instance +% \cs{@@_color_pickup:w} breaks it apart, because for instance % \pkg{xcolor} sets it to be instructions to generate a colour % \begin{macrocode} %<*package> -\cs_new_protected:Npn \@@_color_pickup:N #1 { } +\cs_new_protected:Npn \driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_set_protected:Npn \@@_color_pickup:N #1 + \cs_set_protected:Npn \driver_color_pickup:N #1 { - \exp_last_unbraced:Nx \@@_color_pickup_aux:w + \exp_last_unbraced:Nx \@@_color_pickup:w { \current@color } ~ 0 ~ 0 ~ 0 \q_stop #1 } - \cs_new_protected:Npn \@@_color_pickup_aux:w + \cs_new_protected:Npn \@@_color_pickup:w #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \q_stop #7 { \str_if_eq:nnTF {#2} { g } @@ -659,47 +678,30 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_color_select:n, \@@_color_select:V} -% \begin{macro}[EXP]{\@@_color_convert:w} -% \begin{macro}[EXP] -% { -% \@@_color_convert_gray:w , -% \@@_color_convert_cmyk:w , -% \@@_color_convert_rgb:w , -% \@@_color_convert_spot:w -% } -% \begin{macro}{\@@_color_reset:} -% There is a dedicated primitive/primitive interface for setting colors. -% As with scoping, this approach is not suitable for cached operations. -% Most of the conversions are trivial but the need to cover spot colors -% makes life slightly more interesting. -% \begin{macrocode} +% \begin{macro}{\driver_color_cmyk:nnnn} +% \begin{macro}{\driver_color_gray:n} +% \begin{macro}{\driver_color_rgb:nnn} +% \begin{macro}{\driver_color_spot:nn} +% \begin{macro}{\@@_color_select:n} +% \begin{macro}{\driver_color_reset:} +% Simply dump the data, but allowing for \LuaTeX{}. +% \begin{macrocode} +\cs_new_protected:Npn \driver_color_cmyk:nnnn #1#2#3#4 + { \@@_color_select:n { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } } +\cs_new_protected:Npn \driver_color_gray:n #1 + { \@@_color_select:n { #1 ~ g ~ #1 ~ G } } +\cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3 + { \@@_color_select:n { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } } +\cs_new_protected:Npn \driver_color_spot:nn #1#2 + { \@@_color_select:n { /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC } } \cs_new_protected:Npx \@@_color_select:n #1 { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } { \pdftex_pdfcolorstack:D } - \exp_not:N \l_@@_color_stack_int push - { - \exp_not:N \@@_color_convert:w - #1 - \exp_not:N \q_stop - } - } -\cs_generate_variant:Nn \@@_color_select:n { V } -\cs_new:Npn \@@_color_convert:w #1 ~ #2 \q_stop - { \use:c { @@_color_convert_ #1 :w } #2 \q_stop } -\cs_new:Npn \@@_color_convert_gray:w #1 \q_stop - { #1 ~ g ~ #1 ~ G } -\cs_new:Npn \@@_color_convert_cmyk:w #1 \q_stop - { #1 ~ k ~ #1 ~ K } -\cs_new:Npn \@@_color_convert_rgb:w #1 \q_stop - { #1 ~ rg ~ #1 ~ RG } -\cs_new:Npn \@@_color_convert_spot:w #1 ~ #2 \q_stop - { - /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC + \exp_not:N \l_@@_color_stack_int push {#1} } -\cs_new_protected:Npx \@@_color_reset: +\cs_new_protected:Npx \driver_color_reset: { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } @@ -711,6 +713,8 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % % \begin{macrocode} % @@ -1107,7 +1111,7 @@ { \dim_to_decimal_in_bp:n {#1} ~ setlinewidth } } \cs_new_protected:Npn \driver_draw_miterlimit:n #1 - { \@@_draw_literal:x { \fp_eval:n {#1} ~ setmiterlimit } } + { \@@_draw_literal:n { #1 ~ setmiterlimit } } \cs_new_protected:Npn \driver_draw_cap_butt: { \@@_draw_literal:n { 0 ~ setlinecap } } \cs_new_protected:Npn \driver_draw_cap_round: @@ -1158,81 +1162,42 @@ } \cs_new_protected:Npn \driver_draw_color_cmyk:nnnn #1#2#3#4 { - \@@_draw_literal:x - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ - setcmykcolor ~ - } + \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ setcmykcolor } \@@_draw_color_reset: } \cs_new_protected:Npn \driver_draw_fill_cmyk:nnnn #1#2#3#4 { - \@@_draw_literal:x - { - /l3fc ~ - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ - setcmykcolor - } ~ - def - } + \@@_draw_literal:n + { /l3fc ~ { #1 ~ #2 ~ #3 ~ #4 ~ setcmykcolor ~ } ~ def } } \cs_new_protected:Npn \driver_draw_stroke_cmyk:nnnn #1#2#3#4 { - \@@_draw_literal:x - { - /l3sc ~ - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ - setcmykcolor - } ~ - def - } + \@@_draw_literal:n + { /l3sc ~ { #1 ~ #2 ~ #3 ~ #4 ~ setcmykcolor ~ } ~ def } } \cs_new_protected:Npn \driver_draw_color_gray:n #1 { - \@@_draw_literal:x { fp_eval:n {#1} ~ setgray } + \@@_draw_literal:n { #1 ~ setgray } \@@_draw_color_reset: } \cs_new_protected:Npn \driver_draw_fill_gray:n #1 - { \@@_draw_literal:x { /l3fc ~ { \fp_eval:n {#1} ~ setgray } ~ def } } + { \@@_draw_literal:n { /l3fc ~ { #1 ~ setgray } ~ def } } \cs_new_protected:Npn \driver_draw_stroke_gray:n #1 - { \@@_draw_literal:x { /l3sc ~ { \fp_eval:n {#1} ~ setgray } ~ def } } + { \@@_draw_literal:n { /l3sc ~ { #1 ~ setgray } ~ def } } \cs_new_protected:Npn \driver_draw_color_rgb:nnn #1#2#3 { - \@@_draw_literal:x - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ - setrgbcolor - } + \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ setrgbcolor } \@@_draw_color_reset: } \cs_new_protected:Npn \driver_draw_fill_rgb:nnn #1#2#3 { - \@@_draw_literal:x - { - /l3fc ~ - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ - setrgbcolor - } ~ - def - } + \@@_draw_literal:n + { /l3fc ~ { #1 ~ #2 ~ #3 ~ setrgbcolor } ~ def } } \cs_new_protected:Npn \driver_draw_stroke_rgb:nnn #1#2#3 { - \@@_draw_literal:x - { - /l3sc ~ - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ - setrgbcolor - } ~ - def - } + \@@_draw_literal:n + { /l3sc ~ { #1 ~ #2 ~ #3 ~ setrgbcolor } ~ def } } % \end{macrocode} % \end{macro} @@ -1250,8 +1215,7 @@ \@@_draw_literal:x { [ - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + #1 ~ #2 ~ #3 ~ #4 ~ \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~ ] ~ concat @@ -2067,7 +2031,7 @@ { \dim_to_decimal_in_bp:n {#1} ~ w } } \cs_new_protected:Npn \driver_draw_miterlimit:n #1 - { \@@_draw_literal:x { \fp_eval:n {#1} ~ M } } + { \@@_draw_literal:x { #1 ~ M } } \cs_new_protected:Npn \driver_draw_cap_butt: { \@@_draw_literal:n { 0 ~ J } } \cs_new_protected:Npn \driver_draw_cap_round: @@ -2093,103 +2057,51 @@ % \driver_draw_fill_cmyk:nnnn , % \driver_draw_stroke_cmyk:nnnn % } -% \begin{macro}{\@@_draw_color_cmyk_aux:nnnn} % \begin{macro} % { % \driver_draw_color_gray:n , % \driver_draw_fill_gray:n , % \driver_draw_stroke_gray:n % } -% \begin{macro}{\@@_draw_color_gray_aux:n} % \begin{macro} % { % \driver_draw_color_rgb:nnn , % \driver_draw_fill_rgb:nnn , % \driver_draw_stroke_rgb:nnn % } -% \begin{macro}{\@@_draw_color_rgb_aux:nnn} % Yet more fast conversion, all using the FPU to allow for expressions % in numerical input. % \begin{macrocode} \cs_new_protected:Npn \driver_draw_color_cmyk:nnnn #1#2#3#4 - { - \use:x - { - \@@_draw_color_cmyk_aux:nnnn - { \fp_eval:n {#1} } - { \fp_eval:n {#2} } - { \fp_eval:n {#3} } - { \fp_eval:n {#4} } - } - } -\cs_new_protected:Npn \@@_draw_color_cmyk_aux:nnnn #1#2#3#4 { \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } } \cs_new_protected:Npn \driver_draw_fill_cmyk:nnnn #1#2#3#4 { - \@@_draw_literal:x - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ - k - } + \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ k } } \cs_new_protected:Npn \driver_draw_stroke_cmyk:nnnn #1#2#3#4 - { - \@@_draw_literal:x - { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ - K - } - } + { \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ K } } \cs_new_protected:Npn \driver_draw_color_gray:n #1 - { - \use:x - { \@@_draw_color_gray_aux:n { \fp_eval:n {#1} } } - } -\cs_new_protected:Npn \@@_draw_color_gray_aux:n #1 - { - \@@_draw_literal:n { #1 ~ g ~ #1 ~ G } - } + { \@@_draw_literal:n { #1 ~ g ~ #1 ~ G } } \cs_new_protected:Npn \driver_draw_fill_gray:n #1 - { \@@_draw_literal:x { \fp_eval:n {#1} ~ g } } + { \@@_draw_literal:n { #1 ~ g } } \cs_new_protected:Npn \driver_draw_stroke_gray:n #1 - { \@@_draw_literal:x { \fp_eval:n {#1} ~ G } } + { \@@_draw_literal:n { #1 ~ G } } \cs_new_protected:Npn \driver_draw_color_rgb:nnn #1#2#3 - { - \use:x - { - \@@_draw_color_rgb_aux:nnn - { \fp_eval:n {#1} } - { \fp_eval:n {#2} } - { \fp_eval:n {#3} } - } - } -\cs_new_protected:Npn \@@_draw_color_rgb_aux:nnn #1#2#3 { \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } } \cs_new_protected:Npn \driver_draw_fill_rgb:nnn #1#2#3 - { - \@@_draw_literal:x - { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ rg } - } + { \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ rg } } \cs_new_protected:Npn \driver_draw_stroke_rgb:nnn #1#2#3 - { - \@@_draw_literal:x - { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ RG } - } + { \@@_draw_literal:n { #1 ~ #2 ~ #3 ~ RG } } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % % \begin{macro}{\driver_draw_transformcm:nnnnnn} % The first four arguments here are floats (the affine matrix), the last @@ -2200,8 +2112,7 @@ { \@@_draw_literal:x { - \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ - \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + #1 ~ #2 ~ #3 ~ #4 ~ \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~ cm } @@ -2717,7 +2628,7 @@ \cs_new_protected:Npn \driver_draw_linewidth:n #1 { \@@_draw_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } } \cs_new_protected:Npn \driver_draw_miterlimit:n #1 - { \@@_draw_scope:x { stroke-miterlimit=" \fp_eval:n {#1} " } } + { \@@_draw_scope:x { stroke-miterlimit=" #1 " } } \cs_new_protected:Npn \driver_draw_cap_butt: { \@@_draw_scope:n { stroke-linecap="butt" } } \cs_new_protected:Npn \driver_draw_cap_round: diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index d932e646c2f..bd8f69d6f16 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3expan.dtx Copyright (C) 1990-2017 The LaTeX3 project +%% File: l3expan.dtx Copyright (C) 1990-2018 The LaTeX3 project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1064,7 +1064,7 @@ { \fi: \fi: - \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2} + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#2} \exp_end: } % \end{macrocode} @@ -1527,7 +1527,7 @@ % error. % \begin{macrocode} \cs_new:Npn ^^@ - { \__msg_kernel_expandable_error:nn { kernel } { bad-exp-end-f } } + { \__kernel_msg_expandable_error:nn { kernel } { bad-exp-end-f } } % \end{macrocode} % The same but grabbing an argument to remove spaces and braces. % \begin{macrocode} @@ -1561,7 +1561,7 @@ % iterate through the comma list of variant argument specifiers, which % we first convert to a string: the reason is explained later. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_cs_exist:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_cs_exist:N #1 } { } \cs_new_protected:Npn \cs_generate_variant:Nn #1#2 { \@@_generate_variant:N #1 @@ -1642,7 +1642,7 @@ \cs_new_protected:Npn \@@_generate_variant:nnNN #1#2#3#4 { \if_meaning:w \c_false_bool #3 - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: @@ -1849,7 +1849,7 @@ \exp_not:n { \q_mark - \__msg_kernel_error:nnxx { kernel } { variant-too-long } + \__kernel_msg_error:nnxx { kernel } { variant-too-long } {#5} { \token_to_str:N #3 } \use_none:nnn \q_stop @@ -1864,7 +1864,7 @@ \exp_not:n { \q_mark - \__msg_kernel_error:nnxxxx { kernel } { invalid-variant } + \__kernel_msg_error:nnxxxx { kernel } { invalid-variant } {#7} { \token_to_str:N #5 } {#1} {#2} \use_none:nnn \q_stop @@ -1877,12 +1877,13 @@ #3 \q_stop #4 #5 {#6} {#7} \exp_not:n { - \@@_generate_variant_loop_warning:nnxxxx { kernel } { invalid-variant } + \@@_generate_variant_loop_warning:nnxxxx + { kernel } { deprecated-variant } {#7} { \token_to_str:N #5 } {#1} {#2} } } \cs_new_protected:Npn \@@_generate_variant_loop_warning:nnxxxx - { \__msg_kernel_warning:nnxxxx } + { \__kernel_msg_warning:nnxxxx } % \end{macrocode} % \end{macro} % @@ -1915,11 +1916,11 @@ % \cs{cs_new_protected:Npx}. Then define the variant by % combining the |\exp_args:N #3| variant and the base function. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { \cs_if_free:NF #4 { - \__debug_log:x + \__kernel_debug_log:x { Variant~\token_to_str:N #4~% already~defined;~ not~ changing~ it~ \msg_line_context: @@ -2012,7 +2013,7 @@ \cs_new_protected:Npn \@@_generate_variant:nnNnn #1#2#3#4#5 { \if_meaning:w \c_false_bool #3 - \__msg_kernel_error:nnx { kernel } { missing-colon } + \__kernel_msg_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } \use_i_delimit_by_q_stop:nw \fi: @@ -2032,7 +2033,7 @@ \cs_if_exist_use:cTF { @@_generate_variant_#1_form:nnn } { {#3} {#4} {#5} } { - \__msg_kernel_error:nnxx + \__kernel_msg_error:nnxx { kernel } { conditional-form-unknown } {#1} { \token_to_str:c { #3 : #4 } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 211c204a7d8..4b89d01c5d1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3file.dtx Copyright (C) 1990-2017 The LaTeX3 Project +%% File: l3file.dtx Copyright (C) 1990-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -884,7 +884,7 @@ \int_if_even:nF { 0 \tl_map_function:NN #2 \@@_name_quote_aux:n } { - \__msg_kernel_error:nnx + \__kernel_msg_error:nnx { kernel } { unbalanced-quote-in-filename } {#2} } \tl_remove_all:Nn #2 { " } @@ -975,7 +975,7 @@ \cs_new_protected:Npn \__file_missing:n #1 { \__file_name_sanitize:nN {#1} \l__file_base_name_str - \__msg_kernel_error:nnx { kernel } { file-not-found } + \__kernel_msg_error:nnx { kernel } { file-not-found } { \l__file_base_name_str } } % \end{macrocode} @@ -1299,7 +1299,7 @@ \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl { \@@_open_stream:Nn #1 {#2} } %<*initex> - { \__msg_kernel_fatal:nn { kernel } { input-streams-exhausted } } + { \__kernel_msg_fatal:nn { kernel } { input-streams-exhausted } } % %<*package> { @@ -1611,7 +1611,7 @@ \seq_gpop:NNTF \g_@@_streams_seq \l_@@_stream_tl { \@@_open_stream:NV #1 \l__file_base_name_str } %<*initex> - { \__msg_kernel_fatal:nn { kernel } { output-streams-exhausted } } + { \__kernel_msg_fatal:nn { kernel } { output-streams-exhausted } } % %<*package> { @@ -1912,7 +1912,7 @@ % \begin{macrocode} \cs_new_protected:Npn \iow_indent:n #1 { - \__msg_kernel_error:nnnnn { kernel } { iow-indent } + \__kernel_msg_error:nnnnn { kernel } { iow-indent } { \iow_wrap:nnnN } { \iow_indent:n } {#1} #1 } @@ -1924,7 +1924,7 @@ } \cs_new:Npn \@@_indent_error:n #1 { - \__msg_kernel_expandable_error:nnnnn { kernel } { iow-indent } + \__kernel_msg_expandable_error:nnnnn { kernel } { iow-indent } { \iow_wrap:nnnN } { \iow_indent:n } {#1} #1 } @@ -2346,38 +2346,38 @@ % \subsection{Messages} % % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { file-not-found } +\__kernel_msg_new:nnnn { kernel } { file-not-found } { File~'#1'~not~found. } { The~requested~file~could~not~be~found~in~the~current~directory,~ in~the~TeX~search~path~or~in~the~LaTeX~search~path. } -\__msg_kernel_new:nnn { kernel } { file-list } +\__kernel_msg_new:nnn { kernel } { file-list } { >~File~List~< #1 \\ ............. } -\__msg_kernel_new:nnnn { kernel } { input-streams-exhausted } +\__kernel_msg_new:nnnn { kernel } { input-streams-exhausted } { Input~streams~exhausted } { TeX~can~only~open~up~to~16~input~streams~at~one~time.\\ All~16~are~currently~in~use,~and~something~wanted~to~open~ another~one. } -\__msg_kernel_new:nnnn { kernel } { output-streams-exhausted } +\__kernel_msg_new:nnnn { kernel } { output-streams-exhausted } { Output~streams~exhausted } { TeX~can~only~open~up~to~16~output~streams~at~one~time.\\ All~16~are~currently~in~use,~and~something~wanted~to~open~ another~one. } -\__msg_kernel_new:nnnn { kernel } { unbalanced-quote-in-filename } +\__kernel_msg_new:nnnn { kernel } { unbalanced-quote-in-filename } { Unbalanced~quotes~in~file~name~'#1'. } { File~names~must~contain~balanced~numbers~of~quotes~("). } -\__msg_kernel_new:nnnn { kernel } { iow-indent } +\__kernel_msg_new:nnnn { kernel } { iow-indent } { Only~#1 (arg~1)~allows~#2 } { The~command~#2 can~only~be~used~in~messages~ @@ -2397,17 +2397,12 @@ % \begin{macrocode} \tl_new:N \g_file_current_name_tl \tl_gset:Nn \g_file_current_name_tl { \g_file_curr_name_str } -\__debug:TF +\__kernel_deprecation_code:nn { - \tl_gput_right:Nn \g__debug_deprecation_on_tl - { - \__deprecation_error:Nnn \g_file_current_name_tl - { \g_file_curr_name_str } { 2018-12-31 } - } - \tl_gput_right:Nn \g__debug_deprecation_off_tl - { \tex_def:D \g_file_current_name_tl { \g_file_curr_name_str } } + \__deprecation_error:Nnn \g_file_current_name_tl + { \g_file_curr_name_str } { 2018-12-31 } } - { } + { \tex_def:D \g_file_current_name_tl { \g_file_curr_name_str } } % \end{macrocode} % \end{variable} % @@ -2415,7 +2410,7 @@ % \begin{macro}[deprecated = 2018-12-31]{\file_path_remove:n} % Wrapper functions to manage the search path. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \seq_put_right:Nn \l_file_search_path_seq } \cs_new_protected:Npn \file_path_include:n #1 { @@ -2423,7 +2418,7 @@ \seq_if_in:NVF \l_file_search_path_seq \l__file_full_name_str { \seq_put_right:NV \l_file_search_path_seq \l__file_full_name_str } } -\__debug_deprecation:nnNNpn { 2018-12-31 } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \seq_remove_all:Nn \l_file_search_path_seq } \cs_new_protected:Npn \file_path_remove:n #1 { @@ -2437,7 +2432,7 @@ % \begin{macro}[deprecated = 2018-12-31]{\file_add_path:nN} % For removal after 2018-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } { \file_get_full_name:nN } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \file_get_full_name:nN } \cs_new_protected:Npn \file_add_path:nN #1#2 { \file_get_full_name:nN {#1} #2 @@ -2450,7 +2445,7 @@ % \begin{macro}[added = 2012-06-24, updated = 2012-07-31, deprecated=2017-12-31]{\ior_get_str:NN} % For removal after 2017-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2017-12-31 } { \ior_str_get:NN } +\__kernel_patch_deprecation:nnNNpn { 2017-12-31 } { \ior_str_get:NN } \cs_new_protected:Npn \ior_get_str:NN { \ior_str_get:NN } % \end{macrocode} % \end{macro} @@ -2458,7 +2453,7 @@ % \begin{macro}[deprecated = 2018-12-31]{\file_list:} % Renamed to \cs{file_log_list:}. For removal after 2018-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } { \file_log_list: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \file_log_list: } \cs_new_protected:Npn \file_list: { \file_log_list: } % \end{macrocode} % \end{macro} @@ -2467,13 +2462,13 @@ % {\ior_list_streams:, \ior_log_streams:, \iow_list_streams:, \iow_log_streams:} % These got a more consistent naming. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } { \ior_show_list: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \ior_show_list: } \cs_new_protected:Npn \ior_list_streams: { \ior_show_list: } -\__debug_deprecation:nnNNpn { 2018-12-31 } { \ior_log_list: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \ior_log_list: } \cs_new_protected:Npn \ior_log_streams: { \ior_log_list: } -\__debug_deprecation:nnNNpn { 2018-12-31 } { \iow_show_list: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \iow_show_list: } \cs_new_protected:Npn \iow_list_streams: { \iow_show_list: } -\__debug_deprecation:nnNNpn { 2018-12-31 } { \iow_log_list: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \iow_log_list: } \cs_new_protected:Npn \iow_log_streams: { \iow_log_list: } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx index 3ab6b77bbb5..96a497d7492 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -175,7 +175,7 @@ \if_meaning:w #1 ^^b3 ^^bc \else: % ij - U+0133 - ij \if_meaning:w #1 ^^ba ^^a8 \else: % ĺ - U+013A - lacute \if_meaning:w #1 ^^be ^^a9 \else: % ľ - U+013E - lcaron - \__msg_kernel_expandable_error:nn { kernel } { encoding-failure } + \__kernel_msg_expandable_error:nn { kernel } { encoding-failure } \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: } \cs_new:cpn { __char_active_C5:N } #1 @@ -197,7 +197,7 @@ \if_meaning:w #1 ^^ba ^^b9 \else: % ź - U+017A - zacute \if_meaning:w #1 ^^bc ^^bb \else: % ż - U+017C - zdotaccent \if_meaning:w #1 ^^be ^^ba \else: % ž - U+017E - zcaron - \__msg_kernel_expandable_error:nn { kernel } { encoding-failure } + \__kernel_msg_expandable_error:nn { kernel } { encoding-failure } \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: } @@ -206,7 +206,7 @@ \if_meaning:w #1 ^^99 ^^b3 \else: % ș - U+0219 - scommaaccent \if_meaning:w #1 ^^9b ^^b5 \else: % ț - U+021B - tcommaaccent \if_meaning:w #1 ^^b7 ^^1a \else: % ȷ - U+0237 - dotlessj - \__msg_kernel_expandable_error:nn { kernel } { encoding-failure } + \__kernel_msg_expandable_error:nn { kernel } { encoding-failure } \fi: \fi: \fi: } % \end{macrocode} @@ -221,7 +221,7 @@ \seq_put_right:Nx \l_char_active_seq { \exp_not:c { \char_generate:nn { "#1 } { 12 } } } } - \__msg_kernel_new:nnn { kernel } { encoding-failure } + \__kernel_msg_new:nnn { kernel } { encoding-failure } { Unknown~UTF-8~char } % \end{macrocode} % All of the chars are lower case so give them the correct \tn{lccode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 6df896757a3..29ffae5d507 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3flag.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3flag.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -64,7 +64,7 @@ % It must expand to character tokens only, with no spaces. % % A typical use case of flags would be to keep track of whether an -% exceptional condition has occured during expandable processing, and +% exceptional condition has occurred during expandable processing, and % produce a meaningful (non-expandable) message after the end of the % expandable processing. This is exemplified by \pkg{l3str-convert}, % which for performance reasons performs conversions of individual @@ -196,8 +196,8 @@ % When the option \texttt{check-declarations} is used, check for the % function defined by \cs{flag_new:n}. % \begin{macrocode} -\__debug_patch:nnNNpn - { \exp_args:Nc \__debug_chk_var_exist:N { flag~#1 } } { } +\__kernel_patch:nnNNpn + { \exp_args:Nc \__kernel_chk_var_exist:N { flag~#1 } } { } \cs_new_protected:Npn \flag_clear:n #1 { \@@_clear:wn 0 ; {#1} } \cs_new_protected:Npn \@@_clear:wn #1 ; #2 { @@ -243,7 +243,7 @@ % \subsection{Expandable flag commands} % % \begin{macro}[EXP]{\@@_chk_exist:n} -% Analogue of \cs{__debug_chk_var_exist:N} for flags, and with an +% Analogue of \cs{__kernel_chk_var_exist:N} for flags, and with an % expandable error. We need to add checks by hand because flags are % not implemented in terms of other variables. Not all functions need % to be patched since some are defined in terms of others. @@ -254,7 +254,7 @@ { \flag_if_exist:nF {#1} { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } { flag~#1~ } } } @@ -278,7 +278,7 @@ % \begin{macro}[EXP, pTF]{\flag_if_raised:n} % Test if the flag has a non-zero height, by checking the |0| control sequence. % \begin{macrocode} -\__debug_patch_conditional:nNNpnn { \@@_chk_exist:n {#1} } +\__kernel_patch_conditional:nNNpnn { \@@_chk_exist:n {#1} } \prg_new_conditional:Npnn \flag_if_raised:n #1 { p , T , F , TF } { \if_cs_exist:w flag~#1~0 \cs_end: @@ -295,7 +295,7 @@ % Extract the value of the flag by going through all of the % control sequences starting from |0|. % \begin{macrocode} -\__debug_patch:nnNNpn { \@@_chk_exist:n {#1} } { } +\__kernel_patch:nnNNpn { \@@_chk_exist:n {#1} } { } \cs_new:Npn \flag_height:n #1 { \@@_height_loop:wn 0; {#1} } \cs_new:Npn \@@_height_loop:wn #1 ; #2 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins index a17cdbdc311..6aa7727df4f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3format.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins @@ -1,6 +1,6 @@ \iffalse meta-comment -File l3format.ins Copyright (C) 2011,2012,2014-2017 The LaTeX3 Project +File l3format.ins Copyright (C) 2011,2012,2014-2018 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -33,7 +33,7 @@ license information is placed in the derived files. \preamble -Copyright (C) 1990-2017 The LaTeX3 Project +Copyright (C) 1990-2018 The LaTeX3 Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of @@ -83,6 +83,7 @@ and all files in that bundle must be distributed together. \from{l3fp-traps.dtx} {initex} \from{l3fp-round.dtx} {initex} \from{l3fp-parse.dtx} {initex} + \from{l3fp-assign.dtx} {initex} \from{l3fp-logic.dtx} {initex} \from{l3fp-basics.dtx} {initex} \from{l3fp-extended.dtx}{initex} @@ -90,14 +91,13 @@ and all files in that bundle must be distributed together. \from{l3fp-trig.dtx} {initex} \from{l3fp-convert.dtx} {initex} \from{l3fp-random.dtx} {initex} - \from{l3fp-assign.dtx} {initex} \from{l3sort.dtx} {initex} \from{l3tl-build.dtx} {initex} \from{l3tl-analysis.dtx}{initex} \from{l3regex.dtx} {initex} \from{l3box.dtx} {initex} \from{l3coffins.dtx} {initex} - \from{l3color.dtx} {initex} + \from{l3color-base.dtx} {initex} \from{l3sys.dtx} {initex} \from{l3deprecation.dtx}{initex} \from{l3candidates.dtx} {initex} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index c7e6b55d65a..d4dfd6d5c41 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 9b6d2366310..2c63887e4f0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-aux.dtx Copyright(C) 2011-2017 The LaTeX3 Project +%% File: l3fp-aux.dtx Copyright(C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -203,6 +203,17 @@ % % \subsection{Constants, and structure of floating points} % +% \begin{macro}{\@@_misused:n} +% This receives a floating point object (floating point number or +% tuple) and generates an error stating that it was misused. This is +% called when for instance an |fp| variable is left in the input +% stream and its contents reach \TeX{}'s stomach. +% \begin{macrocode} +\cs_new_protected:Npn \@@_misused:n #1 + { \__kernel_msg_error:nnx { kernel } { misused-fp } { \fp_to_tl:n {#1} } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\s_@@, \@@_chk:w} % Floating points numbers all start with \cs{s_@@} \cs{@@_chk:w}, % where \cs{s_@@} is equal to the \TeX{} primitive \tn{relax}, and @@ -214,10 +225,7 @@ % \begin{macrocode} \__scan_new:N \s_@@ \cs_new_protected:Npn \@@_chk:w #1 ; - { - \__msg_kernel_error:nnx { kernel } { misused-fp } - { \fp_to_tl:n { \s_@@ \@@_chk:w #1 ; } } - } + { \@@_misused:n { \s_@@ \@@_chk:w #1 ; } } % \end{macrocode} % \end{macro} % @@ -385,10 +393,9 @@ % \cs{@@_exp_after_f:nw} \Arg{tokens} \meta{floating point} % \end{syntax} % Places \meta{tokens} (empty in the case of \cs{@@_exp_after_o:w}) -% between the \meta{floating point} and the \meta{more tokens}, then -% hits those tokens with either \texttt{o}-expansion (one -% \cs{exp_after:wN}) or \texttt{f}-expansion, and leaves the floating -% point number unchanged. +% between the \meta{floating point} and the following tokens, then +% hits those tokens with \texttt{o} or \texttt{f}-expansion, and +% leaves the floating point number unchanged. % % We first distinguish normal floating points, which have a significand, % from the much simpler special floating points. @@ -459,27 +466,198 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\@@_exp_after_array_f:w} +% \subsection{Other floating point types} +% +% \begin{macro}{\s_@@_tuple, \@@_tuple_chk:w} +% \begin{variable}{\c_@@_empty_tuple_fp} +% Floating point tuples take the form \cs{s_@@_tuple} +% \cs{@@_tuple_chk:w} |{| \meta{fp 1} \meta{fp 2} \dots |}| |;| where +% each \meta{fp} is a floating point number or tuple, hence ends with +% |;| itself. When a tuple is typeset, \cs{@@_tuple_chk:w} produces +% an error, just like usual floating point numbers. +% Tuples may have zero or one element. +% \begin{macrocode} +\__scan_new:N \s_@@_tuple +\cs_new_protected:Npn \@@_tuple_chk:w #1 ; + { \@@_misused:n { \s_@@_tuple \@@_tuple_chk:w #1 ; } } +\tl_const:Nn \c_@@_empty_tuple_fp + { \s_@@_tuple \@@_tuple_chk:w { } ; } +% \end{macrocode} +% \end{variable} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_tuple_count:w, \@@_array_count:n} +% \begin{macro}[EXP]{\@@_tuple_count_loop:Nw} +% Count the number of items in a tuple of floating points by counting +% semicolons. The technique is very similar to \cs{tl_count:n}, but +% with the loop built-in. Checking for the end of the loop is done +% with the |\use_none:n #1| construction. +% \begin{macrocode} +\cs_new:Npn \@@_array_count:n #1 + { \@@_tuple_count:w \s_@@_tuple \@@_tuple_chk:w {#1} ; } +\cs_new:Npn \@@_tuple_count:w \s_@@_tuple \@@_tuple_chk:w #1 ; + { + \__int_value:w \__int_eval:w 0 + \@@_tuple_count_loop:Nw #1 { ? \__prg_break: } ; + \__prg_break_point: + \__int_eval_end: + } +\cs_new:Npn \@@_tuple_count_loop:Nw #1#2; + { \use_none:n #1 + 1 \@@_tuple_count_loop:Nw } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_if_type_fp:NTwFw} +% Used as \cs{@@_if_type_fp:NTwFw} \meta{marker} \Arg{true code} +% \cs{s__fp} \Arg{false code} \cs{q_stop}, this test whether the +% \meta{marker} is \cs{s_@@} or not and runs the appropriate +% \meta{code}. The very unusual syntax is for optimization purposes +% as that function is used for all floating point operations. +% \begin{macrocode} +\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \q_stop {#2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_array_if_all_fp:nTF, \@@_array_if_all_fp_loop:w} +% True if all items are floating point numbers. Used for |min|. +% \begin{macrocode} +\cs_new:Npn \@@_array_if_all_fp:nTF #1 + { + \@@_array_if_all_fp_loop:w #1 { \s_@@ \__prg_break: } ; + \__prg_break_point: \use_i:nn + } +\cs_new:Npn \@@_array_if_all_fp_loop:w #1#2 ; + { + \@@_if_type_fp:NTwFw + #1 \@@_array_if_all_fp_loop:w + \s_@@ { \__prg_break:n \use_iii:nnn } + \q_stop + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP] +% {\@@_type_from_scan:N, \@@_type_from_scan_other:N, \@@_type_from_scan:w} +% Used as \cs{@@_type_from_scan:N} \meta{token}. +% Grabs the pieces of the stringified \meta{token} which lies after +% the first |s__fp|. If the \meta{token} does not contain that +% string, the result is |_?|. +% \begin{macrocode} +\cs_new:Npn \@@_type_from_scan:N #1 + { + \@@_if_type_fp:NTwFw + #1 { } + \s_@@ { \@@_type_from_scan_other:N #1 } + \q_stop + } +\cs_new:Npx \@@_type_from_scan_other:N #1 + { + \exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w + \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark + \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop + } +\use:x + { + \cs_new:Npn \exp_not:N \@@_type_from_scan:w + ##1 \tl_to_str:n { s_@@ } ##2 \exp_not:N \q_mark ##3 \exp_not:N \q_stop + {##2} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_change_func_type:NNN} +% \begin{macro}[EXP]{\@@_change_func_type_aux:w, \@@_change_func_type_chk:NNN} +% Arguments are \meta{type marker} \meta{function} \meta{recovery}. +% This gives the function obtained by placing the type after |@@|. If +% the function is not defined then \meta{recovery} \meta{function} is +% used instead; however that test is not run when the \meta{type +% marker} is \cs{s_@@}. +% \begin{macrocode} +\cs_new:Npn \@@_change_func_type:NNN #1#2#3 + { + \@@_if_type_fp:NTwFw + #1 #2 + \s_@@ + { + \exp_after:wN \@@_change_func_type_chk:NNN + \cs:w + @@ \@@_type_from_scan_other:N #1 + \exp_after:wN \@@_change_func_type_aux:w \token_to_str:N #2 + \cs_end: + #2 #3 + } + \q_stop + } +\exp_last_unbraced:NNNNo + \cs_new:Npn \@@_change_func_type_aux:w #1 { \tl_to_str:n { @@ } } { } +\cs_new:Npn \@@_change_func_type_chk:NNN #1#2#3 + { + \if_meaning:w \scan_stop: #1 + \exp_after:wN #3 \exp_after:wN #2 + \else: + \exp_after:wN #1 + \fi: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_exp_after_any_f:Nnw, \@@_exp_after_any_f:nw} % \begin{macro}[EXP]{\@@_exp_after_stop_f:nw} -% \begin{syntax} -% \cs{@@_exp_after_array_f:w} -% \meta{fp_1} |;| -% \ldots{} -% \meta{fp_n} |;| -% \cs{s_@@_stop} -% \end{syntax} +% The |Nnw| function simply dispatches to the appropriate +% \cs[no-index]{@@_exp_after\ldots{}_f:nw} with \enquote{\ldots{}} +% (either empty or |_|\meta{type}) extracted from |#1|, which should +% start with |\s__fp|. If it doesn't start with |\s__fp| the function +% \cs{@@_exp_after_?_f:nw} defined in \pkg{l3fp-parse} gives an error; +% another special \meta{type} is |stop|, useful for loops, see below. +% The |nw| function has an important optimization for floating points +% numbers; it also fetches its type marker |#2| from the floating +% point. % \begin{macrocode} -\cs_new:Npn \@@_exp_after_array_f:w #1 +\cs_new:Npn \@@_exp_after_any_f:Nnw #1 + { \cs:w @@_exp_after \@@_type_from_scan_other:N #1 _f:nw \cs_end: } +\cs_new:Npn \@@_exp_after_any_f:nw #1#2 { - \cs:w @@_exp_after \@@_type_from_scan:N #1 _f:nw \cs_end: - { \@@_exp_after_array_f:w } - #1 + \@@_if_type_fp:NTwFw + #2 \@@_exp_after_f:nw + \s_@@ { \@@_exp_after_any_f:Nnw #2 } + \q_stop + {#1} #2 } \cs_new_eq:NN \@@_exp_after_stop_f:nw \use_none:nn % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}[EXP]{\@@_exp_after_tuple_f:nw, \@@_exp_after_array_f:w} +% The loop works by using the |n| argument of +% \cs{@@_exp_after_any_f:nw} to place the loop macro after the next +% item in the tuple and expand it. +% \begin{quote} +% \cs{@@_exp_after_array_f:w}\\ +% \meta{fp_1} |;|\\ +% \ldots{}\\ +% \meta{fp_n} |;|\\ +% \cs{s_@@_stop} +% \end{quote} +% \begin{macrocode} +\cs_new:Npn \@@_exp_after_tuple_f:nw #1 \s_@@_tuple \@@_tuple_chk:w #2 ; + { + \exp_after:wN \s_@@_tuple + \exp_after:wN \@@_tuple_chk:w + \exp_after:wN { + \exp:w \exp_end_continue_f:w + \@@_exp_after_array_f:w #2 \s_@@_stop + \exp_after:wN } + \exp_after:wN ; + \exp:w \exp_end_continue_f:w #1 + } +\cs_new:Npn \@@_exp_after_array_f:w + { \@@_exp_after_any_f:nw { \@@_exp_after_array_f:w } } +% \end{macrocode} +% \end{macro} +% % \subsection{Packing digits} % % When a positive integer |#1| is known to be less than $10^8$, the @@ -1011,28 +1189,6 @@ % \end{macro} % \end{macro} % -% \subsection{Length of a floating point array} -% -% \begin{macro}[EXP]{\@@_array_count:n} -% \begin{macro}[EXP]{\@@_array_count_loop:Nw} -% Count the number of items in an array of floating points. The -% technique is very similar to \cs{tl_count:n}, but with the loop -% built-in. Checking for the end of the loop is done with the -% |\use_none:n #1| construction. -% \begin{macrocode} -\cs_new:Npn \@@_array_count:n #1 - { - \__int_value:w \__int_eval:w 0 - \@@_array_count_loop:Nw #1 { ? \__prg_break: } ; - \__prg_break_point: - \__int_eval_end: - } -\cs_new:Npn \@@_array_count_loop:Nw #1#2; - { \use_none:n #1 + 1 \@@_array_count_loop:Nw } -% \end{macrocode} -% \end{macro} -% \end{macro} -% % \subsection{\texttt{x}-like expansion expandably} % % \begin{macro}[EXP]{\@@_expand:n} @@ -1064,16 +1220,30 @@ % \end{macro} % \end{macro} % +% \subsection{Name of a function from its \pkg{l3fp-parse} name} +% +% \begin{macro}[EXP]{\@@_func_to_name:N, \@@_func_to_name_aux:w} +% The goal is to convert for instance \cs{@@_sin_o:w} to |sin|. +% This is used in error messages hence does not need to be fast. +% \begin{macrocode} +\cs_new:Npn \@@_func_to_name:N #1 + { \exp_last_unbraced:Nf \@@_func_to_name_aux:w { \cs_to_str:N #1 } X } +\cs_set_protected:Npn \@@_tmp:w #1 #2 + { \cs_new:Npn \@@_func_to_name_aux:w ##1 #1 ##2 #2 ##3 X {##2} } +\exp_args:Nff \@@_tmp:w { \tl_to_str:n { @@_ } } { \tl_to_str:n { _o: } } +% \end{macrocode} +% \end{macro} +% % \subsection{Messages} % % Using a floating point directly is an error. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { misused-fp } +\__kernel_msg_new:nnnn { kernel } { misused-fp } { A~floating~point~with~value~'#1'~was~misused. } { To~obtain~the~value~of~a~floating~point~variable,~use~ '\token_to_str:N \fp_to_decimal:N',~ - '\token_to_str:N \fp_to_scientific:N',~or~other~ + '\token_to_str:N \fp_to_tl:N',~or~other~ conversion~functions. } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index 8f7e365eeec..8a0f18da382 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-basics.dtx Copyright (C) 2011-2014,2016,2017 The LaTeX3 Project +%% File: l3fp-basics.dtx Copyright (C) 2011-2014,2016-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -2068,6 +2068,74 @@ % \end{macrocode} % \end{macro} % +% \subsection{Operations on tuples} +% +% \begin{macro}[EXP]{\@@_tuple_set_sign_o:w} +% \begin{macro}[EXP]{\@@_tuple_set_sign_aux_o:Nnw, \@@_tuple_set_sign_aux_o:w} +% Two cases: |abs(|\meta{tuple}|)| for which |#1| is $0$ (invalid for +% tuples) and |-|\meta{tuple} for which |#1| is $2$. In that case, +% map over all items in the tuple an auxiliary that dispatches to the +% type-appropriate sign-flipping function. +% \begin{macrocode} +\cs_new:Npn \@@_tuple_set_sign_o:w #1 + { + \if_meaning:w 2 #1 + \exp_after:wN \@@_tuple_set_sign_aux_o:Nnw + \fi: + \@@_invalid_operation_o:nw { abs } + } +\cs_new:Npn \@@_tuple_set_sign_aux_o:Nnw #1#2#3 @ + { \@@_tuple_map_o:nw \@@_tuple_set_sign_aux_o:w #3 } +\cs_new:Npn \@@_tuple_set_sign_aux_o:w #1#2 ; + { + \@@_change_func_type:NNN #1 \@@_set_sign_o:w + \@@_parse_apply_unary_error:NNw + 2 #1 #2 ; @ + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_*_tuple_o:ww, \@@_tuple_*_o:ww, \@@_tuple_/_o:ww} +% For \meta{number}|*|\meta{tuple} and \meta{tuple}|*|\meta{number} +% and \meta{tuple}|/|\meta{number}, loop through the \meta{tuple} some +% code that multiplies or divides by the appropriate \meta{number}. +% Importantly we need to dispatch according to the type, and we make +% sure to apply the operator in the correct order. +% \begin{macrocode} +\cs_new:cpn { @@_*_tuple_o:ww } #1 ; + { \@@_tuple_map_o:nw { \@@_binary_type_o:Nww * #1 ; } } +\cs_new:cpn { @@_tuple_*_o:ww } #1 ; #2 ; + { \@@_tuple_map_o:nw { \@@_binary_rev_type_o:Nww * #2 ; } #1 ; } +\cs_new:cpn { @@_tuple_/_o:ww } #1 ; #2 ; + { \@@_tuple_map_o:nw { \@@_binary_rev_type_o:Nww / #2 ; } #1 ; } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_tuple_+_tuple_o:ww, \@@_tuple_-_tuple_o:ww} +% Check the two tuples have the same number of items and map through +% these a helper that dispatches appropriately depending on the types. +% This means |(1,2)+((1,1),2)| gives |(nan,4)|. +% \begin{macrocode} +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:cpn { @@_tuple_#1_tuple_o:ww } + \s_@@_tuple \@@_tuple_chk:w ##1 ; + \s_@@_tuple \@@_tuple_chk:w ##2 ; + { + \int_compare:nNnTF + { \@@_array_count:n {##1} } = { \@@_array_count:n {##2} } + { \@@_tuple_mapthread_o:nww { \@@_binary_type_o:Nww #1 } } + { \@@_invalid_operation_o:nww #1 } + \s_@@_tuple \@@_tuple_chk:w {##1} ; + \s_@@_tuple \@@_tuple_chk:w {##2} ; + } + } +\@@_tmp:w + +\@@_tmp:w - +% \end{macrocode} +% \end{macro} +% % \begin{macrocode} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index c727afc5696..abf02162559 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-convert.dtx Copyright(C) 2011-2017 The LaTeX3 Project +%% File: l3fp-convert.dtx Copyright(C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -61,6 +61,39 @@ %<@@=fp> % \end{macrocode} % +% \subsection{Dealing with tuples} +% +% \begin{macro}[EXP] +% {\@@_tuple_convert:Nw, \@@_tuple_convert_loop:nNw, \@@_tuple_convert_end:w} +% The first argument is for instance \cs{@@_to_tl_dispatch:w}, which +% converts any floating point object to the appropriate +% representation. We loop through all items, putting |,~| between all +% of them and making sure to remove the leading |,~|. +% \begin{macrocode} +\cs_new:Npn \@@_tuple_convert:Nw #1 \s_@@_tuple \@@_tuple_chk:w #2 ; + { + \int_case:nnF { \@@_array_count:n {#2} } + { + { 0 } { ( ) } + { 1 } { \@@_tuple_convert_end:w @ { #1 #2 , } } + } + { + \@@_tuple_convert_loop:nNw { } #1 + #2 { ? \@@_tuple_convert_end:w } ; + @ { \use_none:nn } + } + } +\cs_new:Npn \@@_tuple_convert_loop:nNw #1#2#3#4; #5 @ #6 + { + \use_none:n #3 + \exp_args:Nf \@@_tuple_convert_loop:nNw { #2 #3#4 ; } #2 #5 + @ { #6 , ~ #1 } + } +\cs_new:Npn \@@_tuple_convert_end:w #1 @ #2 + { \exp_after:wN ( \exp:w \exp_end_continue_f:w #2 ) } +% \end{macrocode} +% \end{macro} +% % \subsection{Trimming trailing zeros} % % \begin{macro}[EXP]{\@@_trim_zeros:w} @@ -104,8 +137,28 @@ % \end{macro} % % \begin{macro}[EXP] +% {\@@_to_scientific_dispatch:w, \@@_to_scientific_recover:w, \@@_tuple_to_scientific:w} +% We allow tuples. +% \begin{macrocode} +\cs_new:Npn \@@_to_scientific_dispatch:w #1 + { + \@@_change_func_type:NNN + #1 \@@_to_scientific:w \@@_to_scientific_recover:w + #1 + } +\cs_new:Npn \@@_to_scientific_recover:w #1 #2 ; + { + \@@_error:nffn { fp-unknown-type } { \tl_to_str:n { #2 ; } } { } { } + nan + } +\cs_new:Npn \@@_tuple_to_scientific:w + { \@@_tuple_convert:Nw \@@_to_scientific_dispatch:w } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP] % { -% \@@_to_scientific_dispatch:w, +% \@@_to_scientific:w, % \@@_to_scientific_normal:wnnnnn, % \@@_to_scientific_normal:wNw % } @@ -122,7 +175,7 @@ % second step grab the first digit (previously hidden in braces) to % order the various parts correctly. % \begin{macrocode} -\cs_new:Npn \@@_to_scientific_dispatch:w \s_@@ \@@_chk:w #1#2 +\cs_new:Npn \@@_to_scientific:w \s_@@ \@@_chk:w #1#2 { \if_meaning:w 2 #2 \exp_after:wN - \exp:w \exp_end_continue_f:w \fi: \if_case:w #1 \exp_stop_f: @@ -178,13 +231,33 @@ % \end{macro} % % \begin{macro}[EXP] +% {\@@_to_decimal_dispatch:w, \@@_to_decimal_recover:w, \@@_tuple_to_decimal:w} +% We allow tuples. +% \begin{macrocode} +\cs_new:Npn \@@_to_decimal_dispatch:w #1 + { + \@@_change_func_type:NNN + #1 \@@_to_decimal:w \@@_to_decimal_recover:w + #1 + } +\cs_new:Npn \@@_to_decimal_recover:w #1 #2 ; + { + \@@_error:nffn { fp-unknown-type } { \tl_to_str:n { #2 ; } } { } { } + nan + } +\cs_new:Npn \@@_tuple_to_decimal:w + { \@@_tuple_convert:Nw \@@_to_decimal_dispatch:w } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP] % { -% \@@_to_decimal_dispatch:w, +% \@@_to_decimal:w, % \@@_to_decimal_normal:wnnnnn, % \@@_to_decimal_large:Nnnw, % \@@_to_decimal_huge:wnnnn, % } -% The structure is similar to \cs{@@_to_scientific_dispatch:w}. +% The structure is similar to \cs{@@_to_scientific:w}. % Insert |-| for % negative numbers. Zero gives $0$, $\pm\infty$ and \nan{} yield an % \enquote{invalid operation} exception; note that $\pm\infty$ @@ -198,7 +271,7 @@ % non-positive, the result should be $0.\meta{zeros}\meta{digits}$, % trimmed. % \begin{macrocode} -\cs_new:Npn \@@_to_decimal_dispatch:w \s_@@ \@@_chk:w #1#2 +\cs_new:Npn \@@_to_decimal:w \s_@@ \@@_chk:w #1#2 { \if_meaning:w 2 #2 \exp_after:wN - \exp:w \exp_end_continue_f:w \fi: \if_case:w #1 \exp_stop_f: @@ -275,9 +348,24 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[EXP]{\@@_to_tl_dispatch:w, \@@_to_tl_recover:w, \@@_tuple_to_tl:w} +% We allow tuples. +% \begin{macrocode} +\cs_new:Npn \@@_to_tl_dispatch:w #1 + { \@@_change_func_type:NNN #1 \@@_to_tl:w \@@_to_tl_recover:w #1 } +\cs_new:Npn \@@_to_tl_recover:w #1 #2 ; + { + \@@_error:nffn { fp-unknown-type } { \tl_to_str:n { #2 ; } } { } { } + nan + } +\cs_new:Npn \@@_tuple_to_tl:w + { \@@_tuple_convert:Nw \@@_to_tl_dispatch:w } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[EXP] % { -% \@@_to_tl_dispatch:w, \@@_to_tl_normal:nnnnn, +% \@@_to_tl:w, \@@_to_tl_normal:nnnnn, % \@@_to_tl_scientific:wnnnnn, \@@_to_tl_scientific:wNw % } % A structure similar to \cs{@@_to_scientific_dispatch:w} and @@ -286,7 +374,7 @@ % in decimal notation if the exponent is in the range $[-2,16]$, and % otherwise use scientific notation. % \begin{macrocode} -\cs_new:Npn \@@_to_tl_dispatch:w \s_@@ \@@_chk:w #1#2 +\cs_new:Npn \@@_to_tl:w \s_@@ \@@_chk:w #1#2 { \if_meaning:w 2 #2 \exp_after:wN - \exp:w \exp_end_continue_f:w \fi: \if_case:w #1 \exp_stop_f: @@ -327,20 +415,40 @@ % \subsection{Convert to dimension or integer} % % \begin{macro}[EXP]{\fp_to_dim:N, \fp_to_dim:c, \fp_to_dim:n} -% These three public functions rely on \cs{fp_to_decimal:n} -% internally. +% \begin{macro}[EXP]{\@@_to_dim_dispatch:w, \@@_to_dim_recover:w, \@@_to_dim:w} +% All three public variants are based on the same +% \cs{@@_to_dim_dispatch:w} after evaluating their argument to an +% internal floating point. +% We only allow floating point numbers, not tuples. % \begin{macrocode} \cs_new:Npn \fp_to_dim:N #1 - { \fp_to_decimal:N #1 pt } + { \exp_after:wN \@@_to_dim_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_dim:N { c } -\cs_new:Npn \fp_to_dim:n #1 - { \fp_to_decimal:n {#1} pt } +\cs_new:Npn \fp_to_dim:n + { + \exp_after:wN \@@_to_dim_dispatch:w + \exp:w \exp_end_continue_f:w \@@_parse:n + } +\cs_new:Npn \@@_to_dim_dispatch:w #1#2 ; + { + \@@_change_func_type:NNN #1 \@@_to_dim:w \@@_to_dim_recover:w + #1 #2 ; + } +\cs_new:Npn \@@_to_dim_recover:w #1 + { \@@_invalid_operation:nnw { 0pt } { fp_to_dim } } +\cs_new:Npn \@@_to_dim:w #1 ; { \@@_to_decimal:w #1 ; pt } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}[EXP]{\fp_to_int:N, \fp_to_int:c, \fp_to_int:n} -% These three public functions evaluate their argument, then pass it -% to \cs{fp_to_int_dispatch:w}. +% \begin{macro}[EXP]{\@@_to_int_dispatch:w, \@@_to_int_recover:w} +% For the most part identical to \cs{fp_to_dim:N} but without |pt|, +% and where \cs{@@_to_int:w} does more work. +% To convert to an integer, first round to $0$ places (to the nearest +% integer), then express the result as a decimal number: the +% definition of \cs{@@_to_decimal_dispatch:w} is such that there are no +% trailing dot nor zero. % \begin{macrocode} \cs_new:Npn \fp_to_int:N #1 { \exp_after:wN \@@_to_int_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_int:N { c } @@ -349,22 +457,21 @@ \exp_after:wN \@@_to_int_dispatch:w \exp:w \exp_end_continue_f:w \@@_parse:n } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_to_int_dispatch:w} -% To convert to an integer, first round to $0$ places (to the nearest -% integer), then express the result as a decimal number: the -% definition of \cs{@@_to_decimal_dispatch:w} is such that there are no -% trailing dot nor zero. -% \begin{macrocode} -\cs_new:Npn \@@_to_int_dispatch:w #1; +\cs_new:Npn \@@_to_int_dispatch:w #1#2 ; { - \exp_after:wN \@@_to_decimal_dispatch:w \exp:w \exp_end_continue_f:w + \@@_change_func_type:NNN #1 \@@_to_int:w \@@_to_int_recover:w + #1 #2 ; + } +\cs_new:Npn \@@_to_int_recover:w #1 + { \@@_invalid_operation:nnw { 0 } { fp_to_int } } +\cs_new:Npn \@@_to_int:w #1; + { + \exp_after:wN \@@_to_decimal:w \exp:w \exp_end_continue_f:w \@@_round:Nwn \@@_round_to_nearest:NNN #1; { 0 } } % \end{macrocode} % \end{macro} +% \end{macro} % % \subsection{Convert from a dimension} % @@ -390,7 +497,7 @@ % performed by \cs{@@_mul_npos_o:Nww}, and cancelled by % \cs{prg_do_nothing:} here. % \begin{macrocode} -\__debug_patch_args:nNNpn { { (#1) } } +\__kernel_patch_args:nNNpn { { (#1) } } \cs_new:Npn \dim_to_fp:n #1 { \exp_after:wN \@@_from_dim_test:ww diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index 715a3cf5339..c705c4c47f1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 0e24d860cce..9172db30bc5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index d8cfecfbc28..678c76cdf7c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-logic.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3fp-logic.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -344,7 +344,7 @@ } { \token_if_eq_meaning:NNTF #2 0 - { \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#6} } + { \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#6} } { \@@_error:nnfn { fp-bad-step } { } { \fp_to_tl:n { \s_@@ \@@_chk:w #2#3#4 ; } } {#6} @@ -410,15 +410,16 @@ % \end{macro} % % \begin{macrocode} -\__msg_kernel_new:nnn { kernel } { fp-bad-step } +\__kernel_msg_new:nnn { kernel } { fp-bad-step } { Invalid~step~size~#2~in~step~function~#3. } -\__msg_kernel_new:nnn { kernel } { fp-tiny-step } +\__kernel_msg_new:nnn { kernel } { fp-tiny-step } { Tiny~step~size~(#1+#2=#1)~in~step~function~#3. } % \end{macrocode} % % \subsection{Extrema} % -% \begin{macro}[EXP]{\@@_minmax_o:Nw} +% \begin{macro}[EXP]{\@@_minmax_o:Nw, \@@_minmax_aux_o:Nw} +% First check all operands are floating point numbers. % The argument~|#1| is $2$~to find the maximum of an array~|#2| of % floating point numbers, and $0$~to find the minimum. We read % numbers sequentially, keeping track of the largest (smallest) number @@ -430,7 +431,13 @@ % fp-like trailing marker breaks the loop correctly: see the precise % definition of \cs{@@_minmax_loop:Nww}. % \begin{macrocode} -\cs_new:Npn \@@_minmax_o:Nw #1#2 @ +\cs_new:Npn \@@_minmax_o:Nw #1 + { + \@@_parse_function_all_fp_o:fnw + { \token_if_eq_meaning:NNTF 0 #1 { min } { max } } + { \@@_minmax_aux_o:Nw #1 } + } +\cs_new:Npn \@@_minmax_aux_o:Nw #1#2 @ { \if_meaning:w 0 #1 \exp_after:wN \@@_minmax_loop:Nww \exp_after:wN + @@ -581,7 +588,7 @@ \@@_parse_operand:Nw \c_@@_prec_colon_int \@@_parse_expand:w \else: - \__msg_kernel_expandable_error:nnnn + \__kernel_msg_expandable_error:nnnn { kernel } { fp-missing } { : } { ~for~?: } \exp_after:wN \@@_parse_continue:NwN \exp_after:wN #1 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 03bd96b4b81..541d8f14ab6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-parse.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3fp-parse.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -28,7 +28,7 @@ % % \fi % -% \title{The \textsf{l3fp-parse} package +% \title{The \textsf{l3fp-parse} package\\ % Floating point expression parsing} % \author{^^A % The \LaTeX3 Project\thanks @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -65,12 +65,17 @@ % (almost) right the first time. Let us first describe our goal, then % discuss the design precisely before writing any code. % +% In this file at least, a \meta{floating point object} is a floating +% point number or tuple. This can be extended to anything that starts +% with \cs{s_@@} or \cs{s_@@_\meta{type}} and ends with |;| with some +% internal structure that depends on the \meta{type}. +% % \begin{macro}[EXP]{\@@_parse:n} % \begin{syntax} % \cs{@@_parse:n} \Arg{fpexpr} % \end{syntax} % Evaluates the \meta{floating point expression} and leaves the result -% in the input stream as an internal floating point number. This +% in the input stream as a floating point object. This % function forms the basis of almost all public \pkg{l3fp} functions. % During evaluation, each token is fully \texttt{f}-expanded. % @@ -83,33 +88,8 @@ % \end{texnote} % \end{macro} % -% Floating point expressions are composed of numbers, given in various -% forms, infix operators, such as |+|, |**|, or~|,| (which joins two -% numbers into a list), and prefix operators, such as the unary~|-|, -% functions, or opening parentheses. Here is a list of precedences -% which control the order of evaluation (some distinctions are -% irrelevant for the order of evaluation, but serve as signals), from -% the tightest binding to the loosest binding. -% \begin{itemize} -% \item[16] Function calls with multiple arguments. -% \item[15] Function calls expecting exactly one argument. -% \item[13/14] Binary |**| and~|^| (right to left). -% \item[12] Unary |+|, |-|, |!| (right to left). -% \item[10] Binary |*|, |/|, and juxtaposition (implicit~|*|). -% \item[9] Binary |+| and~|-|. -% \item[7] Comparisons. -% \item[6] Logical \texttt{and}, denoted by~|&&|. -% \item[5] Logical \texttt{or}, denoted by~\verb*+||+. -% \item[4] Ternary operator |?:|, piece~|?|. -% \item[3] Ternary operator |?:|, piece~|:|. -% \item[2] Commas, and parentheses accepting commas. -% \item[1] Parentheses expecting exactly one argument. -% \item[0] Start and end of the expression. -% \end{itemize} -% % \begin{variable} % { -% \c_@@_prec_funcii_int, % \c_@@_prec_func_int, % \c_@@_prec_hatii_int, % \c_@@_prec_hat_int, @@ -122,12 +102,33 @@ % \c_@@_prec_quest_int, % \c_@@_prec_colon_int, % \c_@@_prec_comma_int, -% \c_@@_prec_paren_int, +% \c_@@_prec_tuple_int, % \c_@@_prec_end_int, % } +% Floating point expressions are composed of numbers, given in various +% forms, infix operators, such as |+|, |**|, or~|,| (which joins two +% numbers into a list), and prefix operators, such as the unary~|-|, +% functions, or opening parentheses. Here is a list of precedences +% which control the order of evaluation (some distinctions are +% irrelevant for the order of evaluation, but serve as signals), from +% the tightest binding to the loosest binding. +% \begin{itemize} +% \item[16] Function calls. +% \item[13/14] Binary |**| and~|^| (right to left). +% \item[12] Unary |+|, |-|, |!| (right to left). +% \item[10] Binary |*|, |/|, and juxtaposition (implicit~|*|). +% \item[9] Binary |+| and~|-|. +% \item[7] Comparisons. +% \item[6] Logical \texttt{and}, denoted by~|&&|. +% \item[5] Logical \texttt{or}, denoted by~\verb*+||+. +% \item[4] Ternary operator |?:|, piece~|?|. +% \item[3] Ternary operator |?:|, piece~|:|. +% \item[2] Commas. +% \item[1] Place where a comma is allowed and generates a tuple. +% \item[0] Start and end of the expression. +% \end{itemize} % \begin{macrocode} -\int_const:Nn \c_@@_prec_funcii_int { 16 } -\int_const:Nn \c_@@_prec_func_int { 15 } +\int_const:Nn \c_@@_prec_func_int { 16 } \int_const:Nn \c_@@_prec_hatii_int { 14 } \int_const:Nn \c_@@_prec_hat_int { 13 } \int_const:Nn \c_@@_prec_not_int { 12 } @@ -139,7 +140,7 @@ \int_const:Nn \c_@@_prec_quest_int { 4 } \int_const:Nn \c_@@_prec_colon_int { 3 } \int_const:Nn \c_@@_prec_comma_int { 2 } -\int_const:Nn \c_@@_prec_paren_int { 1 } +\int_const:Nn \c_@@_prec_tuple_int { 1 } \int_const:Nn \c_@@_prec_end_int { 0 } % \end{macrocode} % \end{variable} @@ -168,7 +169,7 @@ % which appear when computing a parenthesized expression near the % closing parenthesis. This still lets us expand tokens as we go, and % avoids performance problems as long as there are enough parentheses. -% However, it would be much better to avoid requiring the closing +% However, it would be better to avoid requiring the closing % parenthesis to be present as soon as the corresponding opening % parenthesis is read: the closing parenthesis may still be hidden in a % macro yet to be expanded. @@ -232,10 +233,11 @@ % called |\operand:w|. This means that |\operand:w| must know what the % previous binary operator is, or rather, its precedence: we thus rename % it |\operand:Nw|. Let us describe as an example how we plan to do -% the calculation |41-2^3*4+5|. Here, we abuse notations: the first -% argument of |\operand:Nw| should be an integer constant (\cs{c_@@_prec_plus_int}, -% \ldots{}) equal to the precedence of the given operator, -% not directly the operator itself. +% the calculation |41-2^3*4+5|. More precisely we describe how to +% perform the first operation in this expression. Here, we abuse +% notations: the first argument of |\operand:Nw| should be an integer +% constant (\cs{c_@@_prec_plus_int}, \ldots{}) equal to the precedence +% of the given operator, not directly the operator itself. % \begin{itemize} % \item Clean up~|41| and find~|-|. We call |\operand:Nw|~|-| to find % the second operand. @@ -247,16 +249,16 @@ % \item Compare the precedences of |^| and~|*|. Since the former is % higher, |\operand:Nw|~|^| has found the second operand of the % exponentiation, which is computed: $2^{3} = 8$. -% \item We now have |41+8*4+5|, and |\operand:Nw|~|-| is still +% \item We now have |41-8*4+5|, and |\operand:Nw|~|-| is still % looking for a second operand for the subtraction. Is it~$8$? % \item Compare the precedences of |-| and~|*|. Since the latter is % higher, we are not done with~$8$. Call |\operand:Nw|~|*| to find % the second operand of the multiplication. -% \item Clean up~|4|, and find~|-|. -% \item Compare the precedences of |*| and~|-|. Since the former is +% \item Clean up~|4|, and find~|+|. +% \item Compare the precedences of |*| and~|+|. Since the former is % higher, |\operand:Nw|~|*| has found the second operand of the % multiplication, which is computed: $8*4 = 32$. -% \item We now have |41+32+5|, and |\operand:Nw|~|-| is still looking +% \item We now have |41-32+5|, and |\operand:Nw|~|-| is still looking % for a second operand for the subtraction. Is it~$32$? % \item Compare the precedences of |-| and~|+|. Since they are equal, % |\operand:Nw|~|-| has found the second operand for the @@ -289,10 +291,10 @@ % of this function is that it reads one \meta{number}, performing no % computation, and finds the following binary \meta{operator}. Then it % expands to -% \begin{syntax} -% \meta{number} +% \begin{quote} +% \meta{number}\\ % | \__fp_parse_infix_|\meta{operator}|:N| \meta{precedence} -% \end{syntax} +% \end{quote} % expanding the \texttt{infix} auxiliary before leaving the above in the % input stream. % @@ -638,29 +640,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\@@_type_from_scan:N, \@@_type_from_scan:w} -% \begin{syntax} -% \cs{@@_type_from_scan:N} \meta{token} -% \end{syntax} -% Grabs the pieces of the stringified \meta{token} which lies after -% the first |s__fp|. If the \meta{token} does not contain that -% string, the result is |_?|. -% \begin{macrocode} -\cs_new:Npx \@@_type_from_scan:N #1 - { - \exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w - \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark - \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop - } -\use:x - { - \cs_new:Npn \exp_not:N \@@_type_from_scan:w - ##1 \tl_to_str:n { s_@@ } ##2 \exp_not:N \q_mark ##3 \exp_not:N \q_stop - {##2} - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}[rEXP] % { % \@@_parse_digits_vii:N , @@ -761,8 +740,7 @@ % \@@_exp_after_?_f:nw % } % This function receives a \meta{precedence} and a control sequence -% equal to \cs{scan_stop:} in meaning. There are three cases, -% dispatched using \cs{@@_type_from_scan:N}. +% equal to \cs{scan_stop:} in meaning. There are three cases. % \begin{itemize} % \item \cs{s_@@} starts a floating point number, and we call % \cs{@@_exp_after_f:nw}, which |f|-expands after the floating @@ -785,23 +763,35 @@ % because \tn{protect} is often \cs{scan_stop:} hence \enquote{does % not exist}. % \begin{macrocode} -\cs_new:Npn \@@_parse_one_fp:NN #1#2 +\cs_new:Npn \@@_parse_one_fp:NN #1 { - \cs:w @@_exp_after \@@_type_from_scan:N #2 _f:nw \cs_end: + \@@_exp_after_any_f:nw { \exp_after:wN \@@_parse_infix:NN \exp_after:wN #1 \exp:w \@@_parse_expand:w } - #2 } \cs_new:Npn \@@_exp_after_mark_f:nw #1 { - \__msg_kernel_expandable_error:nn { kernel } { fp-early-end } - \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w #1 + \int_case:nnF { \exp_after:wN \use_i:nnn \use_none:nnn #1 } + { + \c_@@_prec_comma_int { } + \c_@@_prec_tuple_int { } + \c_@@_prec_end_int + { + \exp_after:wN \c_@@_empty_tuple_fp + \exp:w \exp_end_continue_f:w + } + } + { + \__kernel_msg_expandable_error:nn { kernel } { fp-early-end } + \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w + } + #1 } \cs_new:cpn { @@_exp_after_?_f:nw } #1#2 { - \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2} + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#2} \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w #1 } %<*package> @@ -815,9 +805,9 @@ \str_if_eq:nnTF {##2} { \protect } { \cs_if_eq:NNTF ##2 #1 { \use_i:nn } { \use:n } - { \__msg_kernel_expandable_error:nnn { kernel } { fp-robust-cmd } } + { \__kernel_msg_expandable_error:nnn { kernel } { fp-robust-cmd } } } - { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {##2} } + { \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {##2} } } } } @@ -996,7 +986,7 @@ { \cs_if_exist_use:cF { @@_parse_caseless_ \str_fold_case:n {#2} :N } { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { unknown-fp-word } {#2} \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w \@@_parse_infix:NN @@ -1051,13 +1041,13 @@ { \cs_if_exist:cTF { @@_parse_infix_ \token_to_str:N #1 :N } { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { fp-missing-number } {#1} \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w \@@_parse_infix:NN #3 #1 } { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { fp-unknown-symbol } {#1} \@@_parse_one:Nw #3 } @@ -1729,12 +1719,12 @@ \__str_if_eq_x:nn { \s_@@ } { \exp_not:N #1 } = 0 \exp_stop_f: 0 - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { fp-after-e } { floating~point~ } \prg_return_true: \else: 0 - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#1} \prg_return_false: \fi: @@ -1745,14 +1735,14 @@ \__int_value:w #1 \else: 0 - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { fp-after-e } { dimension~#1 } \fi: \prg_return_false: \fi: \else: 0 - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { fp-missing } { exponent } \prg_return_true: \fi: @@ -1771,23 +1761,71 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP]{\@@_parse_apply_unary:NNNwN} +% \begin{macro}[EXP]{\@@_parse_apply_function:NNNwN} % Here, |#1| is a precedence, |#2| is some extra data used by some % functions, |#3| is \emph{e.g.}, \cs{@@_sin_o:w}, and expands once % after the calculation, |#4| is the operand, and |#5| is a % \cs[no-index]{@@_parse_infix_\ldots{}:N} function. We feed the data~|#2|, and the % argument~|#4|, to the function~|#3|, which expands % \cs{exp:w} thus the \texttt{infix} function~|#5|. +% \begin{macrocode} +\cs_new:Npn \@@_parse_apply_function:NNNwN #1#2#3#4@#5 + { + #3 #2 #4 @ + \exp:w \exp_end_continue_f:w #5 #1 + } +% \end{macrocode} +% \end{macro} % -% This is redefined in \pkg{l3fp-extras}. +% \begin{macro}[EXP]{\@@_parse_apply_unary:NNNwN} +% \begin{macro}[EXP]{\@@_parse_apply_unary_chk:NwNw, \@@_parse_apply_unary_chk:nNNNw} +% \begin{macro}[EXP]{\@@_parse_apply_unary_type:NNN, \@@_parse_apply_unary_error:NNw} +% In contrast to \cs{@@_parse_apply_function:NNNwN}, this checks that +% the operand |#4| is a single argument (namely there is a single +% |;|). We use the fact that any floating point starts with a +% \enquote{safe} token like \cs{s_@@}. If there is no argument +% produce the |fp-no-arg| error; if there are at least two produce +% |fp-multi-arg|. For the error message extract the mathematical +% function name (such as |sin|) from the \pkg{expl3} function that +% computes it, such as \cs{@@_sin_o:w}. +% +% In addition, since there is a single argument we can dispatch on +% type and check that the resulting function exists. This catches +% things like |sin((1,2))| where it does not make sense to take the +% sine of a tuple. % \begin{macrocode} \cs_new:Npn \@@_parse_apply_unary:NNNwN #1#2#3#4@#5 { + \@@_parse_apply_unary_chk:NwNw #4 @ ; . \q_stop + \@@_parse_apply_unary_type:NNN #3 #2 #4 @ \exp:w \exp_end_continue_f:w #5 #1 } +\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \q_stop + { + \if_meaning:w @ #3 \else: + \token_if_eq_meaning:NNTF . #3 + { \@@_parse_apply_unary_chk:nNNNNw { no } } + { \@@_parse_apply_unary_chk:nNNNNw { multi } } + \fi: + } +\cs_new:Npn \@@_parse_apply_unary_chk:nNNNNw #1#2#3#4#5#6 @ + { + #2 + \@@_error:nffn { fp-#1-arg } { \@@_func_to_name:N #4 } { } { } + \exp_after:wN #4 \exp_after:wN #5 \c_nan_fp @ + } +\cs_new:Npn \@@_parse_apply_unary_type:NNN #1#2#3 + { + \@@_change_func_type:NNN #3 #1 \@@_parse_apply_unary_error:NNw + #2 #3 + } +\cs_new:Npn \@@_parse_apply_unary_error:NNw #1#2#3 @ + { \@@_invalid_operation_o:fw { \@@_func_to_name:N #1 } #3 } % \end{macrocode} % \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}[EXP]{\@@_parse_prefix_-:Nw, \@@_parse_prefix_!:Nw} % The unary~|-| and boolean not are harder: we parse the operand using @@ -1840,13 +1878,15 @@ % \begin{macro}[EXP] % {\@@_parse_prefix_(:Nw, \@@_parse_lparen_after:NwN} % The left parenthesis is treated as a unary prefix operator because -% it appears in exactly the same settings. Commas are allowed if -% the previous precedence is $16$ (function with multiple arguments). -% In this case, find an -% operand using the precedence~$1$; otherwise the precedence~$0$. +% it appears in exactly the same settings. If the previous precedence +% is \cs{c_@@_prec_func_int} we are parsing arguments of a function +% and commas should not build tuples; otherwise commas should build +% tuples. We distinguish these cases by precedence: +% \cs{c_@@_prec_comma_int} for the case of arguments, +% \cs{c_@@_prec_tuple_int} for the case of tuples. % Once the operand is found, the \texttt{lparen_after} auxiliary makes % sure that there was a closing parenthesis (otherwise it complains), -% and leaves in the input stream the array it found as an operand, +% and leaves in the input stream an operand, % fetching the following infix operator. % \begin{macrocode} \cs_new:cpn { @@_parse_prefix_(:Nw } #1 @@ -1854,10 +1894,10 @@ \exp_after:wN \@@_parse_lparen_after:NwN \exp_after:wN #1 \exp:w - \if_int_compare:w #1 = \c_@@_prec_funcii_int + \if_int_compare:w #1 = \c_@@_prec_func_int \@@_parse_operand:Nw \c_@@_prec_comma_int \else: - \@@_parse_operand:Nw \c_@@_prec_paren_int + \@@_parse_operand:Nw \c_@@_prec_tuple_int \fi: \@@_parse_expand:w } @@ -1874,8 +1914,9 @@ \exp_not:N \@@_parse_expand:w } { - \exp_not:N \__msg_kernel_expandable_error:nnn + \exp_not:N \__kernel_msg_expandable_error:nnn { kernel } { fp-missing } { ) } + \exp_not:N \tl_if_empty:nT {#2} \exp_not:N \c_@@_empty_tuple_fp #2 @ \exp_not:N \use_none:n #3 } @@ -1884,18 +1925,23 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_parse_prefix_):Nw} -% The right parenthesis can appear as unary prefixes when arguments of -% a multi-argument function end with a comma, or when there is no -% argument, as in |max(1,2,)| or in |rand()|. In single-argument -% functions (precedence~$0$ rather than~$1$) forbid this. +% The right parenthesis can appear as a prefix in two similar cases: +% in an empty tuple or tuple ending with a comma, or in an empty +% argument list or argument list ending with a comma, such as in +% |max(1,2,)| or in |rand()|. % \begin{macrocode} \cs_new:cpn { @@_parse_prefix_):Nw } #1 { \if_int_compare:w #1 = \c_@@_prec_comma_int \else: - \__msg_kernel_expandable_error:nnn - { kernel } { fp-missing-number } { ) } - \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w + \if_int_compare:w #1 = \c_@@_prec_tuple_int + \exp_after:wN \c_@@_empty_tuple_fp \exp:w + \else: + \__kernel_msg_expandable_error:nnn + { kernel } { fp-missing-number } { ) } + \exp_after:wN \c_nan_fp \exp:w + \fi: + \exp_end_continue_f:w \fi: \@@_parse_infix:NN #1 ) } @@ -2011,12 +2057,12 @@ } \cs_new:Npn \@@_parse_function:NNN #1#2#3 { - \exp_after:wN \@@_parse_apply_unary:NNNwN + \exp_after:wN \@@_parse_apply_function:NNNwN \exp_after:wN #3 \exp_after:wN #2 \exp_after:wN #1 \exp:w - \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w + \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w } % \end{macrocode} % \end{macro} @@ -2086,18 +2132,79 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_parse_apply_binary:NwNwN} +% \begin{macro}[EXP] +% {\@@_parse_apply_binary_chk:NN, \@@_parse_apply_binary_error:NNN} % Receives \meta{precedence} \meta{operand_1} |@| \meta{operation} % \meta{operand_2} |@| \meta{infix command}. Builds the appropriate -% call to the \meta{operation}~|#3|. +% call to the \meta{operation}~|#3|, dispatching on both types. +% If the resulting control sequence does not exist, the operation is +% not allowed. % % This is redefined in \pkg{l3fp-extras}. % \begin{macrocode} -\cs_new:Npn \@@_parse_apply_binary:NwNwN #1 #2@ #3 #4@ #5 +\cs_new:Npn \@@_parse_apply_binary:NwNwN #1 #2#3@ #4 #5#6@ #7 { \exp_after:wN \@@_parse_continue:NwN \exp_after:wN #1 - \exp:w \exp_end_continue_f:w \cs:w @@_#3_o:ww \cs_end: #2 #4 - \exp:w \exp_end_continue_f:w #5 #1 + \exp:w \exp_end_continue_f:w + \exp_after:wN \@@_parse_apply_binary_chk:NN + \cs:w + @@ + \@@_type_from_scan:N #2 + _#4 + \@@_type_from_scan:N #5 + _o:ww + \cs_end: + #4 + #2#3 #5#6 + \exp:w \exp_end_continue_f:w #7 #1 + } +\cs_new:Npn \@@_parse_apply_binary_chk:NN #1#2 + { + \if_meaning:w \scan_stop: #1 + \@@_parse_apply_binary_error:NNN #2 + \fi: + #1 + } +\cs_new:Npn \@@_parse_apply_binary_error:NNN #1#2#3 + { + #2 + \@@_invalid_operation_o:Nww #1 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_binary_type_o:Nww, \@@_binary_rev_type_o:Nww} +% Applies the operator |#1| to its two arguments, dispatching +% according to their types, and expands once after the result. +% The |rev| version swaps its arguments before doing this. +% \begin{macrocode} +\cs_new:Npn \@@_binary_type_o:Nww #1 #2#3 ; #4 + { + \exp_after:wN \@@_parse_apply_binary_chk:NN + \cs:w + @@ + \@@_type_from_scan:N #2 + _ #1 + \@@_type_from_scan:N #4 + _o:ww + \cs_end: + #1 + #2 #3 ; #4 + } +\cs_new:Npn \@@_binary_rev_type_o:Nww #1 #2#3 ; #4#5 ; + { + \exp_after:wN \@@_parse_apply_binary_chk:NN + \cs:w + @@ + \@@_type_from_scan:N #4 + _ #1 + \@@_type_from_scan:N #2 + _o:ww + \cs_end: + #1 + #4 #5 ; #2 #3 ; } % \end{macrocode} % \end{macro} @@ -2111,40 +2218,40 @@ \@@_exp_after_f:nw { \@@_parse_infix:NN #1 } #2; } - \cs_new:Npn \@@_parse_infix:NN #1 #2 - { - \if_catcode:w \scan_stop: \exp_not:N #2 - \if_int_compare:w - \__str_if_eq_x:nn { \s_@@_mark } { \exp_not:N #2 } - = 0 \exp_stop_f: - \exp_after:wN \exp_after:wN - \exp_after:wN \@@_parse_infix_mark:NNN - \else: - \exp_after:wN \exp_after:wN - \exp_after:wN \@@_parse_infix_juxtapose:N - \fi: +\cs_new:Npn \@@_parse_infix:NN #1 #2 + { + \if_catcode:w \scan_stop: \exp_not:N #2 + \if_int_compare:w + \__str_if_eq_x:nn { \s_@@_mark } { \exp_not:N #2 } + = 0 \exp_stop_f: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mark:NNN \else: - \if_int_compare:w - \__int_eval:w - ( `#2 \if_int_compare:w `#2 > `Z - 32 \fi: ) / 26 - = 3 \exp_stop_f: - \exp_after:wN \exp_after:wN - \exp_after:wN \@@_parse_infix_juxtapose:N - \else: - \exp_after:wN \@@_parse_infix_check:NNN - \cs:w - @@_parse_infix_ \token_to_str:N #2 :N - \exp_after:wN \exp_after:wN \exp_after:wN - \cs_end: - \fi: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mul:N \fi: - #1 - #2 - } + \else: + \if_int_compare:w + \__int_eval:w + ( `#2 \if_int_compare:w `#2 > `Z - 32 \fi: ) / 26 + = 3 \exp_stop_f: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mul:N + \else: + \exp_after:wN \@@_parse_infix_check:NNN + \cs:w + @@_parse_infix_ \token_to_str:N #2 :N + \exp_after:wN \exp_after:wN \exp_after:wN + \cs_end: + \fi: + \fi: + #1 + #2 + } \cs_new:Npx \@@_parse_infix_check:NNN #1#2#3 { \exp_not:N \if_meaning:w \scan_stop: #1 - \exp_not:N \__msg_kernel_expandable_error:nnn + \exp_not:N \__kernel_msg_expandable_error:nnn { kernel } { fp-missing } { * } \exp_not:N \exp_after:wN \exp_not:c { @@_parse_infix_*:N } @@ -2185,21 +2292,21 @@ % \begin{macro}[EXP]+\@@_parse_infix_):N+ % This is very similar to \cs{@@_parse_infix_end:N}, complaining about % an extra closing parenthesis if the previous operator was the -% beginning of the expression. +% beginning of the expression, with precedence \cs{c_@@_prec_end_int}. % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1 { \cs_new:Npn #1 ##1 { - \if_int_compare:w ##1 < \c_@@_prec_paren_int - \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) } - \exp_after:wN \@@_parse_infix:NN - \exp_after:wN ##1 - \exp:w \exp_after:wN \@@_parse_expand:w - \else: + \if_int_compare:w ##1 > \c_@@_prec_end_int \exp_after:wN @ \exp_after:wN \use_none:n \exp_after:wN #1 + \else: + \__kernel_msg_expandable_error:nnn { kernel } { fp-extra } { ) } + \exp_after:wN \@@_parse_infix:NN + \exp_after:wN ##1 + \exp:w \exp_after:wN \@@_parse_expand:w \fi: } } @@ -2208,10 +2315,17 @@ % \end{macro} % % \begin{macro}[verb, EXP]{\__fp_parse_infix_,:N} -% \begin{macro}[EXP]{\@@_parse_infix_comma:w, \@@_parse_infix_comma_error:w} -% \begin{macro}[verb, EXP]{\__fp_,_o:ww} -% \cs{@@_,_o:ww} is a complicated way of replacing any number of -% floating point arguments by \texttt{nan}. +% \begin{macro}[EXP]{\@@_parse_infix_comma:w, \@@_parse_apply_comma:NwNwN} +% As for other infix operations, if the previous operations has higher +% precedence the comma waits. Otherwise we call +% \cs{@@_parse_operand:Nw} to read more comma-delimited arguments that +% \cs{@@_parse_infix_comma:w} simply concatenates into a |@|-delimited +% array. The first comma in a tuple that is not a function argument +% is distinguished: in that case call \cs{@@_parse_apply_comma:NwNwN} +% whose job is to convert the first item of the tuple and an array of +% the remaining items into a tuple. In contrast to +% \cs{@@_parse_apply_binary:NwNwN} this function's operands are not +% single-object arrays. % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1 { @@ -2223,10 +2337,15 @@ \exp_after:wN #1 \else: \if_int_compare:w ##1 < \c_@@_prec_comma_int - \@@_parse_infix_comma_error:w + \exp_after:wN @ + \exp_after:wN \@@_parse_apply_comma:NwNwN + \exp_after:wN , + \exp:w + \else: + \exp_after:wN \@@_parse_infix_comma:w + \exp:w \fi: - \exp_after:wN \@@_parse_infix_comma:w - \exp:w \@@_parse_operand:Nw \c_@@_prec_comma_int + \@@_parse_operand:Nw \c_@@_prec_comma_int \exp_after:wN \@@_parse_expand:w \fi: } @@ -2234,32 +2353,18 @@ \exp_args:Nc \@@_tmp:w { @@_parse_infix_,:N } \cs_new:Npn \@@_parse_infix_comma:w #1 @ { #1 @ \use_none:n } -\cs_new:Npn \@@_parse_infix_comma_error:w #1 \exp:w - { - \fi: - \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma } - \exp_after:wN @ - \exp_after:wN \@@_parse_apply_binary:NwNwN - \exp_after:wN , - \exp:w - } -\cs_set_protected:Npn \@@_tmp:w #1 +\cs_new:Npn \@@_parse_apply_comma:NwNwN #1 #2@ #3 #4@ #5 { - \cs_new:Npn #1 ##1 - { - \if_meaning:w \s_@@ ##1 - \exp_after:wN \@@_use_i_until_s:nw - \exp_after:wN #1 - \fi: - \exp_after:wN \c_nan_fp - ##1 - } + \exp_after:wN \@@_parse_continue:NwN + \exp_after:wN #1 + \exp:w \exp_end_continue_f:w + \@@_exp_after_tuple_f:nw { } + \s_@@_tuple \@@_tuple_chk:w { #2 #4 } ; + #5 #1 } -\exp_args:Nc \@@_tmp:w { @@_,_o:ww } % \end{macrocode} % \end{macro} % \end{macro} -% \end{macro} % % \subsubsection{Usual infix operators} % @@ -2318,48 +2423,10 @@ % \begin{macro}[EXP]+\@@_parse_infix_(:N+ % When an opening parenthesis appears where we expect an infix % operator, we compute the product of the previous operand and the -% contents of the parentheses using \cs{@@_parse_infix_juxtapose:N}. +% contents of the parentheses using \cs{@@_parse_infix_mul:N}. % \begin{macrocode} \cs_new:cpn { @@_parse_infix_(:N } #1 - { \@@_parse_infix_juxtapose:N #1 ( } -% \end{macrocode} -% \end{macro} -% -% ^^A todo: can |...(1,2,3)pt| really occur? If not, simplify. -% \begin{macro}[EXP] -% {\@@_parse_infix_juxtapose:N, \@@_parse_apply_juxtapose:NwwN} -% Juxtaposition follows the same scheme as other binary operations, -% but calls \cs{@@_parse_apply_juxtapose:NwwN} rather than directly -% calling \cs{@@_parse_apply_binary:NwNwN}. This lets us catch errors -% such as |...(1,2,3)pt| where one operand of the juxtaposition is not -% a single number: both |#3| and~|#5| of the \texttt{apply} auxiliary -% must be empty. -% \begin{macrocode} -\cs_new:Npn \@@_parse_infix_juxtapose:N #1 - { - \if_int_compare:w #1 < \c_@@_prec_times_int - \exp_after:wN @ - \exp_after:wN \@@_parse_apply_juxtapose:NwwN - \exp:w - \@@_parse_operand:Nw \c_@@_prec_times_int - \exp_after:wN \@@_parse_expand:w - \else: - \exp_after:wN @ - \exp_after:wN \use_none:n - \exp_after:wN \@@_parse_infix_juxtapose:N - \fi: - } -\cs_new:Npn \@@_parse_apply_juxtapose:NwwN #1 #2;#3@ #4;#5@ - { - \if_catcode:w ^ \tl_to_str:n { #3 #5 } ^ - \else: - \@@_error:nffn { fp-invalid-ii } - { \@@_array_to_clist:n { #2; #3 } } - { \@@_array_to_clist:n { #4; #5 } } - { } - \fi: - \@@_parse_apply_binary:NwNwN #1 #2;@ * #4;@ - } + { \@@_parse_infix_mul:N #1 ( } % \end{macrocode} % \end{macro} % @@ -2436,7 +2503,7 @@ \exp_args:Nc \@@_tmp:w { @@_parse_infix_::N } \@@_ternary_auxii:NwwN \c_@@_prec_colon_int { - \__msg_kernel_expandable_error:nnnn + \__kernel_msg_expandable_error:nnnn { kernel } { fp-missing } { ? } { ~for~?: } } % \end{macrocode} @@ -2477,7 +2544,7 @@ } \cs_new:Npn \@@_parse_excl_error: { - \__msg_kernel_expandable_error:nnnn + \__kernel_msg_expandable_error:nnnn { kernel } { fp-missing } { = } { ~after~!. } } \cs_new:Npn \@@_parse_compare:NNNNNNN #1 @@ -2570,6 +2637,142 @@ % \end{macro} % \end{macro} % +% \subsection{Tools for functions} +% +% \begin{macro}[EXP]{\@@_parse_function_all_fp_o:fnw} +% Followed by \Arg{function name} \Arg{code} \meta{float array} |@| +% this checks all floats are floating point numbers (no tuples). +% \begin{macrocode} +\cs_new:Npn \@@_parse_function_all_fp_o:fnw #1#2#3 @ + { + \@@_array_if_all_fp:nTF {#3} + { #2 #3 @ } + { + \@@_error:nffn { fp-bad-args } + {#1} + { \fp_to_tl:n { \s_@@_tuple \@@_tuple_chk:w {#3} ; } } + { } + \exp_after:wN \c_nan_fp + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_parse_function_one_two:nnw} +% \begin{macro}[EXP] +% { +% \@@_parse_function_one_two_error_o:w, +% \@@_parse_function_one_two_aux:nnw, +% \@@_parse_function_one_two_auxii:nnw +% } +% This is followed by \Arg{function name} \Arg{code} \meta{float +% array} |@|. It checks that the \meta{float array} consists of one +% or two floating point numbers (not tuples), then leaves the +% \meta{code} (if there is one float) or its tail (if there are two +% floats) followed by the \meta{float array}. The \meta{code} should +% start with a single token such as \cs{@@_atan_default:w} that deals +% with the single-float case. +% +% The first \cs{@@_if_type_fp:NTwFw} test catches the case of no +% argument and the case of a tuple argument. The next one +% distinguishes the case of a single argument (no error, just add +% \cs{c_one_fp}) from a tuple second argument. Finally check there is +% no further argument. +% \begin{macrocode} +\cs_new:Npn \@@_parse_function_one_two:nnw #1#2#3 + { + \@@_if_type_fp:NTwFw + #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \q_stop + \@@_parse_function_one_two_aux:nnw {#1} {#2} #3 + } +\cs_new:Npn \@@_parse_function_one_two_error_o:w #1#2#3#4 @ + { + \@@_error:nffn { fp-bad-args } + {#2} + { \fp_to_tl:n { \s_@@_tuple \@@_tuple_chk:w {#4} ; } } + { } + \exp_after:wN \c_nan_fp + } +\cs_new:Npn \@@_parse_function_one_two_aux:nnw #1#2 #3; #4 + { + \@@_if_type_fp:NTwFw + #4 { } + \s_@@ + { + \if_meaning:w @ #4 + \exp_after:wN \use_iv:nnnn + \fi: + \@@_parse_function_one_two_error_o:w + } + \q_stop + \@@_parse_function_one_two_auxii:nnw {#1} {#2} #3; #4 + } +\cs_new:Npn \@@_parse_function_one_two_auxii:nnw #1#2#3; #4; #5 + { + \if_meaning:w @ #5 \else: + \exp_after:wN \@@_parse_function_one_two_error_o:w + \fi: + \use_ii:nn {#1} { \use_none:n #2 } #3; #4; #5 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_tuple_map_o:nw, \@@_tuple_map_loop_o:nw} +% Apply |#1| to all items in the following tuple and expand once +% afterwards. The code |#1| should itself expand once after its +% result. +% \begin{macrocode} +\cs_new:Npn \@@_tuple_map_o:nw #1 \s_@@_tuple \@@_tuple_chk:w #2 ; + { + \exp_after:wN \s_@@_tuple + \exp_after:wN \@@_tuple_chk:w + \exp_after:wN { + \exp:w \exp_end_continue_f:w + \@@_tuple_map_loop_o:nw {#1} #2 + { \s_@@ \__prg_break: } ; + \__prg_break_point: + \exp_after:wN } \exp_after:wN ; + } +\cs_new:Npn \@@_tuple_map_loop_o:nw #1#2#3 ; + { + \use_none:n #2 + #1 #2 #3 ; + \exp:w \exp_end_continue_f:w + \@@_tuple_map_loop_o:nw {#1} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_tuple_mapthread_o:nww, \@@_tuple_mapthread_loop_o:nw} +% Apply |#1| to pairs of items in the two following tuples and expand once +% afterwards. +% \begin{macrocode} +\cs_new:Npn \@@_tuple_mapthread_o:nww #1 + \s_@@_tuple \@@_tuple_chk:w #2 ; + \s_@@_tuple \@@_tuple_chk:w #3 ; + { + \exp_after:wN \s_@@_tuple + \exp_after:wN \@@_tuple_chk:w + \exp_after:wN { + \exp:w \exp_end_continue_f:w + \@@_tuple_mapthread_loop_o:nw {#1} + #2 { \s_@@ \__prg_break: } ; @ + #3 { \s_@@ \__prg_break: } ; + \__prg_break_point: + \exp_after:wN } \exp_after:wN ; + } +\cs_new:Npn \@@_tuple_mapthread_loop_o:nw #1#2#3 ; #4 @ #5#6 ; + { + \use_none:n #2 + \use_none:n #5 + #1 #2 #3 ; #5 #6 ; + \exp:w \exp_end_continue_f:w + \@@_tuple_mapthread_loop_o:nw {#1} #4 @ + } +% \end{macrocode} +% \end{macro} +% % \subsection{Candidate: defining new \pkg{l3fp} functions} % % \begin{macro}[EXP]{\fp_function:Nw} @@ -2582,7 +2785,7 @@ \exp_after:wN \@@_function_apply:nw \exp_after:wN #1 \exp:w - \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w + \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w } % \end{macrocode} % \end{macro} @@ -2618,7 +2821,7 @@ \__int_value:w #3 \exp_after:wN ; \exp_after:wN } \exp:w - \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w + \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w } \cs_new:Npn #2 #4 {#5} } @@ -2628,7 +2831,7 @@ \int_compare:nNnTF { \tl_count:n {#3} } = {#2} { #1 #3 } { - \__msg_kernel_expandable_error:nnnnn + \__kernel_msg_expandable_error:nnnnn { kernel } { fp-num-args } { #1() } {#2} {#2} \c_nan_fp } @@ -2682,30 +2885,36 @@ % \subsection{Messages} % % \begin{macrocode} -\__msg_kernel_new:nnn { kernel } { fp-deprecated } +\__kernel_msg_new:nnn { kernel } { fp-deprecated } { '#1'~deprecated;~use~'#2' } -\__msg_kernel_new:nnn { kernel } { unknown-fp-word } +\__kernel_msg_new:nnn { kernel } { unknown-fp-word } { Unknown~fp~word~#1. } -\__msg_kernel_new:nnn { kernel } { fp-missing } +\__kernel_msg_new:nnn { kernel } { fp-missing } { Missing~#1~inserted #2. } -\__msg_kernel_new:nnn { kernel } { fp-extra } +\__kernel_msg_new:nnn { kernel } { fp-extra } { Extra~#1~ignored. } -\__msg_kernel_new:nnn { kernel } { fp-early-end } +\__kernel_msg_new:nnn { kernel } { fp-early-end } { Premature~end~in~fp~expression. } -\__msg_kernel_new:nnn { kernel } { fp-after-e } +\__kernel_msg_new:nnn { kernel } { fp-after-e } { Cannot~use~#1 after~'e'. } -\__msg_kernel_new:nnn { kernel } { fp-missing-number } +\__kernel_msg_new:nnn { kernel } { fp-missing-number } { Missing~number~before~'#1'. } -\__msg_kernel_new:nnn { kernel } { fp-unknown-symbol } +\__kernel_msg_new:nnn { kernel } { fp-unknown-symbol } { Unknown~symbol~#1~ignored. } -\__msg_kernel_new:nnn { kernel } { fp-extra-comma } - { Unexpected~comma:~extra~arguments~ignored. } -\__msg_kernel_new:nnn { kernel } { fp-num-args } +\__kernel_msg_new:nnn { kernel } { fp-extra-comma } + { Unexpected~comma~turned~to~nan~result. } +\__kernel_msg_new:nnn { kernel } { fp-no-arg } + { #1~got~no~argument;~used~nan. } +\__kernel_msg_new:nnn { kernel } { fp-multi-arg } + { #1~got~more~than~one~argument;~used~nan. } +\__kernel_msg_new:nnn { kernel } { fp-num-args } { #1~expects~between~#2~and~#3~arguments. } +\__kernel_msg_new:nnn { kernel } { fp-bad-args } + { Arguments~in~#1#2~are~invalid. } %<*package> \cs_if_exist:cT { @unexpandable@protect } { - \__msg_kernel_new:nnn { kernel } { fp-robust-cmd } + \__kernel_msg_new:nnn { kernel } { fp-robust-cmd } { Robust~command~#1 invalid~in~fp~expression! } } % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index cc1864eb9eb..f8ca2c4a81e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-random.dtx Copyright (C) 2016,2017 The LaTeX3 Project +%% File: l3fp-random.dtx Copyright (C) 2016-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -79,11 +79,11 @@ % \begin{macrocode} \cs_if_exist:NF \pdftex_uniformdeviate:D { - \__msg_kernel_new:nnn { kernel } { fp-no-random } + \__kernel_msg_new:nnn { kernel } { fp-no-random } { Random~numbers~unavailable } \cs_new:Npn \@@_rand_o:Nw ? #1 @ { - \__msg_kernel_expandable_error:nn { kernel } { fp-no-random } + \__kernel_msg_expandable_error:nn { kernel } { fp-no-random } \exp_after:wN \c_nan_fp } \cs_new_eq:NN \@@_randint_o:Nw \@@_rand_o:Nw @@ -197,7 +197,7 @@ \tl_if_empty:nTF {#1} { \@@_rand_o: } { - \__msg_kernel_expandable_error:nnnnn + \__kernel_msg_expandable_error:nnnnn { kernel } { fp-num-args } { rand() } { 0 } { 0 } \exp_after:wN \c_nan_fp } @@ -213,8 +213,9 @@ % \begin{macro}[EXP]{\@@_randint_o:Nw} % \begin{macro}[EXP] % { +% \@@_randint_default:w, % \@@_randint_badarg:w, -% \@@_randint_e:w, +% \@@_randint_o:w, % \@@_randint_e:wnn, % \@@_randint_e:wwNnn, % \@@_randint_e:wwwNnn, @@ -243,19 +244,13 @@ % bound. The result is compared to the upper bound and the process % repeats if needed. % \begin{macrocode} -\cs_new:Npn \@@_randint_o:Nw ? #1 @ +\cs_new:Npn \@@_randint_o:Nw ? { - \if_case:w - \__int_eval:w \@@_array_count:n {#1} - 1 \__int_eval_end: - \exp_after:wN \@@_randint_e:w \c_one_fp #1 - \or: \@@_randint_e:w #1 - \else: - \__msg_kernel_expandable_error:nnnnn - { kernel } { fp-num-args } { randint() } { 1 } { 2 } - \exp_after:wN \c_nan_fp \exp:w - \fi: - \exp_after:wN \exp_end: + \@@_parse_function_one_two:nnw + { randint } + { \@@_randint_default:w \@@_randint_o:w } } +\cs_new:Npn \@@_randint_default:w #1 { \exp_after:wN #1 \c_one_fp } \cs_new:Npn \@@_randint_badarg:w \s_@@ \@@_chk:w #1#2#3; { \@@_int:wTF \s_@@ \@@_chk:w #1#2#3; @@ -269,7 +264,7 @@ } { 1 \exp_stop_f: } } -\cs_new:Npn \@@_randint_e:w #1; #2; +\cs_new:Npn \@@_randint_o:w #1; #2; @ { \if_case:w \@@_randint_badarg:w #1; @@ -282,6 +277,7 @@ { randint } { \@@_array_to_clist:n { #1; #2; } } \exp:w \fi: + \exp_after:wN \exp_end: } \cs_new:Npn \@@_randint_e:wnn #1; { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 2b088b5832e..10bc2370e7b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-round.dtx Copyright(C) 2011-2017 The LaTeX3 Project +%% File: l3fp-round.dtx Copyright(C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -116,14 +116,13 @@ \@@_round_o:Nw \@@_round_to_nearest:NNN #1 #2 } -\__debug:TF +\__kernel_debug:TF { - \tl_gput_right:Nn \g__debug_deprecation_on_tl + \__kernel_deprecation_code:nn { \cs_set_eq:NN \@@_parse_round:Nw \@@_parse_round_deprecation_error:Nw } - \tl_gput_right:Nn \g__debug_deprecation_off_tl { \cs_set_eq:NN \@@_parse_round:Nw \@@_parse_round_no_error:Nw @@ -423,14 +422,21 @@ % % ^^A todo: This macro is intermingled with l3fp-parse. % ^^A todo: Add explanations. -% \begin{macro}[EXP]{\@@_round_o:Nw} +% \begin{macro}[EXP]{\@@_round_o:Nw, \@@_round_aux_o:Nw} +% First check that all arguments are floating point numbers. % The |trunc|, |ceil| and |floor| functions expect one or two % arguments (the second is $0$ by default), and the |round| function % also accepts a third argument (\texttt{nan} by default), which % changes |#1| from \cs{@@_round_to_nearest:NNN} to one of its % analogues. % \begin{macrocode} -\cs_new:Npn \@@_round_o:Nw #1#2 @ +\cs_new:Npn \@@_round_o:Nw #1 + { + \@@_parse_function_all_fp_o:fnw + { \@@_round_name_from_cs:N #1 } + { \@@_round_aux_o:Nw #1 } + } +\cs_new:Npn \@@_round_aux_o:Nw #1#2 @ { \if_case:w \__int_eval:w \@@_array_count:n {#2} \__int_eval_end: diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index bdc717a2221..02b769a1691 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % \maketitle % % \begin{documentation} @@ -125,11 +125,11 @@ { invalid_operation , division_by_zero , overflow , underflow } {#1} { - \__msg_kernel_error:nnxx { kernel } + \__kernel_msg_error:nnxx { kernel } { unknown-fpu-trap-type } {#1} {#2} } { - \__msg_kernel_error:nnx + \__kernel_msg_error:nnx { kernel } { unknown-fpu-exception } {#1} } } @@ -336,7 +336,7 @@ % \begin{macro}[EXP]{\@@_error:nnnn, \@@_error:nnfn, \@@_error:nffn} % \begin{macrocode} \cs_new:Npn \@@_error:nnnn - { \__msg_kernel_expandable_error:nnnnn { kernel } } + { \__kernel_msg_expandable_error:nnnnn { kernel } } \cs_generate_variant:Nn \@@_error:nnnn { nnf, nff } % \end{macrocode} % \end{macro} @@ -345,7 +345,7 @@ % % Some messages. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { unknown-fpu-exception } +\__kernel_msg_new:nnnn { kernel } { unknown-fpu-exception } { The~FPU~exception~'#1'~is~not~known:~ that~trap~will~never~be~triggered. @@ -360,7 +360,7 @@ * ~ underflow } } -\__msg_kernel_new:nnnn { kernel } { unknown-fpu-trap-type } +\__kernel_msg_new:nnnn { kernel } { unknown-fpu-trap-type } { The~FPU~trap~type~'#2'~is~not~known. } { The~trap~type~must~be~one~of \\ @@ -371,18 +371,20 @@ * ~ none } } -\__msg_kernel_new:nnn { kernel } { fp-flow } +\__kernel_msg_new:nnn { kernel } { fp-flow } { An ~ #3 ~ occurred. } -\__msg_kernel_new:nnn { kernel } { fp-flow-to } +\__kernel_msg_new:nnn { kernel } { fp-flow-to } { #1 ~ #3 ed ~ to ~ #2 . } -\__msg_kernel_new:nnn { kernel } { fp-zero-div } +\__kernel_msg_new:nnn { kernel } { fp-zero-div } { Division~by~zero~in~ #1 (#2) } -\__msg_kernel_new:nnn { kernel } { fp-zero-div-ii } +\__kernel_msg_new:nnn { kernel } { fp-zero-div-ii } { Division~by~zero~in~ (#1) #3 (#2) } -\__msg_kernel_new:nnn { kernel } { fp-invalid } +\__kernel_msg_new:nnn { kernel } { fp-invalid } { Invalid~operation~ #1 (#2) } -\__msg_kernel_new:nnn { kernel } { fp-invalid-ii } +\__kernel_msg_new:nnn { kernel } { fp-invalid-ii } { Invalid~operation~ (#1) #3 (#2) } +\__kernel_msg_new:nnn { kernel } { fp-unknown-type } + { Unknown~type~for~'#1' } % \end{macrocode} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 73c97574dd4..2bccf65847a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3fp-trig.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3fp-trig.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1087,44 +1087,34 @@ % % \subsubsection{Arctangent and arccotangent} % -% \begin{macro}[EXP]{\@@_atan_o:Nw, \@@_acot_o:Nw} -% \begin{macro}[EXP]{\@@_atan_dispatch_o:NNnNw} +% \begin{macro}[EXP]{\@@_atan_o:Nw, \@@_acot_o:Nw, \@@_atan_default:w} % The parsing step manipulates \texttt{atan} and \texttt{acot} like % \texttt{min} and \texttt{max}, reading in an array of operands, but % also leaves \cs{use_i:nn} or \cs{use_ii:nn} depending on whether the -% result should be given in radians or in degrees. Here, we dispatch -% according to the number of arguments. The one-argument versions of -% arctangent and arccotangent are special cases of the two-argument -% ones: $\operatorname{atan}(y) = \operatorname{atan}(y, 1) = \operatorname{acot}(1, y)$ and -% $\operatorname{acot}(x) = \operatorname{atan}(1, x) = \operatorname{acot}(x, 1)$. +% result should be given in radians or in degrees. The helper +% \cs{@@_parse_function_one_two:nnw} checks that the operand is one or +% two floating point numbers (not tuples) and leaves its second +% argument or its tail accordingly (its first argument is used for +% error messages). More precisely if we are given a single floating +% point number \cs{@@_atan_default:w} places \cs{c_one_fp} (expanded) +% after it; otherwise \cs{@@_atan_default:w} is omitted by +% \cs{@@_parse_function_one_two:nnw}. % \begin{macrocode} -\cs_new:Npn \@@_atan_o:Nw +\cs_new:Npn \@@_atan_o:Nw #1 { - \@@_atan_dispatch_o:NNnNw - \@@_acotii_o:Nww \@@_atanii_o:Nww { atan } + \@@_parse_function_one_two:nnw + { #1 { atan } { atand } } + { \@@_atan_default:w \@@_atanii_o:Nww #1 } } -\cs_new:Npn \@@_acot_o:Nw +\cs_new:Npn \@@_acot_o:Nw #1 { - \@@_atan_dispatch_o:NNnNw - \@@_atanii_o:Nww \@@_acotii_o:Nww { acot } - } -\cs_new:Npn \@@_atan_dispatch_o:NNnNw #1#2#3#4#5@ - { - \if_case:w - \__int_eval:w \@@_array_count:n {#5} - 1 \__int_eval_end: - \exp_after:wN #1 \exp_after:wN #4 \c_one_fp #5 - \exp:w - \or: #2 #4 #5 \exp:w - \else: - \__msg_kernel_expandable_error:nnnnn - { kernel } { fp-num-args } { #3() } { 1 } { 2 } - \exp_after:wN \c_nan_fp \exp:w - \fi: - \exp_after:wN \exp_end: + \@@_parse_function_one_two:nnw + { #1 { acot } { acotd } } + { \@@_atan_default:w \@@_acotii_o:Nww #1 } } +\cs_new:Npx \@@_atan_default:w #1#2#3 @ { #1 #2 #3 \c_one_fp @ } % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}[EXP]{\@@_atanii_o:Nww, \@@_acotii_o:Nww} % If either operand is \texttt{nan}, we return it. If both are @@ -1139,7 +1129,7 @@ % \cs{@@_acotii_o:ww} simply reverses its two arguments. % \begin{macrocode} \cs_new:Npn \@@_atanii_o:Nww - #1 \s_@@ \@@_chk:w #2#3#4; \s_@@ \@@_chk:w #5 + #1 \s_@@ \@@_chk:w #2#3#4; \s_@@ \@@_chk:w #5 #6 @ { \if_meaning:w 3 #2 \@@_case_return_i_o:ww \fi: \if_meaning:w 3 #5 \@@_case_return_ii_o:ww \fi: @@ -1156,7 +1146,7 @@ \fi: \@@_atan_normal_o:NNnwNnw #1 \s_@@ \@@_chk:w #2#3#4; - \s_@@ \@@_chk:w #5 + \s_@@ \@@_chk:w #5 #6 } \cs_new:Npn \@@_acotii_o:Nww #1#2; #3; { \@@_atanii_o:Nww #1#3; #2; } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index 54019a2baaf..1558b86d6f8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -47,7 +47,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -408,7 +408,7 @@ % an optional leading~|!| (which negates the \meta{relation}), with % the restriction that the \meta{relation} may not start with~|?|, as % this symbol has a different meaning (in combination with~|:|) within -% floatin point expressions. The comparison $x$~\meta{relation}~$y$ +% floating point expressions. The comparison $x$~\meta{relation}~$y$ % is then \texttt{true} if the \meta{relation} does not start with~|!| % and the actual relation (|<|, |=|, |>|, or~|?|) between $x$ and~$y$ % appears within the \meta{relation}, or on the contrary if the @@ -884,7 +884,7 @@ % Each \meta{relation} consists of a non-empty string of |<|, |=|, % |>|, and~|?|, optionally preceded by~|!|, and may not start % with~|?|. This evaluates to $+1$ if all comparisons -% \meta{operand_i} \meta{relation_j} \meta{operand_{i+1}} are true, and +% \meta{operand_i} \meta{relation_i} \meta{operand_{i+1}} are true, and % $+0$ otherwise. All \meta{operands} are evaluated in all cases. % See \cs{fp_compare:nTF} for details. % \end{function} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index 53945625ced..732c2b7b968 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3int.dtx Copyright (C) 1990-2017 The LaTeX3 Project +%% File: l3int.dtx Copyright (C) 1990-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1035,8 +1035,8 @@ % or directly in the input stream. % When debugging, use parentheses to catch early termination. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_eval:n } } \cs_new:Npn \int_eval:n #1 { \@@_value:w \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} @@ -1047,8 +1047,8 @@ % so as to produce an internal integer rather than expanding into % characters. This is for use in other modules. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } \cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} % \end{macro} @@ -1065,8 +1065,8 @@ % evaluation. The absolute value is obtained by removing a leading % sign if any. All three functions expand in two steps. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_abs:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_abs:n } } \cs_new:Npn \int_abs:n #1 { \@@_value:w \exp_after:wN \@@_abs:N @@ -1075,10 +1075,10 @@ } \cs_new:Npn \@@_abs:N #1 { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_max:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_max:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_max:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_max:nn } } \cs_set:Npn \int_max:nn #1#2 { @@ -1088,10 +1088,10 @@ > \exp_stop_f: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_min:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_min:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_min:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_min:nn } } \cs_set:Npn \int_min:nn #1#2 { @@ -1137,10 +1137,10 @@ % truncating behaviour that we want. The details are thanks to Heiko % Oberdiek: getting things right in all cases is not so easy. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_div_truncate:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_div_truncate:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_div_truncate:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_div_truncate:nn } } \cs_new:Npn \int_div_truncate:nn #1#2 { @@ -1171,10 +1171,10 @@ % \end{macrocode} % Finally there's the modulus operation. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_mod:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_mod:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_mod:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_mod:nn } } \cs_new:Npn \int_mod:nn #1#2 { @@ -1224,10 +1224,10 @@ % We cannot use \cs{int_gset:Nn} because (when |check-declarations| is % enabled) this runs some checks that constants would fail. % \begin{macrocode} -\__debug_patch_args:nnnNNpn - { \__debug_chk_var_scope:NN c #1 } +\__kernel_patch_args:nnnNNpn + { \__kernel_chk_var_scope:NN c #1 } { } - { {#1} { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } } + { {#1} { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_const:Nn } } \cs_new_protected:Npn \int_const:Nn #1#2 { \int_compare:nNnTF {#2} < \c_zero @@ -1273,9 +1273,9 @@ % \UnitTested % Functions that reset an \meta{integer} register to zero. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero } \cs_generate_variant:Nn \int_zero:N { c } \cs_generate_variant:Nn \int_gzero:N { c } @@ -1305,10 +1305,10 @@ % another. Check that assigned integer is local/global. No need to % check that the other one is defined as \TeX{} does it for us. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_set_eq:NN #1#2 { #1 = #2 } \cs_generate_variant:Nn \int_set_eq:NN { c , Nc , cc } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gset_eq:NN #1#2 { \tex_global:D #1 = #2 } \cs_generate_variant:Nn \int_gset_eq:NN { c , Nc , cc } % \end{macrocode} @@ -1335,10 +1335,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2#3 { - \__debug_patch_args:nnnNNpn + \__kernel_patch_args:nnnNNpn { #1 ##1 } { } - { {##1} { \__debug_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } #2 #3 } % \end{macrocode} @@ -1356,16 +1356,16 @@ % assigned variable is correctly local/global and wraps the % expression in some checking code. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_add:Nn #1#2 { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_sub:Nn #1#2 { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: } \cs_generate_variant:Nn \int_add:Nn { c } @@ -1389,16 +1389,16 @@ % Incrementing and decrementing of integer registers is done with % the following functions. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_incr:N #1 { \tex_advance:D #1 \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \int_decr:N #1 { \tex_advance:D #1 - \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gincr:N #1 { \tex_global:D \tex_advance:D #1 \c_one } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \int_gdecr:N #1 { \tex_global:D \tex_advance:D #1 - \c_one } \cs_generate_variant:Nn \int_incr:N { c } @@ -1420,10 +1420,10 @@ % existence as for token list variables. However, the code that % checks whether the assignment is local or global is still needed. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \int_set:Nn #1#2 { #1 ~ \@@_eval:w #2 \@@_eval_end: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \int_gset:Nn #1#2 { \tex_global:D #1 ~ \@@_eval:w #2 \@@_eval_end: } \cs_generate_variant:Nn \int_set:Nn { c } @@ -1474,7 +1474,7 @@ { { } \c_zero \fi: - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { unknown-comparison } {#1} \prg_return_false: } @@ -1627,11 +1627,11 @@ % \UnitTested % More efficient but less natural in typing. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn +\__kernel_patch_conditional_args:nNNpnn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_compare:nNn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_compare:nNn } { \@@_eval_end: #2 } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \int_compare:nNn } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \int_compare:nNn } } \prg_new_conditional:Npnn \int_compare:nNn #1#2#3 { p , T , F , TF } { @@ -1691,8 +1691,8 @@ % \UnitTested % A predicate function. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_odd:n } } +\__kernel_patch_conditional_args:nNNpnn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_odd:n } } \prg_new_conditional:Npnn \int_if_odd:n #1 { p , T , F , TF} { \if_int_odd:w \@@_eval:w #1 \@@_eval_end: @@ -1701,8 +1701,8 @@ \prg_return_false: \fi: } -\__debug_patch_conditional_args:nNNpnn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_even:n } } +\__kernel_patch_conditional_args:nNNpnn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_if_even:n } } \prg_new_conditional:Npnn \int_if_even:n #1 { p , T , F , TF} { \if_int_odd:w \@@_eval:w #1 \@@_eval_end: @@ -1818,11 +1818,11 @@ % step size of zero before checking the sign, but we optimize for the % most frequent case (positive step). % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \int_step_function:nnnN } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \int_step_function:nnnN } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \int_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \int_step_function:nnnN } } \cs_new:Npn \int_step_function:nnnN #1#2#3 { @@ -1838,7 +1838,7 @@ { \int_compare:nNnTF {#2} = \c_zero { - \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#4} + \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#4} \use_none:nnnn } { \@@_step:NnnnN < } @@ -2593,14 +2593,9 @@ %\cs_gset_eq:NN \c__deprecation_minus_one \m@ne %\int_const:Nn \c__deprecation_minus_one { -1 } \cs_new_eq:NN \c_minus_one \c__deprecation_minus_one -\__debug:TF - { - \tl_gput_right:Nn \g__debug_deprecation_on_tl - { \__deprecation_error:Nnn \c_minus_one { -1 } { 2018-12-31 } } - \tl_gput_right:Nn \g__debug_deprecation_off_tl - { \tex_let:D \c_minus_one \c__deprecation_minus_one } - } - { } +\__kernel_deprecation_code:nn + { \__deprecation_error:Nnn \c_minus_one { -1 } { 2018-12-31 } } + { \tex_let:D \c_minus_one \c__deprecation_minus_one } % \end{macrocode} % \end{variable} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index a2bb2d9e1fd..a9af6f8f40d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -184,7 +184,7 @@ \int_compare:nTF { - \c_max_dim <= \int_abs:n {#3} <= \c_max_dim } { \@@_gset_fast:Nnn #1 {#2} {#3} } { - \__msg_kernel_error:nnxxxx { kernel } { overflow } + \__kernel_msg_error:nnxxxx { kernel } { overflow } { \token_to_str:N #1 } {#2} {#3} { \int_compare:nNnT {#3} < 0 { - } \__int_value:w \c_max_dim } \@@_gset_fast:Nnn #1 {#2} @@ -192,7 +192,7 @@ } } { - \__msg_kernel_error:nnxxx { kernel } { out-of-bounds } + \__kernel_msg_error:nnxxx { kernel } { out-of-bounds } { \token_to_str:N #1 } {#2} { \@@_count:N #1 } } } @@ -213,7 +213,7 @@ \int_compare:nTF { 1 <= #2 <= \@@_count:N #1 } { \@@_item_fast:Nn #1 {#2} } { - \__msg_kernel_expandable_error:nnnnn { kernel } { out-of-bounds } + \__kernel_msg_expandable_error:nnnnn { kernel } { out-of-bounds } { \token_to_str:N #1 } {#2} { \@@_count:N #1 } 0 } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 1ccd2b357c2..5e5a5399d42 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3keys.dtx Copyright (C) 2006-2017 The LaTeX3 Project +%% File: l3keys.dtx Copyright (C) 2006-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1064,7 +1064,7 @@ } \else: \cs_set:Npn \@@_action: - { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } } + { \__kernel_msg_error:nn { kernel } { misplaced-equals-sign } } \fi: \fi: \@@_action: @@ -1079,7 +1079,7 @@ } \cs_new:Npn \@@_action: { } \cs_new_protected:Npn \@@_empty_key: - { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } } + { \__kernel_msg_error:nn { kernel } { misplaced-equals-sign } } % \end{macrocode} % \end{macro} % \end{macro} @@ -1105,7 +1105,7 @@ % % One message for the low level parsing system. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { misplaced-equals-sign } +\__kernel_msg_new:nnnn { kernel } { misplaced-equals-sign } { Misplaced~equals~sign~in~key-value~input~\msg_line_number: } { LaTeX~is~attempting~to~parse~some~key-value~input~but~found~ @@ -1295,7 +1295,7 @@ { \tl_if_empty:NF \l_@@_property_tl { - \__msg_kernel_error:nnxx { kernel } { property-unknown } + \__kernel_msg_error:nnxx { kernel } { property-unknown } { \l_@@_property_tl } { \l_keys_path_tl } } } @@ -1321,7 +1321,7 @@ \tl_if_blank:nTF {#3} { \tl_clear:N \l_@@_property_tl - \__msg_kernel_error:nnn { kernel } { key-no-property } {#4} + \__kernel_msg_error:nnn { kernel } { key-no-property } {#4} } { \str_if_eq:nnTF {#3} { . } @@ -1372,7 +1372,7 @@ \l_@@_property_tl \q_stop { \use:c { \c_@@_props_root_tl \l_@@_property_tl } } { - \__msg_kernel_error:nnxx { kernel } + \__kernel_msg_error:nnxx { kernel } { property-requires-value } { \l_@@_property_tl } { \l_keys_path_tl } } @@ -1406,7 +1406,7 @@ { \exp_not:c { bool_ #2 set_false:N } \exp_not:N #1 } \@@_cmd_set:nn { \l_keys_path_tl / unknown } { - \__msg_kernel_error:nnx { kernel } { boolean-values-only } + \__kernel_msg_error:nnx { kernel } { boolean-values-only } { \l_keys_key_tl } } \@@_default_set:n { true } @@ -1428,7 +1428,7 @@ { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 } \@@_cmd_set:nn { \l_keys_path_tl / unknown } { - \__msg_kernel_error:nnx { kernel } { boolean-values-only } + \__kernel_msg_error:nnx { kernel } { boolean-values-only } { \l_keys_key_tl } } \@@_default_set:n { true } @@ -1457,7 +1457,7 @@ { \exp_not:v { \c_@@_type_root_tl \@@_parent:o \l_keys_path_tl } } { choice } { - \__msg_kernel_error:nnxx { kernel } { nested-choice-key } + \__kernel_msg_error:nnxx { kernel } { nested-choice-key } { \l_keys_path_tl } { \@@_parent:o \l_keys_path_tl } } { \@@_choice_make_aux:N #1 } @@ -1470,7 +1470,7 @@ \@@_cmd_set:nn { \l_keys_path_tl } { #1 {##1} } \@@_cmd_set:nn { \l_keys_path_tl / unknown } { - \__msg_kernel_error:nnxx { kernel } { key-choice-unknown } + \__kernel_msg_error:nnxx { kernel } { key-choice-unknown } { \l_keys_path_tl } {##1} } } @@ -1513,10 +1513,10 @@ % Setting the code for a key first logs if appropriate that we are % defining a new key, then saves the code. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { \cs_if_exist:cF { \c_@@_code_root_tl #1 } - { \__debug_log:x { Defining~key~#1~\msg_line_context: } } + { \__kernel_debug_log:x { Defining~key~#1~\msg_line_context: } } } { } \cs_new_protected:Npn \@@_cmd_set:nn #1#2 @@ -1658,7 +1658,7 @@ } } { - \__msg_kernel_error:nnx { kernel } { property-boolean-values-only } + \__kernel_msg_error:nnx { kernel } { property-boolean-values-only } { .value_ #1 :n } } } @@ -1666,7 +1666,7 @@ { \bool_if:NF \l_@@_no_value_bool { - \__msg_kernel_error:nnxx { kernel } { value-forbidden } + \__kernel_msg_error:nnxx { kernel } { value-forbidden } { \l_keys_path_tl } { \l_keys_value_tl } \@@_validate_cleanup:w } @@ -1675,7 +1675,7 @@ { \bool_if:NT \l_@@_no_value_bool { - \__msg_kernel_error:nnx { kernel } { value-required } + \__kernel_msg_error:nnx { kernel } { value-required } { \l_keys_path_tl } \@@_validate_cleanup:w } @@ -2338,7 +2338,7 @@ \exp_after:wN \cs_end: \exp_after:wN { \l_keys_value_tl } } { - \__msg_kernel_error:nnxx { kernel } { key-unknown } + \__kernel_msg_error:nnxx { kernel } { key-unknown } { \l_keys_path_tl } { \l_@@_module_tl } } } @@ -2471,16 +2471,16 @@ % % For when there is a need to complain. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { boolean-values-only } +\__kernel_msg_new:nnnn { kernel } { boolean-values-only } { Key~'#1'~accepts~boolean~values~only. } { The~key~'#1'~only~accepts~the~values~'true'~and~'false'. } -\__msg_kernel_new:nnnn { kernel } { key-choice-unknown } +\__kernel_msg_new:nnnn { kernel } { key-choice-unknown } { Key~'#1'~accepts~only~a~fixed~set~of~choices. } { The~key~'#1'~only~accepts~predefined~values,~ and~'#2'~is~not~one~of~these. } -\__msg_kernel_new:nnnn { kernel } { key-no-property } +\__kernel_msg_new:nnnn { kernel } { key-no-property } { No~property~given~in~definition~of~key~'#1'. } { \c__msg_coding_error_text_tl @@ -2489,51 +2489,51 @@ \iow_indent:n { #1 . } \\ \\ LaTeX~did~not~find~a~'.'~to~indicate~the~start~of~a~property. } -\__msg_kernel_new:nnnn { kernel } { key-unknown } +\__kernel_msg_new:nnnn { kernel } { key-unknown } { The~key~'#1'~is~unknown~and~is~being~ignored. } { The~module~'#2'~does~not~have~a~key~called~'#1'.\\ Check~that~you~have~spelled~the~key~name~correctly. } -\__msg_kernel_new:nnnn { kernel } { nested-choice-key } +\__kernel_msg_new:nnnn { kernel } { nested-choice-key } { Attempt~to~define~'#1'~as~a~nested~choice~key. } { The~key~'#1'~cannot~be~defined~as~a~choice~as~the~parent~key~'#2'~is~ itself~a~choice. } -\__msg_kernel_new:nnnn { kernel } { property-boolean-values-only } +\__kernel_msg_new:nnnn { kernel } { property-boolean-values-only } { The~property~'#1'~accepts~boolean~values~only. } { \c__msg_coding_error_text_tl The~property~'#1'~only~accepts~the~values~'true'~and~'false'. } -\__msg_kernel_new:nnnn { kernel } { property-requires-value } +\__kernel_msg_new:nnnn { kernel } { property-requires-value } { The~property~'#1'~requires~a~value. } { \c__msg_coding_error_text_tl LaTeX~was~asked~to~set~property~'#1'~for~key~'#2'.\\ No~value~was~given~for~the~property,~and~one~is~required. } -\__msg_kernel_new:nnnn { kernel } { property-unknown } +\__kernel_msg_new:nnnn { kernel } { property-unknown } { The~key~property~'#1'~is~unknown. } { \c__msg_coding_error_text_tl LaTeX~has~been~asked~to~set~the~property~'#1'~for~key~'#2':~ this~property~is~not~defined. } -\__msg_kernel_new:nnnn { kernel } { value-forbidden } +\__kernel_msg_new:nnnn { kernel } { value-forbidden } { The~key~'#1'~does~not~take~a~value. } { The~key~'#1'~should~be~given~without~a~value.\\ The~value~'#2'~was~present:~the~key~will~be~ignored. } -\__msg_kernel_new:nnnn { kernel } { value-required } +\__kernel_msg_new:nnnn { kernel } { value-required } { The~key~'#1'~requires~a~value. } { The~key~'#1'~must~have~a~value.\\ No~value~was~present:~the~key~will~be~ignored. } -\__msg_kernel_new:nnn { kernel } { show-key } +\__kernel_msg_new:nnn { kernel } { show-key } { The~key~#1~ \tl_if_empty:nTF {#2} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 2cbe4a5b78f..2cf851e9184 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -210,7 +210,7 @@ { \cs_set:Npn #1 ##1 { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { luatex-required } { #1 } } } @@ -219,7 +219,7 @@ { \cs_set_protected:Npn #1 ##1 { - \__msg_kernel_error:nnn + \__kernel_msg_error:nnn { kernel } { luatex-required } { #1 } } } @@ -232,7 +232,7 @@ % \subsection{Messages} % % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { luatex-required } +\__kernel_msg_new:nnnn { kernel } { luatex-required } { LuaTeX~engine~not~in~use!~Ignoring~#1. } { The~feature~you~are~using~is~only~available~ diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 940c93558ed..a18c7b553ff 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3msg.dtx Copyright (C) 2009-2017 The LaTeX3 Project +%% File: l3msg.dtx Copyright (C) 2009-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -530,10 +530,10 @@ % but have their own functions. This allows some text to be pre-defined, % and also ensures that serious errors can be handled properly. % -% \begin{function}[updated = 2011-08-16] -% {\__msg_kernel_new:nnnn, \__msg_kernel_new:nnn} +% \begin{function}[added = 2017-12-17] +% {\__kernel_msg_new:nnnn, \__kernel_msg_new:nnn} % \begin{syntax} -% \cs{__msg_kernel_new:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text} +% \cs{__kernel_msg_new:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text} % \end{syntax} % Creates a kernel \meta{message} for a given \meta{module}. % The message is defined to first give \meta{text} and then @@ -544,9 +544,10 @@ % An error is raised if the \meta{message} already exists. % \end{function} % -% \begin{function}{\__msg_kernel_set:nnnn, \__msg_kernel_set:nnn} +% \begin{function}[added = 2017-12-17] +% {\__kernel_msg_set:nnnn, \__kernel_msg_set:nnn} % \begin{syntax} -% \cs{__msg_kernel_set:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text} +% \cs{__kernel_msg_set:nnnn} \Arg{module} \Arg{message} \Arg{text} \Arg{more text} % \end{syntax} % Sets up the text for a kernel \meta{message} for a given \meta{module}. % The message is defined to first give \meta{text} and then @@ -556,40 +557,40 @@ % these will be supplied and expanded at the time the message is used. % \end{function} % -% \begin{function}[updated = 2012-08-11] +% \begin{function}[added = 2017-12-17] % { -% \__msg_kernel_fatal:nnnnnn , -% \__msg_kernel_fatal:nnnnn , -% \__msg_kernel_fatal:nnnn , -% \__msg_kernel_fatal:nnn , -% \__msg_kernel_fatal:nn , -% \__msg_kernel_fatal:nnxxxx , -% \__msg_kernel_fatal:nnxxx , -% \__msg_kernel_fatal:nnxx , -% \__msg_kernel_fatal:nnx +% \__kernel_msg_fatal:nnnnnn , +% \__kernel_msg_fatal:nnnnn , +% \__kernel_msg_fatal:nnnn , +% \__kernel_msg_fatal:nnn , +% \__kernel_msg_fatal:nn , +% \__kernel_msg_fatal:nnxxxx , +% \__kernel_msg_fatal:nnxxx , +% \__kernel_msg_fatal:nnxx , +% \__kernel_msg_fatal:nnx % } % \begin{syntax} -% \cs{__msg_kernel_fatal:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \cs{__kernel_msg_fatal:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} % \end{syntax} % Issues kernel \meta{module} error \meta{message}, passing \meta{arg one} % to \meta{arg four} to the text-creating functions. After issuing a % fatal error the \TeX{} run halts. Cannot be redirected. % \end{function} % -% \begin{function}[updated = 2012-08-11] +% \begin{function}[added = 2017-12-17] % { -% \__msg_kernel_error:nnnnnn , -% \__msg_kernel_error:nnnnn , -% \__msg_kernel_error:nnnn , -% \__msg_kernel_error:nnn , -% \__msg_kernel_error:nn , -% \__msg_kernel_error:nnxxxx , -% \__msg_kernel_error:nnxxx , -% \__msg_kernel_error:nnxx , -% \__msg_kernel_error:nnx +% \__kernel_msg_error:nnnnnn , +% \__kernel_msg_error:nnnnn , +% \__kernel_msg_error:nnnn , +% \__kernel_msg_error:nnn , +% \__kernel_msg_error:nn , +% \__kernel_msg_error:nnxxxx , +% \__kernel_msg_error:nnxxx , +% \__kernel_msg_error:nnxx , +% \__kernel_msg_error:nnx % } % \begin{syntax} -% \cs{__msg_kernel_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \cs{__kernel_msg_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} % \end{syntax} % Issues kernel \meta{module} error \meta{message}, passing \meta{arg one} % to @@ -598,20 +599,20 @@ % the run continues. Cannot be redirected. % \end{function} % -% \begin{function}[updated = 2012-08-11] +% \begin{function}[added = 2017-12-17] % { -% \__msg_kernel_warning:nnnnnn , -% \__msg_kernel_warning:nnnnn , -% \__msg_kernel_warning:nnnn , -% \__msg_kernel_warning:nnn , -% \__msg_kernel_warning:nn , -% \__msg_kernel_warning:nnxxxx , -% \__msg_kernel_warning:nnxxx , -% \__msg_kernel_warning:nnxx , -% \__msg_kernel_warning:nnx +% \__kernel_msg_warning:nnnnnn , +% \__kernel_msg_warning:nnnnn , +% \__kernel_msg_warning:nnnn , +% \__kernel_msg_warning:nnn , +% \__kernel_msg_warning:nn , +% \__kernel_msg_warning:nnxxxx , +% \__kernel_msg_warning:nnxxx , +% \__kernel_msg_warning:nnxx , +% \__kernel_msg_warning:nnx % } % \begin{syntax} -% \cs{__msg_kernel_warning:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \cs{__kernel_msg_warning:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} % \end{syntax} % Issues kernel \meta{module} warning \meta{message}, passing % \meta{arg one} to @@ -619,20 +620,20 @@ % is added to the log file, but the \TeX{} run is not interrupted. % \end{function} % -% \begin{function}[updated = 2012-08-11] +% \begin{function}[added = 2017-12-17] % { -% \__msg_kernel_info:nnnnnn , -% \__msg_kernel_info:nnnnn , -% \__msg_kernel_info:nnnn , -% \__msg_kernel_info:nnn , -% \__msg_kernel_info:nn , -% \__msg_kernel_info:nnxxxx , -% \__msg_kernel_info:nnxxx , -% \__msg_kernel_info:nnxx , -% \__msg_kernel_info:nnx +% \__kernel_msg_info:nnnnnn , +% \__kernel_msg_info:nnnnn , +% \__kernel_msg_info:nnnn , +% \__kernel_msg_info:nnn , +% \__kernel_msg_info:nn , +% \__kernel_msg_info:nnxxxx , +% \__kernel_msg_info:nnxxx , +% \__kernel_msg_info:nnxx , +% \__kernel_msg_info:nnx % } % \begin{syntax} -% \cs{__msg_kernel_info:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \cs{__kernel_msg_info:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} % \end{syntax} % Issues kernel \meta{module} information \meta{message}, passing % \meta{arg one} to \meta{arg four} to the text-creating functions. @@ -649,16 +650,16 @@ % message text and arguments are not expanded, and messages should be % very short. % -% \begin{function}[EXP, added = 2011-11-23] +% \begin{function}[EXP, added = 2017-12-17] % { -% \__msg_kernel_expandable_error:nnnnnn, -% \__msg_kernel_expandable_error:nnnnn, -% \__msg_kernel_expandable_error:nnnn, -% \__msg_kernel_expandable_error:nnn, -% \__msg_kernel_expandable_error:nn +% \__kernel_msg_expandable_error:nnnnnn, +% \__kernel_msg_expandable_error:nnnnn, +% \__kernel_msg_expandable_error:nnnn, +% \__kernel_msg_expandable_error:nnn, +% \__kernel_msg_expandable_error:nn % } % \begin{syntax} -% \cs{__msg_kernel_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \cs{__kernel_msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} % \end{syntax} % Issues an error, passing \meta{arg one} to \meta{arg four} % to the text-creating functions. The resulting string must @@ -750,13 +751,13 @@ % This auxiliary is similar to \cs{__chk_if_free_cs:N}, and is used when % defining messages with \cs{msg_new:nnnn}. % \begin{macrocode} -\__debug_patch:nnNNpn { } - { \__debug_log:x { Defining~message~ #1 / #2 ~\msg_line_context: } } +\__kernel_patch:nnNNpn { } + { \__kernel_debug_log:x { Defining~message~ #1 / #2 ~\msg_line_context: } } \cs_new_protected:Npn \__chk_if_free_msg:nn #1#2 { \msg_if_exist:nnT {#1} {#2} { - \@@_kernel_error:nnxx { kernel } { message-already-defined } + \__kernel_msg_error:nnxx { kernel } { message-already-defined } {#1} {#2} } } @@ -1378,7 +1379,7 @@ \cs_new:Npn \@@_class_chk_exist:nT #1 { \cs_if_free:cTF { @@_ #1 _code:nnnnnn } - { \@@_kernel_error:nnx { kernel } { message-class-unknown } {#1} } + { \__kernel_msg_error:nnx { kernel } { message-class-unknown } {#1} } } % \end{macrocode} % \end{macro} @@ -1444,7 +1445,7 @@ \@@_use_redirect_name:n { #2 / #3 } } } - { \@@_kernel_error:nnxx { kernel } { message-unknown } {#2} {#3} } + { \__kernel_msg_error:nnxx { kernel } { message-unknown } {#2} {#3} } } \cs_new_protected:Npn \@@_use_code: { } % \end{macrocode} @@ -1592,7 +1593,7 @@ \tl_if_eq:NNTF \l_@@_class_tl \l_@@_current_class_tl { \prop_put:cnn { l_@@_redirect_ #2 _prop } {#3} {#2} - \@@_kernel_warning:nnxxxx + \__kernel_msg_warning:nnxxxx { kernel } { message-redirect-loop } { \seq_item:Nn \l_@@_class_loop_seq { 1 } } { \seq_item:Nn \l_@@_class_loop_seq { 2 } } @@ -1616,19 +1617,19 @@ % % \subsection{Kernel-specific functions} % -% \begin{macro}{\@@_kernel_new:nnnn, \@@_kernel_new:nnn} -% \begin{macro}{\@@_kernel_set:nnnn, \@@_kernel_set:nnn} +% \begin{macro}{\__kernel_msg_new:nnnn, \__kernel_msg_new:nnn} +% \begin{macro}{\__kernel_msg_set:nnnn, \__kernel_msg_set:nnn} % The kernel needs some messages of its own. These are created using % pre-built functions. Two functions are provided: one more general % and one which only has the short text part. % \begin{macrocode} -\cs_new_protected:Npn \@@_kernel_new:nnnn #1#2 +\cs_new_protected:Npn \__kernel_msg_new:nnnn #1#2 { \msg_new:nnnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \@@_kernel_new:nnn #1#2 +\cs_new_protected:Npn \__kernel_msg_new:nnn #1#2 { \msg_new:nnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \@@_kernel_set:nnnn #1#2 +\cs_new_protected:Npn \__kernel_msg_set:nnnn #1#2 { \msg_set:nnnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \@@_kernel_set:nnn #1#2 +\cs_new_protected:Npn \__kernel_msg_set:nnn #1#2 { \msg_set:nnn { LaTeX } { #1 / #2 } } % \end{macrocode} % \end{macro} @@ -1644,10 +1645,10 @@ % \begin{macrocode} \group_begin: \cs_set_protected:Npn \@@_kernel_class_new:nN #1 - { \@@_kernel_class_new_aux:nN { kernel_ #1 } } + { \@@_kernel_class_new_aux:nN { __kernel_msg_ #1 } } \cs_set_protected:Npn \@@_kernel_class_new_aux:nN #1#2 { - \cs_new_protected:cpn { @@_ #1 :nnnnnn } ##1##2##3##4##5##6 + \cs_new_protected:cpn { #1 :nnnnnn } ##1##2##3##4##5##6 { \use:x { @@ -1656,29 +1657,29 @@ { \tl_to_str:n {##5} } { \tl_to_str:n {##6} } } } - \cs_new_protected:cpx { @@_ #1 :nnnnn } ##1##2##3##4##5 - { \exp_not:c { @@_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } - \cs_new_protected:cpx { @@_ #1 :nnnn } ##1##2##3##4 - { \exp_not:c { @@_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } } - \cs_new_protected:cpx { @@_ #1 :nnn } ##1##2##3 - { \exp_not:c { @@_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } } - \cs_new_protected:cpx { @@_ #1 :nn } ##1##2 - { \exp_not:c { @@_ #1 :nnnnnn } {##1} {##2} { } { } { } { } } - \cs_new_protected:cpx { @@_ #1 :nnxxxx } ##1##2##3##4##5##6 + \cs_new_protected:cpx { #1 :nnnnn } ##1##2##3##4##5 + { \exp_not:c { #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { #1 :nnnn } ##1##2##3##4 + { \exp_not:c { #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { #1 :nnn } ##1##2##3 + { \exp_not:c { #1 :nnnnnn } {##1} {##2} {##3} { } { } { } } + \cs_new_protected:cpx { #1 :nn } ##1##2 + { \exp_not:c { #1 :nnnnnn } {##1} {##2} { } { } { } { } } + \cs_new_protected:cpx { #1 :nnxxxx } ##1##2##3##4##5##6 { \use:x { \exp_not:N \exp_not:n - { \exp_not:c { @@_ #1 :nnnnnn } {##1} {##2} } + { \exp_not:c { #1 :nnnnnn } {##1} {##2} } {##3} {##4} {##5} {##6} } } - \cs_new_protected:cpx { @@_ #1 :nnxxx } ##1##2##3##4##5 - { \exp_not:c { @@_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } - \cs_new_protected:cpx { @@_ #1 :nnxx } ##1##2##3##4 - { \exp_not:c { @@_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } - \cs_new_protected:cpx { @@_ #1 :nnx } ##1##2##3 - { \exp_not:c { @@_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } + \cs_new_protected:cpx { #1 :nnxxx } ##1##2##3##4##5 + { \exp_not:c { #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { #1 :nnxx } ##1##2##3##4 + { \exp_not:c { #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { #1 :nnx } ##1##2##3 + { \exp_not:c { #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } } % \end{macrocode} % \end{macro} @@ -1686,24 +1687,24 @@ % % \begin{macro} % { -% \@@_kernel_fatal:nnnnnn , -% \@@_kernel_fatal:nnnnn , -% \@@_kernel_fatal:nnnn , -% \@@_kernel_fatal:nnn , -% \@@_kernel_fatal:nn , -% \@@_kernel_fatal:nnxxxx , -% \@@_kernel_fatal:nnxxx , -% \@@_kernel_fatal:nnxx , -% \@@_kernel_fatal:nnx , -% \@@_kernel_error:nnnnnn , -% \@@_kernel_error:nnnnn , -% \@@_kernel_error:nnnn , -% \@@_kernel_error:nnn , -% \@@_kernel_error:nn , -% \@@_kernel_error:nnxxxx , -% \@@_kernel_error:nnxxx , -% \@@_kernel_error:nnxx , -% \@@_kernel_error:nnx +% \__kernel_msg_fatal:nnnnnn , +% \__kernel_msg_fatal:nnnnn , +% \__kernel_msg_fatal:nnnn , +% \__kernel_msg_fatal:nnn , +% \__kernel_msg_fatal:nn , +% \__kernel_msg_fatal:nnxxxx , +% \__kernel_msg_fatal:nnxxx , +% \__kernel_msg_fatal:nnxx , +% \__kernel_msg_fatal:nnx , +% \__kernel_msg_error:nnnnnn , +% \__kernel_msg_error:nnnnn , +% \__kernel_msg_error:nnnn , +% \__kernel_msg_error:nnn , +% \__kernel_msg_error:nn , +% \__kernel_msg_error:nnxxxx , +% \__kernel_msg_error:nnxxx , +% \__kernel_msg_error:nnxx , +% \__kernel_msg_error:nnx % } % Neither fatal kernel errors nor kernel errors can be redirected. We % directly use the code for (non-kernel) fatal errors and errors, @@ -1712,33 +1713,33 @@ % errors. % \begin{macrocode} \@@_kernel_class_new:nN { fatal } \@@_fatal_code:nnnnnn - \cs_undefine:N \@@_kernel_error:nnxx - \cs_undefine:N \@@_kernel_error:nnx - \cs_undefine:N \@@_kernel_error:nn + \cs_undefine:N \__kernel_msg_error:nnxx + \cs_undefine:N \__kernel_msg_error:nnx + \cs_undefine:N \__kernel_msg_error:nn \@@_kernel_class_new:nN { error } \@@_error_code:nnnnnn % \end{macrocode} % \end{macro} % % \begin{macro} % { -% \@@_kernel_warning:nnnnnn , -% \@@_kernel_warning:nnnnn , -% \@@_kernel_warning:nnnn , -% \@@_kernel_warning:nnn , -% \@@_kernel_warning:nn , -% \@@_kernel_warning:nnxxxx , -% \@@_kernel_warning:nnxxx , -% \@@_kernel_warning:nnxx , -% \@@_kernel_warning:nnx , -% \@@_kernel_info:nnnnnn , -% \@@_kernel_info:nnnnn , -% \@@_kernel_info:nnnn , -% \@@_kernel_info:nnn , -% \@@_kernel_info:nn , -% \@@_kernel_info:nnxxxx , -% \@@_kernel_info:nnxxx , -% \@@_kernel_info:nnxx , -% \@@_kernel_info:nnx +% \__kernel_msg_warning:nnnnnn , +% \__kernel_msg_warning:nnnnn , +% \__kernel_msg_warning:nnnn , +% \__kernel_msg_warning:nnn , +% \__kernel_msg_warning:nn , +% \__kernel_msg_warning:nnxxxx , +% \__kernel_msg_warning:nnxxx , +% \__kernel_msg_warning:nnxx , +% \__kernel_msg_warning:nnx , +% \__kernel_msg_info:nnnnnn , +% \__kernel_msg_info:nnnnn , +% \__kernel_msg_info:nnnn , +% \__kernel_msg_info:nnn , +% \__kernel_msg_info:nn , +% \__kernel_msg_info:nnxxxx , +% \__kernel_msg_info:nnxxx , +% \__kernel_msg_info:nnxx , +% \__kernel_msg_info:nnx % } % Kernel messages which can be redirected simply use the machinery for % normal messages, with the module name \enquote{\LaTeX{}}. @@ -1756,7 +1757,7 @@ % Error messages needed to actually implement the message system % itself. % \begin{macrocode} -\@@_kernel_new:nnnn { kernel } { message-already-defined } +\__kernel_msg_new:nnnn { kernel } { message-already-defined } { Message~'#2'~for~module~'#1'~already~defined. } { \c_@@_coding_error_text_tl @@ -1764,7 +1765,7 @@ by~the~module~'#1':~this~message~already~exists. \c_@@_return_text_tl } -\@@_kernel_new:nnnn { kernel } { message-unknown } +\__kernel_msg_new:nnnn { kernel } { message-unknown } { Unknown~message~'#2'~for~module~'#1'. } { \c_@@_coding_error_text_tl @@ -1772,14 +1773,14 @@ by~the~module~'#1':~this~message~does~not~exist. \c_@@_return_text_tl } -\@@_kernel_new:nnnn { kernel } { message-class-unknown } +\__kernel_msg_new:nnnn { kernel } { message-class-unknown } { Unknown~message~class~'#1'. } { LaTeX~has~been~asked~to~redirect~messages~to~a~class~'#1':\\ this~was~never~defined. \c_@@_return_text_tl } -\@@_kernel_new:nnnn { kernel } { message-redirect-loop } +\__kernel_msg_new:nnnn { kernel } { message-redirect-loop } { Message~redirection~loop~caused~by~ {#1} ~=>~ {#2} \tl_if_empty:nF {#3} { ~for~module~' \use_none:n #3 ' } . @@ -1794,7 +1795,7 @@ % % Messages for earlier kernel modules. % \begin{macrocode} -\@@_kernel_new:nnnn { kernel } { bad-number-of-arguments } +\__kernel_msg_new:nnnn { kernel } { bad-number-of-arguments } { Function~'#1'~cannot~be~defined~with~#2~arguments. } { \c_@@_coding_error_text_tl @@ -1802,17 +1803,17 @@ #2~arguments.~ TeX~allows~between~0~and~9~arguments~for~a~single~function. } -\@@_kernel_new:nnn { kernel } { char-active } +\__kernel_msg_new:nnn { kernel } { char-active } { Cannot~generate~active~chars. } -\@@_kernel_new:nnn { kernel } { char-invalid-catcode } +\__kernel_msg_new:nnn { kernel } { char-invalid-catcode } { Invalid~catcode~for~char~generation. } -\@@_kernel_new:nnn { kernel } { char-null-space } +\__kernel_msg_new:nnn { kernel } { char-null-space } { Cannot~generate~null~char~as~a~space. } -\@@_kernel_new:nnn { kernel } { char-out-of-range } +\__kernel_msg_new:nnn { kernel } { char-out-of-range } { Charcode~requested~out~of~engine~range. } -\@@_kernel_new:nnn { kernel } { char-space } +\__kernel_msg_new:nnn { kernel } { char-space } { Cannot~generate~space~chars. } -\@@_kernel_new:nnnn { kernel } { command-already-defined } +\__kernel_msg_new:nnnn { kernel } { command-already-defined } { Control~sequence~#1~already~defined. } { \c_@@_coding_error_text_tl @@ -1821,33 +1822,33 @@ The~current~meaning~is:\\ \ \ #2 } -\@@_kernel_new:nnnn { kernel } { command-not-defined } +\__kernel_msg_new:nnnn { kernel } { command-not-defined } { Control~sequence~#1~undefined. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~use~a~control~sequence~'#1':\\ this~has~not~been~defined~yet. } -\@@_kernel_new:nnn { kernel } { deprecated-command } +\__kernel_msg_new:nnn { kernel } { deprecated-command } { The~deprecated~command~'#2'~has~been~or~will~be~removed~on~#1. \tl_if_empty:nF {#3} { ~Use~instead~'#3'. } } -\@@_kernel_new:nnnn { kernel } { empty-search-pattern } +\__kernel_msg_new:nnnn { kernel } { empty-search-pattern } { Empty~search~pattern. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~ would~lead~to~an~infinite~loop! } -\@@_kernel_new:nnnn { kernel } { out-of-registers } +\__kernel_msg_new:nnnn { kernel } { out-of-registers } { No~room~for~a~new~#1. } { TeX~only~supports~\int_use:N \c_max_register_int \ % of~each~type.~All~the~#1~registers~have~been~used.~ This~run~will~be~aborted~now. } -\@@_kernel_new:nnnn { kernel } { non-base-function } +\__kernel_msg_new:nnnn { kernel } { non-base-function } { Function~'#1'~is~not~a~base~function } { \c_@@_coding_error_text_tl @@ -1856,7 +1857,7 @@ To~define~variants~use~\iow_char:N\\cs_generate_variant:Nn~ and~to~define~other~functions~use~\iow_char:N\\cs_new:Npn. } -\@@_kernel_new:nnnn { kernel } { missing-colon } +\__kernel_msg_new:nnnn { kernel } { missing-colon } { Function~'#1'~contains~no~':'. } { \c_@@_coding_error_text_tl @@ -1865,47 +1866,47 @@ needed~when~defining~conditionals~or~variants,~or~when~building~a~ parameter~text~from~the~number~of~arguments~of~the~function. } -\@@_kernel_new:nnnn { kernel } { overflow } +\__kernel_msg_new:nnnn { kernel } { overflow } { Integers~larger~than~2^{30}-1~cannot~be~stored~in~arrays. } { An~attempt~was~made~to~store~#3~at~position~#2~in~the~array~'#1'.~ The~largest~allowed~value~#4~will~be~used~instead. } -\@@_kernel_new:nnnn { kernel } { out-of-bounds } +\__kernel_msg_new:nnnn { kernel } { out-of-bounds } { Access~to~an~entry~beyond~an~array's~bounds. } { An~attempt~was~made~to~access~or~store~data~at~position~#2~of~the~ array~'#1',~but~this~array~has~entries~at~positions~from~1~to~#3. } -\@@_kernel_new:nnnn { kernel } { protected-predicate } +\__kernel_msg_new:nnnn { kernel } { protected-predicate } { Predicate~'#1'~must~be~expandable. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~define~'#1'~as~a~protected~predicate.~ Only~expandable~tests~can~have~a~predicate~version. } -\@@_kernel_new:nnnn { kernel } { conditional-form-unknown } +\__kernel_msg_new:nnnn { kernel } { conditional-form-unknown } { Conditional~form~'#1'~for~function~'#2'~unknown. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~define~the~conditional~form~'#1'~of~ the~function~'#2',~but~only~'TF',~'T',~'F',~and~'p'~forms~exist. } -\@@_kernel_new:nnnn { kernel } { scanmark-already-defined } +\__kernel_msg_new:nnnn { kernel } { scanmark-already-defined } { Scan~mark~#1~already~defined. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~create~a~new~scan~mark~'#1'~ but~this~name~has~already~been~used~for~a~scan~mark. } -\@@_kernel_new:nnnn { kernel } { variable-not-defined } +\__kernel_msg_new:nnnn { kernel } { variable-not-defined } { Variable~#1~undefined. } { \c_@@_coding_error_text_tl LaTeX~has~been~asked~to~show~a~variable~#1,~but~this~has~not~ been~defined~yet. } -\@@_kernel_new:nnnn { kernel } { variant-too-long } +\__kernel_msg_new:nnnn { kernel } { variant-too-long } { Variant~form~'#1'~longer~than~base~signature~of~'#2'. } { \c_@@_coding_error_text_tl @@ -1913,7 +1914,7 @@ with~a~signature~starting~with~'#1',~but~that~is~longer~than~ the~signature~(part~after~the~colon)~of~'#2'. } -\@@_kernel_new:nnnn { kernel } { invalid-variant } +\__kernel_msg_new:nnnn { kernel } { invalid-variant } { Variant~form~'#1'~invalid~for~base~form~'#2'. } { \c_@@_coding_error_text_tl @@ -1921,6 +1922,17 @@ with~a~signature~starting~with~'#1',~but~cannot~change~an~argument~ from~type~'#3'~to~type~'#4'. } +\__kernel_msg_new:nnn { kernel } { deprecated-variant } + { + Variant~form~'#1'~deprecated~for~base~form~'#2'.~ + One~should~not~change~an~argument~from~type~'#3'~to~type~'#4' + \str_case:nnF {#3} + { + { n } { :~use~a~'\token_if_eq_charcode:NNTF #4 c v V'~variant? } + { N } { :~base~form~only~accepts~a~single~token~argument. } + {#4} { :~base~form~is~already~a~variant. } + } { . } + } % \end{macrocode} % % Some errors are only needed in package mode if debugging is enabled by @@ -1931,15 +1943,15 @@ %<*package> \bool_if:NTF \l@expl@enable@debug@bool { - \@@_kernel_new:nnnn { kernel } { debug } + \__kernel_msg_new:nnnn { kernel } { debug } { The~debugging~option~'#1'~does~not~exist~\msg_line_context:. } { The~functions~'\iow_char:N\\debug_on:n'~and~ '\iow_char:N\\debug_off:n'~only~accept~the~arguments~ 'check-declarations',~'deprecation',~'log-functions',~not~'#1'. } - \@@_kernel_new:nnn { kernel } { expr } { '#2'~in~#1 } - \@@_kernel_new:nnnn { kernel } { local-global } + \__kernel_msg_new:nnn { kernel } { expr } { '#2'~in~#1 } + \__kernel_msg_new:nnnn { kernel } { local-global } { Inconsistent~local/global~assignment } { \c_@@_coding_error_text_tl @@ -1948,7 +1960,7 @@ \if:w l #1 local \else: \if:w g #1 global \else: constant \fi: \fi: \ variable~'#3'. } - \@@_kernel_new:nnnn { kernel } { non-declared-variable } + \__kernel_msg_new:nnnn { kernel } { non-declared-variable } { The~variable~#1~has~not~been~declared~\msg_line_context:. } { Checking~is~active,~and~you~have~tried~do~so~something~like: \\ @@ -1960,7 +1972,7 @@ } } { - \@@_kernel_new:nnnn { kernel } { enable-debug } + \__kernel_msg_new:nnnn { kernel } { enable-debug } { To~use~'#1'~load~expl3~with~the~'enable-debug'~option. } { The~function~'#1'~will~be~ignored~because~it~can~only~work~if~ @@ -1972,7 +1984,7 @@ } % %<*initex> -\@@_kernel_new:nnnn { kernel } { enable-debug } +\__kernel_msg_new:nnnn { kernel } { enable-debug } { '#1'~cannot~be~used~in~format~mode. } { The~function~'#1'~will~be~ignored~because~it~can~only~work~if~ @@ -1987,48 +1999,48 @@ % Some errors only appear in expandable settings, % hence don't need a \enquote{more-text} argument. % \begin{macrocode} -\@@_kernel_new:nnn { kernel } { bad-exp-end-f } +\__kernel_msg_new:nnn { kernel } { bad-exp-end-f } { Misused~\exp_end_continue_f:w or~:nw } -\@@_kernel_new:nnn { kernel } { bad-variable } +\__kernel_msg_new:nnn { kernel } { bad-variable } { Erroneous~variable~#1 used! } -\@@_kernel_new:nnn { kernel } { misused-sequence } +\__kernel_msg_new:nnn { kernel } { misused-sequence } { A~sequence~was~misused. } -\@@_kernel_new:nnn { kernel } { misused-prop } +\__kernel_msg_new:nnn { kernel } { misused-prop } { A~property~list~was~misused. } -\@@_kernel_new:nnn { kernel } { negative-replication } +\__kernel_msg_new:nnn { kernel } { negative-replication } { Negative~argument~for~\prg_replicate:nn. } -\@@_kernel_new:nnn { kernel } { prop-keyval } +\__kernel_msg_new:nnn { kernel } { prop-keyval } { Missing/extra~'='~in~'#1'~(in~'..._keyval:Nn') } -\@@_kernel_new:nnn { kernel } { unknown-comparison } +\__kernel_msg_new:nnn { kernel } { unknown-comparison } { Relation~'#1'~unknown:~use~=,~<,~>,~==,~!=,~<=,~>=. } -\@@_kernel_new:nnn { kernel } { zero-step } +\__kernel_msg_new:nnn { kernel } { zero-step } { Zero~step~size~for~step~function~#1. } % \end{macrocode} % % Messages used by the \enquote{\texttt{show}} functions. % \begin{macrocode} -\@@_kernel_new:nnn { kernel } { show-clist } +\__kernel_msg_new:nnn { kernel } { show-clist } { The~comma~list~ \tl_if_empty:nF {#1} { #1 ~ } \tl_if_empty:nTF {#2} { is~empty \\>~ . } { contains~the~items~(without~outer~braces): #2 . } } -\@@_kernel_new:nnn { kernel } { show-prop } +\__kernel_msg_new:nnn { kernel } { show-prop } { The~property~list~#1~ \tl_if_empty:nTF {#2} { is~empty \\>~ . } { contains~the~pairs~(without~outer~braces): #2 . } } -\@@_kernel_new:nnn { kernel } { show-seq } +\__kernel_msg_new:nnn { kernel } { show-seq } { The~sequence~#1~ \tl_if_empty:nTF {#2} { is~empty \\>~ . } { contains~the~items~(without~outer~braces): #2 . } } -\@@_kernel_new:nnn { kernel } { show-streams } +\__kernel_msg_new:nnn { kernel } { show-streams } { \tl_if_empty:nTF {#2} { No~ } { The~following~ } \str_case:nn {#1} @@ -2087,18 +2099,18 @@ % % \begin{macro} % { -% \@@_kernel_expandable_error:nnnnnn, -% \@@_kernel_expandable_error:nnnnn, -% \@@_kernel_expandable_error:nnnn, -% \@@_kernel_expandable_error:nnn, -% \@@_kernel_expandable_error:nn +% \__kernel_msg_expandable_error:nnnnnn, +% \__kernel_msg_expandable_error:nnnnn, +% \__kernel_msg_expandable_error:nnnn, +% \__kernel_msg_expandable_error:nnn, +% \__kernel_msg_expandable_error:nn % } % The command built from the csname % |\c_@@_text_prefix_tl LaTeX / #1 / #2| % takes four arguments and builds the error text, which is fed to % \cs{@@_expandable_error:n}. % \begin{macrocode} -\cs_new:Npn \@@_kernel_expandable_error:nnnnnn #1#2#3#4#5#6 +\cs_new:Npn \__kernel_msg_expandable_error:nnnnnn #1#2#3#4#5#6 { \exp_args:Nf \@@_expandable_error:n { @@ -2107,24 +2119,24 @@ {#3} {#4} {#5} {#6} } } -\cs_new:Npn \@@_kernel_expandable_error:nnnnn #1#2#3#4#5 +\cs_new:Npn \__kernel_msg_expandable_error:nnnnn #1#2#3#4#5 { - \@@_kernel_expandable_error:nnnnnn + \__kernel_msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} {#5} { } } -\cs_new:Npn \@@_kernel_expandable_error:nnnn #1#2#3#4 +\cs_new:Npn \__kernel_msg_expandable_error:nnnn #1#2#3#4 { - \@@_kernel_expandable_error:nnnnnn + \__kernel_msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} { } { } } -\cs_new:Npn \@@_kernel_expandable_error:nnn #1#2#3 +\cs_new:Npn \__kernel_msg_expandable_error:nnn #1#2#3 { - \@@_kernel_expandable_error:nnnnnn + \__kernel_msg_expandable_error:nnnnnn {#1} {#2} {#3} { } { } { } } -\cs_new:Npn \@@_kernel_expandable_error:nn #1#2 +\cs_new:Npn \__kernel_msg_expandable_error:nn #1#2 { - \@@_kernel_expandable_error:nnnnnn + \__kernel_msg_expandable_error:nnnnnn {#1} {#2} { } { } { } { } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index d41bd08ab72..0e9d5d082c6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3names.dtx Copyright (C) 1990-2017 The LaTeX3 project +%% File: l3names.dtx Copyright (C) 1990-2018 The LaTeX3 project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -779,8 +779,11 @@ \@@_primitive:NN \aligntab \luatex_aligntab:D \@@_primitive:NN \attribute \luatex_attribute:D \@@_primitive:NN \attributedef \luatex_attributedef:D + \@@_primitive:NN \automaticdiscretionary \luatex_automaticdiscretionary:D + \@@_primitive:NN \automatichyphenmode \luatex_automatichyphenmode:D \@@_primitive:NN \automatichyphenpenalty \luatex_automatichyphenpenalty:D \@@_primitive:NN \begincsname \luatex_begincsname:D + \@@_primitive:NN \breakafterdirmode \luatex_breakafterdirmode:D \@@_primitive:NN \catcodetable \luatex_catcodetable:D \@@_primitive:NN \clearmarks \luatex_clearmarks:D \@@_primitive:NN \crampeddisplaystyle \luatex_crampeddisplaystyle:D @@ -795,6 +798,7 @@ \@@_primitive:NN \etokspre \luatex_etokspre:D \@@_primitive:NN \explicithyphenpenalty \luatex_explicithyphenpenalty:D \@@_primitive:NN \expanded \luatex_expanded:D + \@@_primitive:NN \explicitdiscretionary \luatex_explicitdiscretionary:D \@@_primitive:NN \firstvalidlanguage \luatex_firstvalidlanguage:D \@@_primitive:NN \fontid \luatex_fontid:D \@@_primitive:NN \formatname \luatex_formatname:D @@ -811,15 +815,17 @@ \@@_primitive:NN \luaescapestring \luatex_luaescapestring:D \@@_primitive:NN \luafunction \luatex_luafunction:D \@@_primitive:NN \luatexbanner \luatex_luatexbanner:D - \@@_primitive:NN \luatexdatestamp \luatex_luatexdatestamp:D \@@_primitive:NN \luatexrevision \luatex_luatexrevision:D \@@_primitive:NN \luatexversion \luatex_luatexversion:D + \@@_primitive:NN \mathdelimitersmode \luatex_mathdelimitersmode:D \@@_primitive:NN \mathdisplayskipmode \luatex_mathdisplayskipmode:D \@@_primitive:NN \matheqnogapstep \luatex_matheqnogapstep:D \@@_primitive:NN \mathnolimitsmode \luatex_mathnolimitsmode:D \@@_primitive:NN \mathoption \luatex_mathoption:D + \@@_primitive:NN \mathpenaltiesmode \luatex_mathpenaltiesmode:D \@@_primitive:NN \mathrulesfam \luatex_mathrulesfam:D \@@_primitive:NN \mathscriptsmode \luatex_mathscriptsmode:D + \@@_primitive:NN \mathscriptboxmode \luatex_mathscriptboxmode:D \@@_primitive:NN \mathstyle \luatex_mathstyle:D \@@_primitive:NN \mathsurroundmode \luatex_mathsurroundmode:D \@@_primitive:NN \mathsurroundskip \luatex_mathsurroundskip:D @@ -838,9 +844,11 @@ \@@_primitive:NN \pdfvariable \luatex_pdfvariable:D \@@_primitive:NN \postexhyphenchar \luatex_postexhyphenchar:D \@@_primitive:NN \posthyphenchar \luatex_posthyphenchar:D + \@@_primitive:NN \prebinoppenalty \luatex_prebinoppenalty:D \@@_primitive:NN \predisplaygapfactor \luatex_predisplaygapfactor:D \@@_primitive:NN \preexhyphenchar \luatex_preexhyphenchar:D \@@_primitive:NN \prehyphenchar \luatex_prehyphenchar:D + \@@_primitive:NN \prerelpenalty \luatex_prerelpenalty:D \@@_primitive:NN \savecatcodetable \luatex_savecatcodetable:D \@@_primitive:NN \scantextokens \luatex_scantextokens:D \@@_primitive:NN \setfontid \luatex_setfontid:D @@ -849,6 +857,7 @@ \@@_primitive:NN \suppresslongerror \luatex_suppresslongerror:D \@@_primitive:NN \suppressmathparerror \luatex_suppressmathparerror:D \@@_primitive:NN \suppressoutererror \luatex_suppressoutererror:D + \@@_primitive:NN \suppressprimitiveerror \luatex_suppressprimitiveerror:D \@@_primitive:NN \toksapp \luatex_toksapp:D \@@_primitive:NN \tokspre \luatex_tokspre:D \@@_primitive:NN \tpack \luatex_tpack:D @@ -1043,6 +1052,8 @@ \@@_primitive:NN \Umathunderbarvgap \utex_underbarvgap:D \@@_primitive:NN \Umathunderdelimiterbgap \utex_underdelimiterbgap:D \@@_primitive:NN \Umathunderdelimitervgap \utex_underdelimitervgap:D + \@@_primitive:NN \Unosubscript \utex_Unosubscript:D + \@@_primitive:NN \Unosuperscript \utex_Unosuperscript:D \@@_primitive:NN \Uoverdelimiter \utex_overdelimiter:D \@@_primitive:NN \Uradical \utex_radical:D \@@_primitive:NN \Uroot \utex_root:D diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx index d24e44b4f9f..3577138d59f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3oldmodules.dtx Copyright (C) 2014-2017 The LaTeX3 Project +%% File: l3oldmodules.dtx Copyright (C) 2014-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -42,7 +42,7 @@ % } % % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -92,7 +92,6 @@ %{l3candidates} %{l3clist} %{l3coffins} -%{l3color} %{l3expan} %{l3file} %{l3fp} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index c6456f25a63..a8318bcaf42 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3prg.dtx Copyright (C) 2005-2017 The LaTeX3 Project +%% File: l3prg.dtx Copyright (C) 2005-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -811,16 +811,16 @@ % make sure the boolean exists. This is needed because booleans are % not based on token lists nor on \TeX{} registers. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set_true:N #1 { \cs_set_eq:NN #1 \c_true_bool } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set_false:N #1 { \cs_set_eq:NN #1 \c_false_bool } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset_true:N #1 { \cs_gset_eq:NN #1 \c_true_bool } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset_false:N #1 { \cs_gset_eq:NN #1 \c_false_bool } \cs_generate_variant:Nn \bool_set_true:N { c } @@ -855,10 +855,10 @@ % argument the meaning \cs{c_true_bool} or \cs{c_false_bool}. % Again, we include some checking code. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \bool_set:Nn #1#2 { \tex_chardef:D #1 = \bool_if_p:n {#2} } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \bool_gset:Nn #1#2 { \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} } \cs_generate_variant:Nn \bool_set:Nn { c } @@ -1425,7 +1425,7 @@ \cs_new:cpn { @@_replicate_first_-:n } #1 { \exp_end: - \__msg_kernel_expandable_error:nn { kernel } { negative-replication } + \__kernel_msg_expandable_error:nn { kernel } { negative-replication } } \cs_new:cpn { @@_replicate_first_0:n } #1 { \exp_end: } \cs_new:cpn { @@_replicate_first_1:n } #1 { \exp_end: #1 } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index ddbc1f46644..2657404a11a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -535,7 +535,7 @@ % error and removes its argument. % \begin{macrocode} \cs_new:Npn \@@_pair:wn #1 \s_@@ #2 - { \__msg_kernel_expandable_error:nn { kernel } { misused-prop } } + { \__kernel_msg_expandable_error:nn { kernel } { misused-prop } } % \end{macrocode} % \end{macro} % @@ -694,7 +694,7 @@ \s_@@ { \exp_not:n {#1} } } { - \exp_args:Nnno \__msg_kernel_expandable_error:nnn + \exp_args:Nnno \__kernel_msg_expandable_error:nnn { kernel } { prop-keyval } {#4} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index 8a1adeb756a..b3afc35b97d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3quark.dtx Copyright (C) 1990-2017 The LaTeX3 Project +%% File: l3quark.dtx Copyright (C) 1990-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -375,7 +375,7 @@ % \UnitTested % Allocate a new quark. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN q #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN q #1 } { } \cs_new_protected:Npn \quark_new:N #1 { \__chk_if_free_cs:N #1 @@ -599,7 +599,7 @@ { \tl_if_in:NnTF \g_@@_marks_tl { #1 } { - \__msg_kernel_error:nnx { kernel } { scanmark-already-defined } + \__kernel_msg_error:nnx { kernel } { scanmark-already-defined } { \token_to_str:N #1 } } { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index 3808ec66d17..e811b8c4db4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3regex.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3regex.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -120,8 +120,8 @@ % sign. % \item \verb*"[+\-\ ]*\d+\ *" matches an explicit integer with any % number of $+$ and $-$ signs, with spaces allowed except within the -% mantissa, and sourrounded by spaces. -% \item \verb*"[+\-\ ]*(\d+|\d*\.\d+)\ *" matches an explict integer or +% mantissa, and surrounded by spaces. +% \item \verb*"[+\-\ ]*(\d+|\d*\.\d+)\ *" matches an explicit integer or % decimal number; using \verb*"[.,]" instead of \verb*"\." would allow % the comma as a decimal marker. % \item @@ -537,7 +537,7 @@ % equal to the number of times % \meta{regular expression} appears in \meta{token list}. % The search starts by finding the left-most longest match, -% respecting greedy and ungreedy operators. Then the search +% respecting greedy and lazy (non-greedy) operators. Then the search % starts again from the character following the last character % of the previous match, until reaching the end of the token list. % Infinite loops are prevented in the case where the regular expression @@ -1457,11 +1457,11 @@ % \cs{__tl_build_one:o} by a single call to \cs{__tl_build_one:x}, because % the \texttt{x}-expanding assignment may be interrupted by |\x|. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { - \__debug_trace_push:nnN { regex } { 1 } \@@_escape_use:nnnn + \@@_trace_push:nnN { regex } { 1 } \@@_escape_use:nnnn \__tl_build:Nw \l_@@_internal_a_tl - \__tl_build_one:n { \__debug_trace_pop:nnN { regex } { 1 } \@@_escape_use:nnnn } + \__tl_build_one:n { \@@_trace_pop:nnN { regex } { 1 } \@@_escape_use:nnnn } \use_none:nn } { } @@ -1536,7 +1536,7 @@ \cs_new:cpn { @@_escape_/break:w } { \if_false: { \fi: } - \__msg_kernel_error:nn { kernel } { trailing-backslash } + \__kernel_msg_error:nn { kernel } { trailing-backslash } \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi: } \cs_new:cpn { @@_escape_~:w } { } @@ -1575,7 +1575,7 @@ { \if_false: { \fi: } \__tl_build_one:o \l_@@_internal_b_tl - \__msg_kernel_error:nnx { kernel } { x-overflow } {#1} + \__kernel_msg_error:nnx { kernel } { x-overflow } {#1} \tl_set:Nx \l_@@_internal_b_tl { \if_false: } \fi: } @@ -1664,7 +1664,7 @@ { \if_false: { \fi: } \__tl_build_one:o \l_@@_internal_b_tl - \__msg_kernel_error:nnx { kernel } { x-missing-rbrace } {#1} + \__kernel_msg_error:nnx { kernel } { x-missing-rbrace } {#1} \tl_set:Nx \l_@@_internal_b_tl { \if_false: } \fi: \@@_escape_loop:N #1 } @@ -2080,7 +2080,7 @@ \if_int_compare:w \l_@@_mode_int = \c_@@_class_mode_int \exp_after:wN \exp_after:wN \exp_after:wN \use:n \else: - \__msg_kernel_error:nn { kernel } { c-bad-mode } + \__kernel_msg_error:nn { kernel } { c-bad-mode } \exp_after:wN \exp_after:wN \exp_after:wN \use_none:n \fi: \fi: @@ -2129,13 +2129,13 @@ { \@@_if_in_class:TF { - \__msg_kernel_error:nn { kernel } { missing-rbrack } + \__kernel_msg_error:nn { kernel } { missing-rbrack } \use:c { @@_compile_]: } \prg_do_nothing: \prg_do_nothing: } { } \if_int_compare:w \l_@@_group_level_int > 0 \exp_stop_f: - \__msg_kernel_error:nnx { kernel } { missing-rparen } + \__kernel_msg_error:nnx { kernel } { missing-rparen } { \int_use:N \l_@@_group_level_int } \prg_replicate:nn { \l_@@_group_level_int } @@ -2186,10 +2186,10 @@ \prg_do_nothing: \prg_do_nothing: \prg_do_nothing: \prg_do_nothing: \int_compare:nNnT \l_@@_mode_int = \c_@@_catcode_mode_int - { \__msg_kernel_error:nn { kernel } { c-trailing } } + { \__kernel_msg_error:nn { kernel } { c-trailing } } \int_compare:nNnT \l_@@_mode_int < \c_@@_outer_mode_int { - \__msg_kernel_error:nn { kernel } { c-missing-rbrace } + \__kernel_msg_error:nn { kernel } { c-missing-rbrace } \@@_compile_end_cs: \prg_do_nothing: \prg_do_nothing: \prg_do_nothing: \prg_do_nothing: @@ -2296,7 +2296,7 @@ \cs_new_protected:Npn \@@_compile_quantifier_abort:xNN #1#2#3 { \@@_compile_quantifier_none: - \__msg_kernel_warning:nnxx { kernel } { invalid-quantifier } {#1} {#3} + \__kernel_msg_warning:nnxx { kernel } { invalid-quantifier } {#1} {#3} \@@_compile_abort_tokens:x {#1} #2 #3 } @@ -2409,7 +2409,7 @@ { #1 #2 } { \@@_compile_special:N \c_right_brace_str } { \if_int_compare:w \l_@@_internal_a_int > \l_@@_internal_b_int - \__msg_kernel_error:nnxx { kernel } { backwards-quantifier } + \__kernel_msg_error:nnxx { kernel } { backwards-quantifier } { \int_use:N \l_@@_internal_a_int } { \int_use:N \l_@@_internal_b_int } \int_zero:N \l_@@_internal_b_int @@ -2443,7 +2443,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_compile_raw_error:N #1 { - \__msg_kernel_error:nnx { kernel } { bad-escape } {#1} + \__kernel_msg_error:nnx { kernel } { bad-escape } {#1} \@@_compile_raw:N #1 } % \end{macrocode} @@ -2502,7 +2502,7 @@ \@@_if_end_range:NNTF #2 #3 { \if_int_compare:w `#1 > `#3 \exp_stop_f: - \__msg_kernel_error:nnxx { kernel } { range-backwards } {#1} {#3} + \__kernel_msg_error:nnxx { kernel } { range-backwards } {#1} {#3} \else: \__tl_build_one:x { @@ -2516,7 +2516,7 @@ \fi: } { - \__msg_kernel_warning:nnxx { kernel } { range-missing-end } + \__kernel_msg_warning:nnxx { kernel } { range-missing-end } {#1} { \c_backslash_str #3 } \__tl_build_one:x { @@ -2794,8 +2794,8 @@ \str_case:nn { #2 } { : { \@@_compile_class_posix:NNNNw } - = { \__msg_kernel_warning:nnx { kernel } { posix-unsupported } { = } } - . { \__msg_kernel_warning:nnx { kernel } { posix-unsupported } { . } } + = { \__kernel_msg_warning:nnx { kernel } { posix-unsupported } { = } } + . { \__kernel_msg_warning:nnx { kernel } { posix-unsupported } { . } } } } \@@_compile_raw:N [ #1 #2 @@ -2834,7 +2834,7 @@ } } { - \__msg_kernel_warning:nnx { kernel } { posix-unknown } + \__kernel_msg_warning:nnx { kernel } { posix-unknown } { \l_@@_internal_a_tl } \@@_compile_abort_tokens:x { @@ -2844,7 +2844,7 @@ } } { - \__msg_kernel_error:nnxx { kernel } { posix-missing-close } + \__kernel_msg_error:nnxx { kernel } { posix-missing-close } { [: \l_@@_internal_a_tl } { #2 #4 } \@@_compile_abort_tokens:x { [: \l_@@_internal_a_tl } #1 #2 #3 #4 @@ -2886,7 +2886,7 @@ \__tl_build_one:o \l_@@_internal_regex \exp_after:wN \@@_compile_quantifier:w \else: - \__msg_kernel_warning:nn { kernel } { extra-rparen } + \__kernel_msg_warning:nn { kernel } { extra-rparen } \exp_after:wN \@@_compile_raw:N \exp_after:wN ) \fi: } @@ -2910,7 +2910,7 @@ \cs_if_exist_use:cF { @@_compile_special_group_\token_to_str:N #4 :w } { - \__msg_kernel_warning:nnx { kernel } { special-group-unknown } + \__kernel_msg_warning:nnx { kernel } { special-group-unknown } { (? #4 } \@@_compile_group_begin:N \@@_group:nnnN \@@_compile_raw:N ? #3 #4 @@ -2977,7 +2977,7 @@ \cs_set:Npn \@@_item_range:nn { \@@_item_caseless_range:nn } } { - \__msg_kernel_warning:nnx { kernel } { unknown-option } { (?i #2 } + \__kernel_msg_warning:nnx { kernel } { unknown-option } { (?i #2 } \@@_compile_raw:N ( \@@_compile_raw:N ? \@@_compile_raw:N i @@ -2993,7 +2993,7 @@ \cs_set:Npn \@@_item_range:nn { \@@_item_caseful_range:nn } } { - \__msg_kernel_warning:nnx { kernel } { unknown-option } { (?-#2#4 } + \__kernel_msg_warning:nnx { kernel } { unknown-option } { (?-#2#4 } \@@_compile_raw:N ( \@@_compile_raw:N ? \@@_compile_raw:N - @@ -3031,7 +3031,7 @@ } { \cs_if_exist_use:cF { @@_compile_c_#2:w } } { - \__msg_kernel_error:nnx { kernel } { c-missing-category } {#2} + \__kernel_msg_error:nnx { kernel } { c-missing-category } {#2} #1 #2 } } @@ -3052,7 +3052,7 @@ { \token_if_eq_charcode:NNF #2 ( } % ) } { \use:n } - { \__msg_kernel_error:nnn { kernel } { c-C-invalid } {#2} } + { \__kernel_msg_error:nnn { kernel } { c-C-invalid } {#2} } #1 #2 } % \end{macrocode} @@ -3105,7 +3105,7 @@ { \@@_compile_c_lbrack_end: } } { - \__msg_kernel_error:nnx { kernel } { c-missing-rbrack } {#2} + \__kernel_msg_error:nnx { kernel } { c-missing-rbrack } {#2} \@@_compile_c_lbrack_end: #1 #2 } @@ -3251,7 +3251,7 @@ \@@_compile_u_loop:NN } { - \__msg_kernel_error:nn { kernel } { u-missing-lbrace } + \__kernel_msg_error:nn { kernel } { u-missing-lbrace } \@@_compile_raw:N u #1 #2 } } @@ -3269,7 +3269,7 @@ } { \if_false: { \fi: } - \__msg_kernel_error:nnx { kernel } { u-missing-rbrace } {#2} + \__kernel_msg_error:nnx { kernel } { u-missing-rbrace } {#2} \@@_compile_u_end: #1 #2 } @@ -3685,11 +3685,11 @@ \@@_compile:n {#1} \@@_build:N \l_@@_internal_regex } -\__debug_patch:nnNNpn - { \__debug_trace_push:nnN { regex } { 1 } \@@_build:N } +\__kernel_patch:nnNNpn + { \@@_trace_push:nnN { regex } { 1 } \@@_build:N } { \@@_trace_states:n { 2 } - \__debug_trace_pop:nnN { regex } { 1 } \@@_build:N + \@@_trace_pop:nnN { regex } { 1 } \@@_build:N } \cs_new_protected:Npn \@@_build:N #1 { @@ -3714,11 +3714,11 @@ % work properly at the outer level, we need to put the appropriate % \texttt{left} and \texttt{right} states in their sequence. % \begin{macrocode} -\__debug_patch:nnNNpn - { \__debug_trace_push:nnN { regex } { 1 } \@@_build_for_cs:n } +\__kernel_patch:nnNNpn + { \@@_trace_push:nnN { regex } { 1 } \@@_build_for_cs:n } { \@@_trace_states:n { 2 } - \__debug_trace_pop:nnN { regex } { 1 } \@@_build_for_cs:n + \@@_trace_pop:nnN { regex } { 1 } \@@_build_for_cs:n } \cs_new_protected:Npn \@@_build_for_cs:n #1 { @@ -3786,9 +3786,9 @@ % \texttt{right} state is the new empty state, and the \texttt{left} % state points to the previously \enquote{current} state. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { - \__debug_trace:nnx { regex } { 2 } + \@@_trace:nnx { regex } { 2 } { regex~new~state~ L=\int_use:N \l_@@_left_state_int ~ -> ~ @@ -3952,9 +3952,9 @@ % auxiliaries expects \texttt{left_state} and \texttt{right_state} to % be set properly. % \begin{macrocode} -\__debug_patch:nnNNpn - { \__debug_trace_push:nnN { regex } { 1 } \@@_group_aux:nnnnN } - { \__debug_trace_pop:nnN { regex } { 1 } \@@_group_aux:nnnnN } +\__kernel_patch:nnNNpn + { \@@_trace_push:nnN { regex } { 1 } \@@_group_aux:nnnnN } + { \@@_trace_pop:nnN { regex } { 1 } \@@_group_aux:nnnnN } \cs_new_protected:Npn \@@_group_aux:nnnnN #1#2#3#4#5 { \if_int_compare:w #3 = 0 \exp_stop_f: @@ -4035,9 +4035,9 @@ % the group. The left and right states of the group are extracted from % the relevant sequences. % \begin{macrocode} -\__debug_patch:nnNNpn - { \__debug_trace_push:nnN { regex } { 1 } \@@_branch:n } - { \__debug_trace_pop:nnN { regex } { 1 } \@@_branch:n } +\__kernel_patch:nnNNpn + { \@@_trace_push:nnN { regex } { 1 } \@@_branch:n } + { \@@_trace_pop:nnN { regex } { 1 } \@@_branch:n } \cs_new_protected:Npn \@@_branch:n #1 { \@@_build_new_state: @@ -4533,12 +4533,12 @@ % smothering an empty match at the start). Once all this is set up, we % are ready for the ride. Find the first match. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { - \__debug_trace_push:nnN { regex } { 1 } \@@_match:n - \__debug_trace:nnx { regex } { 1 } { analyzing~query~token~list } + \@@_trace_push:nnN { regex } { 1 } \@@_match:n + \@@_trace:nnx { regex } { 1 } { analyzing~query~token~list } } - { \__debug_trace_pop:nnN { regex } { 1 } \@@_match:n } + { \@@_trace_pop:nnN { regex } { 1 } \@@_match:n } \cs_new_protected:Npn \@@_match:n #1 { \int_zero:N \l_@@_balance_int @@ -4552,8 +4552,8 @@ \@@_match_init: \@@_match_once: } -\__debug_patch:nnNNpn - { \__debug_trace:nnx { regex } { 1 } { initializing } } +\__kernel_patch:nnNNpn + { \@@_trace:nnx { regex } { 1 } { initializing } } { } \cs_new_protected:Npn \@@_match_init: { @@ -4733,8 +4733,8 @@ % state is marked as $\texttt{step}+1$: any thread hitting it at that % point will be terminated. % \begin{macrocode} -\__debug_patch:nnNNpn - { \__debug_trace:nnx { regex } { 2 } { state~\int_use:N \l_@@_curr_state_int } } +\__kernel_patch:nnNNpn + { \@@_trace:nnx { regex } { 2 } { state~\int_use:N \l_@@_curr_state_int } } { } \cs_new_protected:Npn \@@_use_state: { @@ -5098,9 +5098,9 @@ % parsed, make sure that there is no open csname. Finally, define the % \texttt{balance_one_match} and \texttt{do_one_match} functions. % \begin{macrocode} -\__debug_patch:nnNNpn - { \__debug_trace_push:nnN { regex } { 1 } \@@_replacement:n } - { \__debug_trace_pop:nnN { regex } { 1 } \@@_replacement:n } +\__kernel_patch:nnNNpn + { \@@_trace_push:nnN { regex } { 1 } \@@_replacement:n } + { \@@_trace_pop:nnN { regex } { 1 } \@@_replacement:n } \cs_new_protected:Npn \@@_replacement:n #1 { \__tl_build:Nw \l_@@_internal_a_tl @@ -5120,14 +5120,14 @@ {#1} \prg_do_nothing: \prg_do_nothing: \if_int_compare:w \l_@@_replacement_csnames_int > 0 \exp_stop_f: - \__msg_kernel_error:nnx { kernel } { replacement-missing-rbrace } + \__kernel_msg_error:nnx { kernel } { replacement-missing-rbrace } { \int_use:N \l_@@_replacement_csnames_int } \__tl_build_one:x { \prg_replicate:nn \l_@@_replacement_csnames_int \cs_end: } \fi: \seq_if_empty:NF \l_@@_replacement_category_seq { - \__msg_kernel_error:nnx { kernel } { replacement-missing-rparen } + \__kernel_msg_error:nnx { kernel } { replacement-missing-rparen } { \seq_count:N \l_@@_replacement_category_seq } \seq_clear:N \l_@@_replacement_category_seq } @@ -5361,11 +5361,11 @@ \cs_new_protected:Npn \@@_replacement_cat:NNN #1#2#3 { \token_if_eq_meaning:NNTF \prg_do_nothing: #3 - { \__msg_kernel_error:nn { kernel } { replacement-catcode-end } } + { \__kernel_msg_error:nn { kernel } { replacement-catcode-end } } { \int_compare:nNnTF { \l_@@_replacement_csnames_int } > 0 { - \__msg_kernel_error:nnnn + \__kernel_msg_error:nnnn { kernel } { replacement-catcode-in-cs } {#1} {#3} #2 #3 } @@ -5381,7 +5381,7 @@ { \@@_char_if_alphanumeric:NTF #3 { - \__msg_kernel_error:nnnn + \__kernel_msg_error:nnnn { kernel } { replacement-catcode-escaped } {#1} {#3} } @@ -5543,7 +5543,7 @@ \cs_new_protected:Npn \@@_replacement_c_S:w #1#2 { \if_int_compare:w `#2 = 0 \exp_stop_f: - \__msg_kernel_error:nn { kernel } { replacement-null-space } + \__kernel_msg_error:nn { kernel } { replacement-null-space } \fi: \tex_lccode:D `\ = `#2 \scan_stop: \tex_lowercase:D { \__tl_build_one:n {~} } @@ -5586,7 +5586,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_replacement_error:NNN #1#2#3 { - \__msg_kernel_error:nnx { kernel } { replacement-#1 } {#3} + \__kernel_msg_error:nnx { kernel } { replacement-#1 } {#3} #2 #3 } % \end{macrocode} @@ -5948,7 +5948,7 @@ { \flag_height:n { @@_begin } + \flag_height:n { @@_end } } = 0 { - \__msg_kernel_error:nnxxx { kernel } { result-unbalanced } + \__kernel_msg_error:nnxxx { kernel } { result-unbalanced } { splitting~or~extracting~submatches } { \flag_height:n { @@_end } } { \flag_height:n { @@_begin } } @@ -6139,7 +6139,7 @@ { \if_int_compare:w \l_@@_balance_int = 0 \exp_stop_f: \else: - \__msg_kernel_error:nnxxx { kernel } { result-unbalanced } + \__kernel_msg_error:nnxxx { kernel } { result-unbalanced } { replacing } { \int_max:nn { - \l_@@_balance_int } { 0 } } { \int_max:nn { \l_@@_balance_int } { 0 } } @@ -6170,20 +6170,20 @@ % % Messages for the preparsing phase. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { trailing-backslash } +\__kernel_msg_new:nnnn { kernel } { trailing-backslash } { Trailing~escape~character~'\iow_char:N\\'. } { A~regular~expression~or~its~replacement~text~ends~with~ the~escape~character~'\iow_char:N\\'.~It~will~be~ignored. } -\__msg_kernel_new:nnnn { kernel } { x-missing-rbrace } +\__kernel_msg_new:nnnn { kernel } { x-missing-rbrace } { Missing~closing~brace~in~'\iow_char:N\\x'~hexadecimal~sequence. } { You~wrote~something~like~ '\iow_char:N\\x\{...#1'.~ The~closing~brace~is~missing. } -\__msg_kernel_new:nnnn { kernel } { x-overflow } +\__kernel_msg_new:nnnn { kernel } { x-overflow } { Character~code~'#1'~too~large~in~'\iow_char:N\\x'~hexadecimal~sequence. } { You~wrote~something~like~ @@ -6195,7 +6195,7 @@ % % Invalid quantifier. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { invalid-quantifier } +\__kernel_msg_new:nnnn { kernel } { invalid-quantifier } { Braced~quantifier~'#1'~may~not~be~followed~by~'#2'. } { The~character~'#2'~is~invalid~in~the~braced~quantifier~'#1'.~ @@ -6207,13 +6207,13 @@ % Messages for missing or extra closing brackets and parentheses, with % some fancy singular/plural handling for the case of parentheses. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { missing-rbrack } +\__kernel_msg_new:nnnn { kernel } { missing-rbrack } { Missing~right~bracket~inserted~in~regular~expression. } { LaTeX~was~given~a~regular~expression~where~a~character~class~ was~started~with~'[',~but~the~matching~']'~is~missing. } -\__msg_kernel_new:nnnn { kernel } { missing-rparen } +\__kernel_msg_new:nnnn { kernel } { missing-rparen } { Missing~right~ \int_compare:nTF { #1 = 1 } { parenthesis } { parentheses } ~ @@ -6223,7 +6223,7 @@ LaTeX~was~given~a~regular~expression~with~\int_eval:n {#1} ~ more~left~parentheses~than~right~parentheses. } -\__msg_kernel_new:nnnn { kernel } { extra-rparen } +\__kernel_msg_new:nnnn { kernel } { extra-rparen } { Extra~right~parenthesis~ignored~in~regular~expression. } { LaTeX~came~across~a~closing~parenthesis~when~no~submatch~group~ @@ -6233,7 +6233,7 @@ % % Some escaped alphanumerics are not allowed everywhere. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { bad-escape } +\__kernel_msg_new:nnnn { kernel } { bad-escape } { Invalid~escape~'\iow_char:N\\#1'~ \@@_if_in_cs:TF { within~a~control~sequence. } @@ -6261,14 +6261,14 @@ % % Range errors. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { range-missing-end } +\__kernel_msg_new:nnnn { kernel } { range-missing-end } { Invalid~end-point~for~range~'#1-#2'~in~character~class. } { The~end-point~'#2'~of~the~range~'#1-#2'~may~not~serve~as~an~ end-point~for~a~range:~alphanumeric~characters~should~not~be~ escaped,~and~non-alphanumeric~characters~should~be~escaped. } -\__msg_kernel_new:nnnn { kernel } { range-backwards } +\__kernel_msg_new:nnnn { kernel } { range-backwards } { Range~'[#1-#2]'~out~of~order~in~character~class. } { In~ranges~of~characters~'[x-y]'~appearing~in~character~classes,~ @@ -6280,34 +6280,34 @@ % % Errors related to |\c| and |\u|. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { c-bad-mode } +\__kernel_msg_new:nnnn { kernel } { c-bad-mode } { Invalid~nested~'\iow_char:N\\c'~escape~in~regular~expression. } { The~'\iow_char:N\\c'~escape~cannot~be~used~within~ a~control~sequence~test~'\iow_char:N\\c{...}'.~ To~combine~several~category~tests,~use~'\iow_char:N\\c[...]'. } -\__msg_kernel_new:nnnn { kernel } { c-C-invalid } +\__kernel_msg_new:nnnn { kernel } { c-C-invalid } { '\iow_char:N\\cC'~should~be~followed~by~'.'~or~'(',~not~'#1'. } { The~'\iow_char:N\\cC'~construction~restricts~the~next~item~to~be~a~ control~sequence~or~the~next~group~to~be~made~of~control~sequences.~ It~only~makes~sense~to~follow~it~by~'.'~or~by~a~group. } -\__msg_kernel_new:nnnn { kernel } { c-missing-rbrace } +\__kernel_msg_new:nnnn { kernel } { c-missing-rbrace } { Missing~right~brace~inserted~for~'\iow_char:N\\c'~escape. } { LaTeX~was~given~a~regular~expression~where~a~ '\iow_char:N\\c\iow_char:N\{...'~construction~was~not~ended~ with~a~closing~brace~'\iow_char:N\}'. } -\__msg_kernel_new:nnnn { kernel } { c-missing-rbrack } +\__kernel_msg_new:nnnn { kernel } { c-missing-rbrack } { Missing~right~bracket~inserted~for~'\iow_char:N\\c'~escape. } { A~construction~'\iow_char:N\\c[...'~appears~in~a~ regular~expression,~but~the~closing~']'~is~not~present. } -\__msg_kernel_new:nnnn { kernel } { c-missing-category } +\__kernel_msg_new:nnnn { kernel } { c-missing-category } { Invalid~character~'#1'~following~'\iow_char:N\\c'~escape. } { In~regular~expressions,~the~'\iow_char:N\\c'~escape~sequence~ @@ -6315,19 +6315,19 @@ capital~letter~representing~a~character~category,~namely~ one~of~'ABCDELMOPSTU'. } -\__msg_kernel_new:nnnn { kernel } { c-trailing } +\__kernel_msg_new:nnnn { kernel } { c-trailing } { Trailing~category~code~escape~'\iow_char:N\\c'... } { A~regular~expression~ends~with~'\iow_char:N\\c'~followed~ by~a~letter.~It~will~be~ignored. } -\__msg_kernel_new:nnnn { kernel } { u-missing-lbrace } +\__kernel_msg_new:nnnn { kernel } { u-missing-lbrace } { Missing~left~brace~following~'\iow_char:N\\u'~escape. } { The~'\iow_char:N\\u'~escape~sequence~must~be~followed~by~ a~brace~group~with~the~name~of~the~variable~to~use. } -\__msg_kernel_new:nnnn { kernel } { u-missing-rbrace } +\__kernel_msg_new:nnnn { kernel } { u-missing-rbrace } { Missing~right~brace~inserted~for~'\iow_char:N\\u'~escape. } { LaTeX~ @@ -6340,14 +6340,14 @@ % % Errors when encountering the \textsc{posix} syntax |[:...:]|. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { posix-unsupported } +\__kernel_msg_new:nnnn { kernel } { posix-unsupported } { POSIX~collating~element~'[#1 ~ #1]'~not~supported. } { The~'[.foo.]'~and~'[=bar=]'~syntaxes~have~a~special~meaning~ in~POSIX~regular~expressions.~This~is~not~supported~by~LaTeX.~ Maybe~you~forgot~to~escape~a~left~bracket~in~a~character~class? } -\__msg_kernel_new:nnnn { kernel } { posix-unknown } +\__kernel_msg_new:nnnn { kernel } { posix-unknown } { POSIX~class~'[:#1:]'~unknown. } { '[:#1:]'~is~not~among~the~known~POSIX~classes~ @@ -6356,7 +6356,7 @@ '[:print:]',~'[:punct:]',~'[:space:]',~'[:upper:]',~ '[:word:]',~and~'[:xdigit:]'. } -\__msg_kernel_new:nnnn { kernel } { posix-missing-close } +\__kernel_msg_new:nnnn { kernel } { posix-missing-close } { Missing~closing~':]'~for~POSIX~class. } { The~POSIX~syntax~'#1'~must~be~followed~by~':]',~not~'#2'. } % \end{macrocode} @@ -6365,7 +6365,7 @@ % with an unbalanced token list, which we must re-balance by adding % begin-group or end-group character tokens. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { result-unbalanced } +\__kernel_msg_new:nnnn { kernel } { result-unbalanced } { Missing~brace~inserted~when~#1. } { LaTeX~was~asked~to~do~some~regular~expression~operation,~ @@ -6377,13 +6377,13 @@ % % Error message for unknown options. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { unknown-option } +\__kernel_msg_new:nnnn { kernel } { unknown-option } { Unknown~option~'#1'~for~regular~expressions. } { The~only~available~option~is~'case-insensitive',~toggled~by~ '(?i)'~and~'(?-i)'. } -\__msg_kernel_new:nnnn { kernel } { special-group-unknown } +\__kernel_msg_new:nnnn { kernel } { special-group-unknown } { Unknown~special~group~'#1~...'~in~a~regular~expression. } { The~only~valid~constructions~starting~with~'(?'~are~ @@ -6393,21 +6393,21 @@ % % Errors in the replacement text. % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { replacement-c } +\__kernel_msg_new:nnnn { kernel } { replacement-c } { Misused~'\iow_char:N\\c'~command~in~a~replacement~text. } { In~a~replacement~text,~the~'\iow_char:N\\c'~escape~sequence~ can~be~followed~by~one~of~the~letters~'ABCDELMOPSTU'~ or~a~brace~group,~not~by~'#1'. } -\__msg_kernel_new:nnnn { kernel } { replacement-u } +\__kernel_msg_new:nnnn { kernel } { replacement-u } { Misused~'\iow_char:N\\u'~command~in~a~replacement~text. } { In~a~replacement~text,~the~'\iow_char:N\\u'~escape~sequence~ must~be~~followed~by~a~brace~group~holding~the~name~of~the~ variable~to~use. } -\__msg_kernel_new:nnnn { kernel } { replacement-g } +\__kernel_msg_new:nnnn { kernel } { replacement-g } { Missing~brace~for~the~'\iow_char:N\\g'~construction~ in~a~replacement~text. @@ -6417,7 +6417,7 @@ submatches~are~represented~either~as~'\iow_char:N \\g{dd..d}',~ or~'\\d',~where~'d'~are~single~digits.~Here,~a~brace~is~missing. } -\__msg_kernel_new:nnnn { kernel } { replacement-catcode-end } +\__kernel_msg_new:nnnn { kernel } { replacement-catcode-end } { Missing~character~for~the~'\iow_char:N\\c'~ construction~in~a~replacement~text. @@ -6428,7 +6428,7 @@ the~character~category.~Then,~a~character~must~follow.~LaTeX~ reached~the~end~of~the~replacement~when~looking~for~that. } -\__msg_kernel_new:nnnn { kernel } { replacement-catcode-escaped } +\__kernel_msg_new:nnnn { kernel } { replacement-catcode-escaped } { Escaped~letter~or~digit~after~category~code~in~replacement~text. } @@ -6438,7 +6438,7 @@ the~character~category.~Then,~a~character~must~follow,~not~ '\iow_char:N\\#2'. } -\__msg_kernel_new:nnnn { kernel } { replacement-catcode-in-cs } +\__kernel_msg_new:nnnn { kernel } { replacement-catcode-in-cs } { Category~code~'\iow_char:N\\c#1#3'~ignored~inside~ '\iow_char:N\\c\{...\}'~in~a~replacement~text. @@ -6448,7 +6448,7 @@ '\iow_char:N\\c\{...\}'~are~ignored~when~building~the~control~ sequence~name. } -\__msg_kernel_new:nnnn { kernel } { replacement-null-space } +\__kernel_msg_new:nnnn { kernel } { replacement-null-space } { TeX~cannot~build~a~space~token~with~character~code~0. } { You~asked~for~a~character~token~with~category~space,~ @@ -6457,13 +6457,13 @@ This~specific~case~is~impossible~and~will~be~replaced~ by~a~normal~space. } -\__msg_kernel_new:nnnn { kernel } { replacement-missing-rbrace } +\__kernel_msg_new:nnnn { kernel } { replacement-missing-rbrace } { Missing~right~brace~inserted~in~replacement~text. } { There~ \int_compare:nTF { #1 = 1 } { was } { were } ~ #1~ missing~right~\int_compare:nTF { #1 = 1 } { brace } { braces } . } -\__msg_kernel_new:nnnn { kernel } { replacement-missing-rparen } +\__kernel_msg_new:nnnn { kernel } { replacement-missing-rparen } { Missing~right~parenthesis~inserted~in~replacement~text. } { There~ \int_compare:nTF { #1 = 1 } { was } { were } ~ #1~ @@ -6473,7 +6473,7 @@ % % Used when showing a regex. % \begin{macrocode} -\__msg_kernel_new:nnn { kernel } { show-regex } +\__kernel_msg_new:nnn { kernel } { show-regex } { >~Compiled~regex~ \tl_if_empty:nTF {#1} { variable~ #2 } { {#1} } : @@ -6513,21 +6513,21 @@ % be merged. % % \begin{macro} -% {\__debug_trace_push:nnN, \__debug_trace_pop:nnN, \__debug_trace:nnx} +% {\@@_trace_push:nnN, \@@_trace_pop:nnN, \@@_trace:nnx} % Here |#1| is the module name (\texttt{regex}) and |#2| is % typically~1. If the module's current tracing level is less than % |#2| show nothing, otherwise write |#3| to the terminal. % \begin{macrocode} -\__debug:TF +\__kernel_debug:TF { - \cs_new_protected:Npn \__debug_trace_push:nnN #1#2#3 - { \__debug_trace:nnx {#1} {#2} { entering~ \token_to_str:N #3 } } - \cs_new_protected:Npn \__debug_trace_pop:nnN #1#2#3 - { \__debug_trace:nnx {#1} {#2} { leaving~ \token_to_str:N #3 } } - \cs_new_protected:Npn \__debug_trace:nnx #1#2#3 + \cs_new_protected:Npn \@@_trace_push:nnN #1#2#3 + { \@@_trace:nnx {#1} {#2} { entering~ \token_to_str:N #3 } } + \cs_new_protected:Npn \@@_trace_pop:nnN #1#2#3 + { \@@_trace:nnx {#1} {#2} { leaving~ \token_to_str:N #3 } } + \cs_new_protected:Npn \@@_trace:nnx #1#2#3 { \int_compare:nNnF - { \int_use:c { g__debug_trace_#1_int } } < {#2} + { \int_use:c { g_@@_trace_#1_int } } < {#2} { \iow_term:x { Trace:~#3 } } } } @@ -6535,10 +6535,10 @@ % \end{macrocode} % \end{macro} % -% \begin{variable}{\g__debug_trace_regex_int} +% \begin{variable}{\g_@@_trace_regex_int} % No tracing when that is zero. % \begin{macrocode} -\int_new:N \g__debug_trace_regex_int +\int_new:N \g_@@_trace_regex_int % \end{macrocode} % \end{variable} % @@ -6547,7 +6547,7 @@ % stored in \tn{toks} from $0$ to \cs{l_@@_max_state_int} % (excluded). % \begin{macrocode} -\__debug:TF +\__kernel_debug:TF { \cs_new_protected:Npn \@@_trace_states:n #1 { @@ -6556,7 +6556,7 @@ { 1 } { \l_@@_max_state_int - 1 } { - \__debug_trace:nnx { regex } {#1} + \@@_trace:nnx { regex } {#1} { \iow_char:N \\toks ##1 = { \@@_toks_use:w ##1 } } } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index 0182e9bf0b5..69a8db98fcc 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -735,7 +735,7 @@ % implement sets, one should be careful not to rely on the order of % items in the sequence representing the set. % -% Sets should not contain several occurences of a given item. To make +% Sets should not contain several occurrences of a given item. To make % sure that a \meta{sequence variable} only has distinct items, use % \cs{seq_remove_duplicates:N} \meta{sequence variable}. This function % is relatively slow, and to avoid performance issues one should only @@ -926,7 +926,7 @@ % \begin{macrocode} \cs_new:Npn \@@_item:n { - \__msg_kernel_expandable_error:nn { kernel } { misused-sequence } + \__kernel_msg_expandable_error:nn { kernel } { misused-sequence } \use_none:n } % \end{macrocode} @@ -1871,7 +1871,7 @@ } } { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#1} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index be237db6c17..ed740f3a2f0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % %% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project -%% (C) 2012-2017 The LaTeX3 Project +%% (C) 2012-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -386,6 +386,54 @@ % \texttt{false}. % \end{function} % +% \section{Dimension step functions} +% +% \begin{function}[added = 2018-02-18, rEXP] +% {\dim_step_function:nnnN} +% \begin{syntax} +% \cs{dim_step_function:nnnN} \Arg{initial value} \Arg{step} \Arg{final value} \meta{function} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% The \meta{function} is then placed in front of each \meta{value} +% from the \meta{initial value} to the \meta{final value} in turn +% (using \meta{step} between each \meta{value}). The \meta{step} must +% be non-zero. If the \meta{step} is positive, the loop stops when +% the \meta{value} becomes larger than the \meta{final value}. If the +% \meta{step} is negative, the loop stops when the \meta{value} +% becomes smaller than the \meta{final value}. The \meta{function} +% should absorb one argument. +% \end{function} +% +% \begin{function}[added = 2018-02-18] +% {\dim_step_inline:nnnn} +% \begin{syntax} +% \cs{dim_step_inline:nnnn} \Arg{initial value} \Arg{step} \Arg{final value} \Arg{code} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% Then for each \meta{value} from the \meta{initial value} to the +% \meta{final value} in turn (using \meta{step} between each +% \meta{value}), the \meta{code} is inserted into the input stream +% with |#1| replaced by the current \meta{value}. Thus the +% \meta{code} should define a function of one argument~(|#1|). +% \end{function} +% +% \begin{function}[added = 2018-02-18] +% {\dim_step_variable:nnnNn} +% \begin{syntax} +% \cs{dim_step_variable:nnnNn} \\ +% ~~\Arg{initial value} \Arg{step} \Arg{final value} \meta{tl~var} \Arg{code} +% \end{syntax} +% This function first evaluates the \meta{initial value}, \meta{step} +% and \meta{final value}, all of which should be dimension expressions. +% Then for each \meta{value} from the \meta{initial value} to the +% \meta{final value} in turn (using \meta{step} between each +% \meta{value}), the \meta{code} is inserted into the input stream, +% with the \meta{tl~var} defined as the current \meta{value}. Thus +% the \meta{code} should make use of the \meta{tl~var}. +% \end{function} +% % \section{Using \texttt{dim} expressions and variables} % % \begin{function}[updated = 2011-10-22, EXP]{\dim_eval:n} @@ -1074,7 +1122,7 @@ % \cs{dim_eval:n} to avoid needing a debugging patch that wraps the % expression in checking code. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \dim_const:Nn #1#2 { \dim_new:N #1 @@ -1090,9 +1138,9 @@ % case where the variable passed is incorrectly a skip (for example a % \LaTeXe{} length). % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_skip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \dim_gzero:N #1 { \tex_global:D #1 \c_zero_skip } \cs_generate_variant:Nn \dim_zero:N { c } @@ -1134,10 +1182,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2#3 { - \__debug_patch_args:nnnNNpn + \__kernel_patch_args:nnnNNpn { #1 ##1 } { } - { {##1} { \__debug_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \@@_eval:w { } #3 } } #2 #3 } % \end{macrocode} @@ -1150,10 +1198,10 @@ % where the variable passed is a skip (for example a \LaTeXe{} % length). % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_set:Nn #1#2 { #1 ~ \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gset:Nn #1#2 { \tex_global:D #1 ~ \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_set:Nn { c } @@ -1168,11 +1216,11 @@ % All straightforward, with a \cs{scan_stop:} to deal with the case % where |#1| is (incorrectly) a skip. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \dim_set_eq:NN #1#2 { #1 = #2 \scan_stop: } \cs_generate_variant:Nn \dim_set_eq:NN { c , Nc , cc } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 \scan_stop: } \cs_generate_variant:Nn \dim_gset_eq:NN { c , Nc , cc } @@ -1191,18 +1239,18 @@ % the local versions. The debugging code is inserted by % \cs{@@_tmp:w}. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_add:Nn #1#2 { \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_add:Nn { c } \cs_generate_variant:Nn \dim_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \dim_sub:Nn #1#2 { \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \dim_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \@@_eval:w #2 \@@_eval_end: \scan_stop: } \cs_generate_variant:Nn \dim_sub:Nn { c } @@ -1226,8 +1274,8 @@ % Functions for $\min$, $\max$, and absolute value with only one evaluation. % The absolute value is evaluated by removing a leading~|-| if present. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_abs:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_abs:n } } \cs_new:Npn \dim_abs:n #1 { \exp_after:wN \@@_abs:N @@ -1235,10 +1283,10 @@ } \cs_new:Npn \@@_abs:N #1 { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_max:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_max:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_max:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_max:nn } } \cs_new:Npn \dim_max:nn #1#2 { @@ -1248,10 +1296,10 @@ > \@@_eval_end: } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_min:nn } - { \__debug_chk_expr:nNnN {#2} \@@_eval:w { } \dim_min:nn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_min:nn } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_min:nn } } \cs_new:Npn \dim_min:nn #1#2 { @@ -1296,11 +1344,11 @@ % \begin{macro}[pTF, EXP]{\dim_compare:nNn} % Simple comparison. % \begin{macrocode} -\__debug_patch_conditional_args:nNNpnn +\__kernel_patch_conditional_args:nNNpnn { - { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_compare:nNn } + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_compare:nNn } { \@@_eval_end: #2 } - { \__debug_chk_expr:nNnN {#3} \@@_eval:w { } \dim_compare:nNn } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \dim_compare:nNn } } \prg_new_conditional:Npnn \dim_compare:nNn #1#2#3 { p , T , F , TF } { @@ -1494,13 +1542,106 @@ % \end{macro} % \end{macro} % +% \subsection{Dimension step functions} +% +% \begin{macro}{\dim_step_function:nnnN} +% \begin{macro}{\@@_step:wwwN, \@@_step:NnnnN} +% Before all else, evaluate the initial value, step, and final value. +% Repeating a function by steps first needs a check on the direction +% of the steps. After that, do the function for the start value then +% step and loop around. It would be more symmetrical to test for a +% step size of zero before checking the sign, but we optimize for the +% most frequent case (positive step). +% \begin{macrocode} +\__kernel_patch_args:nNNpn + { + { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#2} \@@_eval:w { } \dim_step_function:nnnN } + { \__kernel_chk_expr:nNnN {#3} \@@_eval:w { } \dim_step_function:nnnN } + } +\cs_new:Npn \dim_step_function:nnnN #1#2#3 + { + \exp_after:wN \@@_step:wwwN + \tex_the:D \@@_eval:w #1 \exp_after:wN ; + \tex_the:D \@@_eval:w #2 \exp_after:wN ; + \tex_the:D \@@_eval:w #3 ; + } +\cs_new:Npn \@@_step:wwwN #1; #2; #3; #4 + { + \dim_compare:nNnTF {#2} > \c_zero_dim + { \@@_step:NnnnN > } + { + \dim_compare:nNnTF {#2} = \c_zero_dim + { + \__kernel_msg_expandable_error:nnn { kernel } { zero-step } {#4} + \use_none:nnnn + } + { \@@_step:NnnnN < } + } + {#1} {#2} {#3} #4 + } +\cs_new:Npn \@@_step:NnnnN #1#2#3#4#5 + { + \dim_compare:nNnF {#2} #1 {#4} + { + #5 {#2} + \exp_args:NNf \@@_step:NnnnN + #1 { \dim_eval:n { #2 + #3 } } {#3} {#4} #5 + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dim_step_inline:nnnn} +% \begin{macro}{\dim_step_variable:nnnNn} +% \begin{macro}{\@@_step:NNnnnn} +% The approach here is to build a function, with a global integer +% required to make the nesting safe (as seen in other in line +% functions), and map that function using \cs{dim_step_function:nnnN}. +% We put a \cs{__prg_break_point:Nn} so that \texttt{map_break} +% functions from other modules correctly decrement \cs{g__prg_map_int} +% before looking for their own break point. The first argument is +% \cs{scan_stop:}, so that no breaking function recognizes this break +% point as its own. +% \begin{macrocode} +\cs_new_protected:Npn \dim_step_inline:nnnn + { + \int_gincr:N \g__prg_map_int + \exp_args:NNc \@@_step:NNnnnn + \cs_gset_protected:Npn + { __prg_map_ \int_use:N \g__prg_map_int :w } + } +\cs_new_protected:Npn \dim_step_variable:nnnNn #1#2#3#4#5 + { + \int_gincr:N \g__prg_map_int + \exp_args:NNc \@@_step:NNnnnn + \cs_gset_protected:Npx + { __prg_map_ \int_use:N \g__prg_map_int :w } + {#1}{#2}{#3} + { + \tl_set:Nn \exp_not:N #4 {##1} + \exp_not:n {#5} + } + } +\cs_new_protected:Npn \@@_step:NNnnnn #1#2#3#4#5#6 + { + #1 #2 ##1 {#6} + \dim_step_function:nnnN {#3} {#4} {#5} #2 + \__prg_break_point:Nn \scan_stop: { \int_gdecr:N \g__prg_map_int } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Using \texttt{dim} expressions and variables} % % \begin{macro}{\dim_eval:n} % Evaluating a dimension expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_eval:n } } \cs_new:Npn \dim_eval:n #1 { \dim_use:N \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} @@ -1512,8 +1653,8 @@ % difference with \cs{dim_eval:n} is the lack of \cs{dim_use:N}, to % produce an internal dimension rather than expand it into characters. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \@@_eval:n } } \cs_new:Npn \@@_eval:n #1 { \@@_eval:w #1 \@@_eval_end: } % \end{macrocode} % \end{macro} @@ -1539,8 +1680,8 @@ % terminating early and leaving extra tokens lying around. This is % used a lot by low-level manipulations. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal:n } } \cs_new:Npn \dim_to_decimal:n #1 { \exp_after:wN @@ -1575,8 +1716,8 @@ % Another hard-coded conversion: this one is necessary to avoid things going % off-scale. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal_in_sp:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \@@_eval:w { } \dim_to_decimal_in_sp:n } } \cs_new:Npn \dim_to_decimal_in_sp:n #1 { \int_eval:n { \@@_eval:w #1 \@@_eval_end: } } % \end{macrocode} @@ -1677,7 +1818,7 @@ % even for constants. See \cs{dim_const:Nn} for why we cannot use % \cs{skip_gset:Nn}. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \skip_const:Nn #1#2 { \skip_new:N #1 @@ -1691,9 +1832,9 @@ % \begin{macro}{\skip_gzero:N, \skip_gzero:c} % Reset the register to zero. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \skip_zero:N #1 { #1 \c_zero_skip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \skip_gzero:N #1 { \tex_global:D #1 \c_zero_skip } \cs_generate_variant:Nn \skip_zero:N { c } \cs_generate_variant:Nn \skip_gzero:N { c } @@ -1733,10 +1874,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2#3 { - \__debug_patch_args:nnnNNpn + \__kernel_patch_args:nnnNNpn { #1 ##1 } { } - { {##1} { \__debug_chk_expr:nNnN {##2} \etex_glueexpr:D { } #3 } } + { {##1} { \__kernel_chk_expr:nNnN {##2} \etex_glueexpr:D { } #3 } } #2 #3 } % \end{macrocode} @@ -1745,10 +1886,10 @@ % \begin{macro}{\skip_gset:Nn, \skip_gset:cn} % Much the same as for dimensions. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_set:Nn #1#2 { #1 ~ \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gset:Nn #1#2 { \tex_global:D #1 ~ \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_set:Nn { c } @@ -1777,18 +1918,18 @@ % \begin{macro}{\skip_gsub:Nn, \skip_gsub:cn} % Using |by| here deals with the (incorrect) case |\skip123|. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_add:Nn #1#2 { \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_add:Nn { c } \cs_generate_variant:Nn \skip_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \skip_sub:Nn #1#2 { \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \skip_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \skip_sub:Nn { c } @@ -1830,10 +1971,10 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1 { - \__debug_patch_conditional_args:nNNpnn + \__kernel_patch_conditional_args:nNNpnn { { - \__debug_chk_expr:nNnN + \__kernel_chk_expr:nNnN {##1} \etex_glueexpr:D { } \skip_if_finite:n } } @@ -1855,8 +1996,8 @@ % \begin{macro}{\skip_eval:n} % Evaluating a skip expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_eval:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_eval:n } } \cs_new:Npn \skip_eval:n #1 { \skip_use:N \etex_glueexpr:D #1 \scan_stop: } % \end{macrocode} @@ -1878,13 +2019,13 @@ % Inserting skips. % \begin{macrocode} \cs_new_eq:NN \skip_horizontal:N \tex_hskip:D -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_horizontal:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_horizontal:n } } \cs_new:Npn \skip_horizontal:n #1 { \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: } \cs_new_eq:NN \skip_vertical:N \tex_vskip:D -\__debug_patch_args:nNNpn - { { \__debug_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_vertical:n } } +\__kernel_patch_args:nNNpn + { { \__kernel_chk_expr:nNnN {#1} \etex_glueexpr:D { } \skip_vertical:n } } \cs_new:Npn \skip_vertical:n #1 { \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: } \cs_generate_variant:Nn \skip_horizontal:N { c } @@ -1967,7 +2108,7 @@ % \begin{macro}{\muskip_const:Nn, \muskip_const:cn} % See \cs{skip_const:Nn}. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \muskip_const:Nn #1#2 { \muskip_new:N #1 @@ -1981,10 +2122,10 @@ % \begin{macro}{\muskip_gzero:N, \muskip_gzero:c} % Reset the register to zero. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \muskip_zero:N #1 { #1 \c_zero_muskip } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \muskip_gzero:N #1 { \tex_global:D #1 \c_zero_muskip } \cs_generate_variant:Nn \muskip_zero:N { c } @@ -2025,13 +2166,13 @@ % \begin{macrocode} \cs_set_protected:Npn \@@_tmp:w #1#2#3 { - \__debug_patch_args:nnnNNpn + \__kernel_patch_args:nnnNNpn { #1 ##1 } { } { {##1} { - \__debug_chk_expr:nNnN {##2} + \__kernel_chk_expr:nNnN {##2} \etex_muexpr:D { \etex_mutoglue:D } #3 } } @@ -2043,10 +2184,10 @@ % \begin{macro}{\muskip_gset:Nn, \muskip_gset:cn} % This should be pretty familiar. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_set:Nn #1#2 { #1 ~ \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gset:Nn #1#2 { \tex_global:D #1 ~ \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_set:Nn { c } @@ -2067,10 +2208,10 @@ % } % All straightforward. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \muskip_set_eq:NN #1#2 { #1 = #2 } \cs_generate_variant:Nn \muskip_set_eq:NN { c , Nc , cc } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \muskip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 } \cs_generate_variant:Nn \muskip_gset_eq:NN { c , Nc , cc } % \end{macrocode} @@ -2083,18 +2224,18 @@ % \begin{macro}{\muskip_gsub:Nn, \muskip_gsub:cn} % Using |by| here deals with the (incorrect) case |\muskip123|. % \begin{macrocode} -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_add:Nn #1#2 { \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gadd:Nn #1#2 { \tex_global:D \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_add:Nn { c } \cs_generate_variant:Nn \muskip_gadd:Nn { c } -\@@_tmp:w \__debug_chk_var_local:N +\@@_tmp:w \__kernel_chk_var_local:N \cs_new_protected:Npn \muskip_sub:Nn #1#2 { \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } -\@@_tmp:w \__debug_chk_var_global:N +\@@_tmp:w \__kernel_chk_var_global:N \cs_new_protected:Npn \muskip_gsub:Nn #1#2 { \tex_global:D \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \muskip_sub:Nn { c } @@ -2110,10 +2251,10 @@ % \begin{macro}{\muskip_eval:n} % Evaluating a muskip expression expandably. % \begin{macrocode} -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { { - \__debug_chk_expr:nNnN {#1} \etex_muexpr:D + \__kernel_chk_expr:nNnN {#1} \etex_muexpr:D { \etex_mutoglue:D } \muskip_eval:n } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index d4fa71146b4..31eba1be4f9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -1,6 +1,6 @@ % \iffalse % -%% File l3sort.dtx (C) Copyright 2012-2017 The LaTeX3 Project +%% File l3sort.dtx (C) Copyright 2012-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -585,14 +585,14 @@ \cs_new_protected:Npn \@@_return_mark:N #1 { } \cs_new_protected:Npn \@@_return_none_error: { - \__msg_kernel_error:nnxx { kernel } { return-none } + \__kernel_msg_error:nnxx { kernel } { return-none } { \tex_the:D \tex_toks:D \l_@@_A_int } { \tex_the:D \tex_toks:D \l_@@_C_int } \@@_return_same: } \cs_new_protected:Npn \@@_return_two_error:w #1 \@@_return_none_error: - { \__msg_kernel_error:nn { kernel } { return-two } } + { \__kernel_msg_error:nn { kernel } { return-two } } % \end{macrocode} % \end{macro} % \end{macro} @@ -1013,12 +1013,12 @@ { \cs_set_eq:NN \toksdef \@@_disabled_toksdef:n } \cs_new_protected:Npn \@@_disabled_toksdef:n #1 { - \__msg_kernel_error:nnx { kernel } { toksdef } + \__kernel_msg_error:nnx { kernel } { toksdef } { \token_to_str:N #1 } \@@_error: \tex_toksdef:D #1 } -\__msg_kernel_new:nnnn { kernel } { toksdef } +\__kernel_msg_new:nnnn { kernel } { toksdef } { Allocation~of~\iow_char:N\\toks~registers~impossible~while~sorting. } { The~comparison~code~used~for~sorting~a~list~has~attempted~to~ @@ -1037,13 +1037,13 @@ \cs_new_protected:Npn \@@_too_long_error:NNw #1#2 \fi: { \fi: - \__msg_kernel_error:nnxxx { kernel } { too-large } + \__kernel_msg_error:nnxxx { kernel } { too-large } { \token_to_str:N #2 } { \int_eval:n { \l_@@_true_max_int - \l_@@_min_int } } { \int_eval:n { \l_@@_top_int - \l_@@_min_int } } #1 \@@_error: } -\__msg_kernel_new:nnnn { kernel } { too-large } +\__kernel_msg_new:nnnn { kernel } { too-large } { The~list~#1~is~too~long~to~be~sorted~by~TeX. } { TeX~has~#2~toks~registers~still~available:~ @@ -1054,7 +1054,7 @@ % \end{macro} % % \begin{macrocode} -\__msg_kernel_new:nnnn { kernel } { return-none } +\__kernel_msg_new:nnnn { kernel } { return-none } { The~comparison~code~did~not~return. } { When~sorting~a~list,~the~code~to~compare~items~#1~and~#2~ @@ -1063,7 +1063,7 @@ \iow_char:N\\sort_return_swapped: .~ Exactly~one~of~these~should~be~called. } -\__msg_kernel_new:nnnn { kernel } { return-two } +\__kernel_msg_new:nnnn { kernel } { return-two } { The~comparison~code~returned~multiple~times. } { When~sorting~a~list,~the~code~to~compare~items~called~ @@ -1078,9 +1078,9 @@ % \begin{macro}[deprecated = 2018-12-31]{\sort_ordered:, \sort_reversed:} % These functions were renamed for consistency. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } { \sort_return_same: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \sort_return_same: } \cs_new_protected:Npn \sort_ordered: { \sort_return_same: } -\__debug_deprecation:nnNNpn { 2018-12-31 } { \sort_return_swapped: } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \sort_return_swapped: } \cs_new_protected:Npn \sort_reversed: { \sort_return_swapped: } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index f192b81948d..bcf24c33bc5 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3str.dtx Copyright (C) 2011-2017 The LaTeX3 Project +%% File: l3str.dtx Copyright (C) 2011-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1012,7 +1012,7 @@ { \tl_if_empty:nTF {#4} { - \__msg_kernel_error:nnx { kernel } { empty-search-pattern } {#5} + \__kernel_msg_error:nnx { kernel } { empty-search-pattern } {#5} } { \use:x @@ -1496,7 +1496,7 @@ } \cs_new:Npn \str_item_ignore_spaces:nn #1 { \exp_args:No \@@_item:nn { \tl_to_str:n {#1} } } -\__debug_patch_args:nNNpn { {#1} { \__int_eval:n {#2} } } +\__kernel_patch_args:nNNpn { {#1} { \__int_eval:n {#2} } } \cs_new:Npn \@@_item:nn #1#2 { \exp_after:wN \@@_item:w @@ -1593,7 +1593,7 @@ } \cs_new:Npn \str_range_ignore_spaces:nnn #1 { \exp_args:No \@@_range:nnn { \tl_to_str:n {#1} } } -\__debug_patch_args:nNNpn +\__kernel_patch_args:nNNpn { {#1} { \__int_eval:n {#2} } { \__int_eval:n {#3} } } \cs_new:Npn \@@_range:nnn #1#2#3 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index dc275b1236e..a3314333f0a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index f84510166f1..0e3a85e268e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -1078,7 +1078,7 @@ % \end{variable} % % \begin{macrocode} -\__msg_kernel_new:nnn { kernel } { show-tl-analysis } +\__kernel_msg_new:nnn { kernel } { show-tl-analysis } { The~token~list~ \tl_if_empty:nF {#1} { #1 ~ } \tl_if_empty:nTF {#2} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx index a6a7a25e4cd..00a4308c2e7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-build.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 086b68ffdde..ef429b9d7dd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3tl.dtx Copyright (C) 1990-2017 The LaTeX3 Project +%% File: l3tl.dtx Copyright (C) 1990-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -988,7 +988,7 @@ % appropriate item from the \meta{token list} in the input stream. % If the \meta{integer expression} is negative, indexing occurs from % the right of the token list, starting at $-1$ for the right-most item. -% If the index is out of bounds, then thr function expands to nothing. +% If the index is out of bounds, then the function expands to nothing. % \begin{texnote} % The result is returned within the \tn{unexpanded} % primitive (\cs{exp_not:n}), which means that the \meta{item} @@ -1131,13 +1131,13 @@ % \begin{macro}{\tl_const:Nn, \tl_const:Nx, \tl_const:cn, \tl_const:cx} % Constants are also easy to generate. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \tl_const:Nn #1#2 { \__chk_if_free_cs:N #1 \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_scope:NN c #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_scope:NN c #1 } { } \cs_new_protected:Npn \tl_const:Nx #1#2 { \__chk_if_free_cs:N #1 @@ -1186,14 +1186,14 @@ \tex_ifodd:D \l@expl@enable@debug@bool \cs_new_protected:Npn \tl_set_eq:NN #1#2 { - \__debug_chk_var_local:N #1 - \__debug_chk_var_exist:N #2 + \__kernel_chk_var_local:N #1 + \__kernel_chk_var_exist:N #2 \cs_set_eq:NN #1 #2 } \cs_new_protected:Npn \tl_gset_eq:NN #1#2 { - \__debug_chk_var_global:N #1 - \__debug_chk_var_exist:N #2 + \__kernel_chk_var_global:N #1 + \__kernel_chk_var_exist:N #2 \cs_gset_eq:NN #1 #2 } \else: @@ -1212,18 +1212,18 @@ % three arguments must be checked: a token list |#2| or |#3| equal to % \cs{scan_stop:} would lead to problems later on. % \begin{macrocode} -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { - \__debug_chk_var_exist:N #2 - \__debug_chk_var_exist:N #3 + \__kernel_chk_var_exist:N #2 + \__kernel_chk_var_exist:N #3 } { } \cs_new_protected:Npn \tl_concat:NNN #1#2#3 { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } } -\__debug_patch:nnNNpn +\__kernel_patch:nnNNpn { - \__debug_chk_var_exist:N #2 - \__debug_chk_var_exist:N #3 + \__kernel_chk_var_exist:N #2 + \__kernel_chk_var_exist:N #3 } { } \cs_new_protected:Npn \tl_gconcat:NNN #1#2#3 @@ -1292,25 +1292,25 @@ % which makes the token list registers provided by \TeX{} % more or less redundant. The \cs{tl_set:No} version is done % \enquote{by hand} as it is used quite a lot. Each definition is -% prefixed by a call to \cs{__debug_patch:nnNNpn} which adds an +% prefixed by a call to \cs{__kernel_patch:nnNNpn} which adds an % existence check to the definition. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_set:Nn #1#2 { \cs_set_nopar:Npx #1 { \exp_not:n {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_set:No #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_set:Nx #1#2 { \cs_set_nopar:Npx #1 {#2} } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gset:Nn #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gset:No #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gset:Nx #1#2 { \cs_gset_nopar:Npx #1 {#2} } \cs_generate_variant:Nn \tl_set:Nn { NV , Nv , Nf } @@ -1335,28 +1335,28 @@ % } % Adding to the left is done directly to gain a little performance. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_left:Nn #1#2 { \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_left:NV #1#2 { \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_left:No #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_left:Nx #1#2 { \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_left:Nn #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_left:NV #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_left:No #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_left:Nx #1#2 { \cs_gset_nopar:Npx #1 { #2 \exp_not:o {#1} } } \cs_generate_variant:Nn \tl_put_left:Nn { c } @@ -1385,28 +1385,28 @@ % } % The same on the right. % \begin{macrocode} -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_right:Nn #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_right:NV #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_right:No #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \tl_put_right:Nx #1#2 { \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_right:Nn #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_right:NV #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_right:No #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } } -\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { } +\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \tl_gput_right:Nx #1#2 { \cs_gset_nopar:Npx #1 { \exp_not:o {#1} #2 } } \cs_generate_variant:Nn \tl_put_right:Nn { c } @@ -1757,7 +1757,7 @@ { \tl_if_empty:nTF {#6} { - \__msg_kernel_error:nnx { kernel } { empty-search-pattern } + \__kernel_msg_error:nnx { kernel } { empty-search-pattern } { \tl_to_str:n {#7} } } { @@ -2316,7 +2316,7 @@ { \tl_if_exist:NTF #1 {#1} { - \__msg_kernel_expandable_error:nnn + \__kernel_msg_expandable_error:nnn { kernel } { bad-variable } {#1} } } @@ -3041,9 +3041,9 @@ % \begin{macro}[deprecated=2017-12-31]{\tl_to_lowercase:n, \tl_to_uppercase:n} % For removal after 2017-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2017-12-31 } { \tex_lowercase:D } +\__kernel_patch_deprecation:nnNNpn { 2017-12-31 } { \tex_lowercase:D } \cs_new_protected:Npn \tl_to_lowercase:n #1 { \tex_lowercase:D {#1} } -\__debug_deprecation:nnNNpn { 2017-12-31 } { \tex_uppercase:D } +\__kernel_patch_deprecation:nnNNpn { 2017-12-31 } { \tex_uppercase:D } \cs_new_protected:Npn \tl_to_uppercase:n #1 { \tex_uppercase:D {#1} } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index cca43cdd93c..b6d06510a9a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3token.dtx Copyright (C) 2005-2017 The LaTeX3 Project +%% File: l3token.dtx Copyright (C) 2005-2018 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -12,6 +12,7 @@ % This file is part of the "l3kernel bundle" (The Work in LPPL) % and all files in that bundle must be distributed together. % +%=[] % ----------------------------------------------------------------------- % % The development version of the bundle can be found at @@ -41,7 +42,7 @@ % }^^A % } % -% \date{Released 2017/12/16} +% \date{Released 2018/02/21} % % \maketitle % @@ -701,7 +702,7 @@ % \cs{token_if_toks_register:NTF} \meta{token} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the \meta{token} is defined to be a toks register -% (not used by\LaTeX3). +% (not used by \LaTeX3). % \end{function} % % \begin{function}[updated = 2011-05-23, EXP,pTF]{\token_if_primitive:N} @@ -1367,7 +1368,7 @@ % the interface layer, turn the two arguments into integers up-front so % this is only done once. % \begin{macrocode} -\__debug_patch_args:nNNpn { { \__int_eval:n {#1} } { \__int_eval:n {#2} } } +\__kernel_patch_args:nNNpn { { \__int_eval:n {#1} } { \__int_eval:n {#2} } } \cs_new:Npn \char_generate:nn #1#2 { \exp:w \exp_after:wN \@@_generate_aux:w @@ -1393,13 +1394,13 @@ \cs_new:Npn \@@_generate_aux:w #1 ; #2 ; { \if_int_compare:w #2 = 13 \exp_stop_f: - \__msg_kernel_expandable_error:nn { kernel } { char-active } + \__kernel_msg_expandable_error:nn { kernel } { char-active } \else: \if_int_compare:w #2 = 10 \exp_stop_f: \if_int_compare:w #1 = 0 \exp_stop_f: - \__msg_kernel_expandable_error:nn { kernel } { char-null-space } + \__kernel_msg_expandable_error:nn { kernel } { char-null-space } \else: - \__msg_kernel_expandable_error:nn { kernel } { char-space } + \__kernel_msg_expandable_error:nn { kernel } { char-space } \fi: \else: \if_int_odd:w 0 @@ -1407,13 +1408,13 @@ \if_int_compare:w #2 = 5 \exp_stop_f: 1 \fi: \if_int_compare:w #2 = 9 \exp_stop_f: 1 \fi: \if_int_compare:w #2 > 13 \exp_stop_f: 1 \fi: \exp_stop_f: - \__msg_kernel_expandable_error:nn { kernel } + \__kernel_msg_expandable_error:nn { kernel } { char-invalid-catcode } \else: \if_int_odd:w 0 \if_int_compare:w #1 < 0 \exp_stop_f: 1 \fi: \if_int_compare:w #1 > \c_@@_max_int 1 \fi: \exp_stop_f: - \__msg_kernel_expandable_error:nn { kernel } + \__kernel_msg_expandable_error:nn { kernel } { char-out-of-range } \else: \@@_generate_aux:nnw {#1} {#2} @@ -2556,7 +2557,7 @@ % \begin{macro}[deprecated=2018-12-31]{\token_new:Nn} % For removal after 2018-12-31. % \begin{macrocode} -\__debug_deprecation:nnNNpn { 2018-12-31 } { \cs_new_eq:NN } +\__kernel_patch_deprecation:nnNNpn { 2018-12-31 } { \cs_new_eq:NN } \cs_new_protected:Npn \token_new:Nn #1#2 { \cs_new_eq:NN #1 #2 } % \end{macrocode} % \end{macro} -- cgit v1.2.3