[latex3-commits] [git/LaTeX3-latex3-latex3] morechk: chk fp (7279c23)

Will Robertson wspr81 at gmail.com
Mon Feb 4 11:23:19 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : morechk
Link       : https://github.com/latex3/latex3/commit/7279c23a0abcdd5aa892a005b8b86d82f9651aba

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

commit 7279c23a0abcdd5aa892a005b8b86d82f9651aba
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


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

7279c23a0abcdd5aa892a005b8b86d82f9651aba
 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 02e606b..92e7bbb 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