[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk fp (ee3b750)
Will Robertson
wspr81 at gmail.com
Mon Jan 14 08:16:54 CET 2019
Repository : https://github.com/latex3/latex3
On branch : morechk
Link : https://github.com/latex3/latex3/commit/ee3b75027e7cc1cec6f4a3ed03cf55e331c37309
>---------------------------------------------------------------
commit ee3b75027e7cc1cec6f4a3ed03cf55e331c37309
Author: Will Robertson <wspr81 at gmail.com>
Date: Mon Jan 14 12:42:09 2019 +0800
chk fp
because `\fp_use:N \undefined` eventually errors hard, this check needs to abort if it fails
>---------------------------------------------------------------
ee3b75027e7cc1cec6f4a3ed03cf55e331c37309
l3kernel/l3fp-convert.dtx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/l3kernel/l3fp-convert.dtx b/l3kernel/l3fp-convert.dtx
index 78a2edd..79a9b14 100644
--- a/l3kernel/l3fp-convert.dtx
+++ b/l3kernel/l3fp-convert.dtx
@@ -542,7 +542,16 @@
% \begin{macro}[EXP]{\fp_use:N, \fp_use:c, \fp_eval:n}
% Those public functions are simple copies of the decimal conversions.
% \begin{macrocode}
-\cs_new_eq:NN \fp_use:N \fp_to_decimal:N
+\__kernel_if_debug:TF
+ {
+ \cs_new:Npn \fp_use:N #1
+ {
+ \__kernel_chk_var_exist:NT #1 { \fp_to_decimal:N #1 }
+ }
+ }
+ {
+ \cs_new_eq:NN \fp_use:N \fp_to_decimal:N
+ }
\cs_generate_variant:Nn \fp_use:N { c }
\cs_new_eq:NN \fp_eval:n \fp_to_decimal:n
% \end{macrocode}
More information about the latex3-commits
mailing list