[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk fp (a1b3595)
Will Robertson
wspr81 at gmail.com
Wed Jan 16 05:37:39 CET 2019
Repository : https://github.com/latex3/latex3
On branch : morechk
Link : https://github.com/latex3/latex3/commit/a1b3595f9a75b03ea273120e9241accb94c617eb
>---------------------------------------------------------------
commit a1b3595f9a75b03ea273120e9241accb94c617eb
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
>---------------------------------------------------------------
a1b3595f9a75b03ea273120e9241accb94c617eb
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 aed796e..9a62278 100644
--- a/l3kernel/l3fp-convert.dtx
+++ b/l3kernel/l3fp-convert.dtx
@@ -544,7 +544,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