[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk fp (0f0080e)

Will Robertson wspr81 at gmail.com
Mon Apr 15 13:44:45 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : morechk
Link       : https://github.com/latex3/latex3/commit/0f0080eb0a697bb2e8da0c7be23ec5dab2564bf8

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

commit 0f0080eb0a697bb2e8da0c7be23ec5dab2564bf8
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


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

0f0080eb0a697bb2e8da0c7be23ec5dab2564bf8
 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 e8cbbd7..52a6057 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