diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3skip.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3skip.dtx | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3skip.dtx b/Master/texmf-dist/source/latex/expl3/l3skip.dtx index af3a37564be..87174998097 100644 --- a/Master/texmf-dist/source/latex/expl3/l3skip.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3skip.dtx @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3skip.dtx 2047 2010-09-23 09:27:30Z will $ +\GetIdInfo$Id: l3skip.dtx 2063 2010-10-03 08:26:49Z mittelba $ {L3 Experimental skip registers} %\iffalse %<*driver> @@ -835,8 +835,8 @@ % \begin{macrocode} \prg_new_conditional:Nnn \skip_if_infinite_glue:n {p,TF,T,F} { \bool_if:nTF { - \intexpr_compare_p:nNn {\etex_gluestretchorder:D #1 } > \c_zero || - \intexpr_compare_p:nNn {\etex_glueshrinkorder:D #1 } > \c_zero + \int_compare_p:nNn {\etex_gluestretchorder:D #1 } > \c_zero || + \int_compare_p:nNn {\etex_glueshrinkorder:D #1 } > \c_zero } {\prg_return_true:} {\prg_return_false:} } % \end{macrocode} @@ -1034,10 +1034,13 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\if_dim:w} -% The comparison primitive. +% \begin{macro}{\if_dim:w,\dim_value:w,\dim_eval:w,\dim_eval_end:} +% Primitives. % \begin{macrocode} \cs_new_eq:NN \if_dim:w \tex_ifdim:D +\cs_set_eq:NN \dim_value:w \tex_number:D +\cs_set_eq:NN \dim_eval:w \etex_dimexpr:D +\cs_set_protected:Npn \dim_eval_end: {\tex_relax:D} % \end{macrocode} % \end{macro} % @@ -1055,15 +1058,7 @@ % % \begin{macro}{\dim_compare_p:n} % \begin{macro}[TF]{\dim_compare:n} -% [This code plus comments lifted directly from the |\intexpr_compare:nTF| function.] -% Some things we need for the code below. -% TODO: normalise names and things. -% \begin{macrocode} -\cs_set_eq:NN \dim_value:w \tex_number:D -\cs_set_eq:NN \dim_eval:w \etex_dimexpr:D -\cs_set_eq:NN \if_dim_compare:w \if_dim:w -\cs_set_eq:NN \dim_eval_end: \scan_stop: -% \end{macrocode} +% [This code plus comments lifted directly from the |\int_compare:nTF| function.] % Comparison tests using a simple syntax where only one set of braces % is required and additional operators such as "!=" and ">=" are % supported. First some notes on the idea behind this. We wish to @@ -1115,7 +1110,7 @@ % Equality is easy: % \begin{macrocode} \cs_new:cpn {dim_compare_=:w} #1 = #2 \q_stop { - \if_dim_compare:w #1 sp = \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp = \dim_eval:w #2 \dim_eval_end: \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} @@ -1123,25 +1118,25 @@ % parameter text. % \begin{macrocode} \cs_new:cpn {dim_compare_==:w} #1 == #2 \q_stop { - \if_dim_compare:w #1 sp = \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp = \dim_eval:w #2 \dim_eval_end: \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} % Not equal is just about reversing the truth value. % \begin{macrocode} \cs_new:cpn {dim_compare_!=:w} #1 != #2 \q_stop { - \if_dim_compare:w #1 sp = \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp = \dim_eval:w #2 \dim_eval_end: \prg_return_false: \else: \prg_return_true: \fi: } % \end{macrocode} % Less than and greater than are also straight forward. % \begin{macrocode} \cs_new:cpn {dim_compare_<:w} #1 < #2 \q_stop { - \if_dim_compare:w #1 sp < \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp < \dim_eval:w #2 \dim_eval_end: \prg_return_true: \else: \prg_return_false: \fi: } \cs_new:cpn {dim_compare_>:w} #1 > #2 \q_stop { - \if_dim_compare:w #1 sp > \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp > \dim_eval:w #2 \dim_eval_end: \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} @@ -1149,11 +1144,11 @@ % than operation. Vice versa for less than or equal. % \begin{macrocode} \cs_new:cpn {dim_compare_<=:w} #1 <= #2 \q_stop { - \if_dim_compare:w #1 sp > \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp > \dim_eval:w #2 \dim_eval_end: \prg_return_false: \else: \prg_return_true: \fi: } \cs_new:cpn {dim_compare_>=:w} #1 >= #2 \q_stop { - \if_dim_compare:w #1 sp < \dim_eval:w #2 \dim_eval_end: + \if_dim:w #1 sp < \dim_eval:w #2 \dim_eval_end: \prg_return_false: \else: \prg_return_true: \fi: } % \end{macrocode} |