summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty21
1 files changed, 16 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty
index 54af9aa33dd..291b343baa3 100644
--- a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty
+++ b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-mod-fpnum.sty
@@ -1,5 +1,13 @@
%%% module name :: fpnum
+% regist type and gc
+\ifx\@defined@additional@type\@empty
+ \def\@defined@additional@type{fpnum}%
+\else
+ \edef\@defined@additional@type{\@defined@additional@type,fpnum}%
+\fi
+\let\@lisp@gc@trace@fpnum\@gobble
+
\def\@mod@read@fpnum#1#2{\gdef#1{\@tlabel@fpnum{#2}}}
\def\@tlabel@fpnum{\@eval@fpnum\@apply@fpnum\@@apply@fpnum}
@@ -10,10 +18,12 @@
\newdimen\@tempdimeni
\newdimen\@tempdimenii
-\addassoc\@globalenv\fpnumTOstring{\@tlabel@func{\@mod@fpnum@tostring}}
+\@lisp@env@add@global\fpnumTOstring{\@tlabel@func{\@lisp@func@check@args{1}{\@mod@fpnum@tostring}}}
+%TODO: error handling
\def\@mod@fpnum@tostring#1\@tlabel@fpnum#2{\gdef#1{\@tlabel@string{#2}}}
-\addassoc\@globalenv\fpplus{\@tlabel@func{\@tempdimeni0pt\relax\@mod@fpnum@plus}}
+\@lisp@env@add@global\fpplus{\@tlabel@func{\@lisp@func@check@args{*}{\@tempdimeni0pt\relax\@mod@fpnum@plus}}}
+%TODO: error handling
\def\@mod@fpnum@plus#1#2#3{%
\ifx#2\relax
\let\@next@fpnum@plus\@@fin@fpnum@plus
@@ -25,7 +35,8 @@
\fi\fi\@next@fpnum@plus#1}
\def\@@fin@fpnum@plus#1{\xdef#1{\noexpand\@tlabel@fpnum{\strip@pt\@tempdimeni}}}
-\addassoc\@globalenv\fpmul{\@tlabel@func{\@tempdimeni1pt\relax\@mod@fpnum@mul}}
+\@lisp@env@add@global\fpmul{\@tlabel@func{\@lisp@func@check@args{*}{\@tempdimeni1pt\relax\@mod@fpnum@mul}}}
+%TODO: error handling
\def\@mod@fpnum@mul#1#2#3{%
\ifx#2\relax
\let\@next@fpnum@mul\@@fin@fpnum@mul
@@ -37,7 +48,7 @@
\fi\fi\@next@fpnum@mul#1}
\def\@@fin@fpnum@mul#1{\xdef#1{\noexpand\@tlabel@fpnum{\strip@pt\@tempdimeni}}}
-\addassoc\@globalenv\fpminus{\@tlabel@func{\@mod@fpnum@minus}}
+\@lisp@env@add@global\fpminus{\@tlabel@func{\@lisp@func@check@args{+}{\@mod@fpnum@minus}}}
\def\@mod@fpnum@minus#1#2#3#4#5{%
\ifx#4\relax
\ifx#2\@tlabel@fpnum
@@ -72,7 +83,7 @@
\fi\fi
\@next@fpnum@minus#1}
-\addassoc\@globalenv\fplt{\@tlabel@func{\@mod@fpnum@lt}}
+\@lisp@env@add@global\fplt{\@tlabel@func{\@lisp@func@check@args{2}{\@mod@fpnum@lt}}}
\def\@mod@fpnum@lt#1\@tlabel@fpnum#2\@tlabel@fpnum#3{%
\ifdim#2pt<#3pt
\gdef#1{\@tlabel@bool{t}}%