diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-05 22:58:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-05 22:58:18 +0000 |
commit | c556c94cbf233fa607dc3ac6a664f23efba92c07 (patch) | |
tree | fd6e97db5854a06159dea563eff175ea9e588a7c /Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx | |
parent | e5a6b18348ead0cec45f680a2bacf024120cfdec (diff) |
latex3
git-svn-id: svn://tug.org/texlive/trunk@27600 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index bb9c792adff..c49e3248edd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -36,7 +36,7 @@ % %<*driver> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp-parse.dtx 4159 2012-08-29 13:21:59Z bruno $ +\GetIdInfo$Id: l3fp-parse.dtx 4187 2012-09-02 15:57:09Z bruno $ {L3 Floating-point expression parsing} \documentclass[full]{l3doc} \begin{document} @@ -956,42 +956,45 @@ % \begin{macro}[aux, EXP] % { % \@@_parse_operand_relax:NN, -% \@@_exp_after_mark_f:nw, -% \@@_exp_after_?_f:nw +% \@@_parse_exp_after_f:nw, +% \@@_parse_exp_after_mark_f:nw, +% \@@_parse_exp_after_?_f:nw % } % The second argument is a control sequence equal to \cs{tex_relax:D}. % There are three cases, dispatched using \cs{@@_type_from_scan:N}. % \begin{itemize} % \item \cs{s_@@} starts a floating point number, and we call -% \cs{@@_exp_after_f:nw}. +% \cs{@@_parse_exp_after_f:nw}, which |f|-expands after the +% floating point. % \item \cs{s_@@_mark} is a premature end, we call -% \cs{@@_exp_after_mark_f:nw}, which triggers the appropriate -% error. +% \cs{@@_parse_exp_after_mark_f:nw}, which triggers the +% appropriate error. % \item For a control sequence not containing |\s__fp|, we call -% \cs{@@_exp_after_?_f:nw}, causing a |bad-variable| error. +% \cs{@@_parse_exp_after_?_f:nw}, causing a |bad-variable| error. % \end{itemize} % This scheme is extensible: additional types can be added by starting % the variables with a scan mark of the form |\s__fp_|\meta{type} and -% defining |\__fp_exp_after_|\meta{type}|_f:nw|. In all cases, we +% defining |\__fp_parse_exp_after_|\meta{type}|_f:nw|. In all cases, we % make sure that the last argument of \cs{@@_parse_infix:NN} is % correctly expanded. % \begin{macrocode} \cs_new:Npn \@@_parse_operand_relax:NN #1#2 { - \cs:w @@_exp_after \@@_type_from_scan:N #2 _f:nw \cs_end: + \cs:w @@_parse_exp_after \@@_type_from_scan:N #2 _f:nw \cs_end: { \exp_after:wN \@@_parse_infix:NN \exp_after:wN #1 \tex_romannumeral:D \@@_parse_expand:w } #2 } -\cs_new:Npn \@@_exp_after_mark_f:nw #1 +\cs_new_eq:NN \@@_parse_exp_after_f:nw \@@_exp_after_f:nw +\cs_new:Npn \@@_parse_exp_after_mark_f:nw #1 { \__msg_kernel_expandable_error:nn { kernel } { fp-early-end } \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 #1 } -\cs_new:cpn { @@_exp_after_?_f:nw } #1#2 +\cs_new:cpn { @@_parse_exp_after_?_f:nw } #1#2 { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2} @@ -1692,8 +1695,6 @@ % \end{macro} % % ^^A begin[todo] -% ^^A todo: \@@_sin:Nn should first _set, then \@@_sin_o:w, -% ^^A both for speed, and error reporting. % ^^A todo: word 'e' == 'invalid syntax', word 'E' == "use 'e' instead" % % \subsubsection{Beyond 16 digits: rounding} @@ -1897,7 +1898,7 @@ \tex_romannumeral:D } \cs_new:Npn \@@_parse_until_test:NwN #1 #2 @ #3 { #3 #1 #2 @ } -\cs_new:Npn \@@_parse_stop_until:N #1 { } +\cs_new_eq:NN \@@_parse_stop_until:N \use_none:n % \end{macrocode} % \end{macro} % \end{macro} @@ -1990,7 +1991,10 @@ % \end{macro} % % \begin{macro}[int, EXP]{\@@_parse_apply_binary:NwNwN} -% +% Receives \meta{precedence} \meta{operand_1} |@| \meta{operation} +% \meta{operand_2} |@| \meta{infix command}. Builds the appropriate +% call to the \meta{operation} |#4|, given the types of the two +% \meta{operands}. % \begin{macrocode} \cs_new:Npn \@@_parse_apply_binary:NwNwN #1 #2#3@ #4 #5#6@ #7 { @@ -2012,7 +2016,7 @@ % % \begin{macro}[int, EXP] % {\@@_parse_apply_unary_array:NNwN, \@@_parse_apply_unary:NNwN} -% Here, |#2| is \emph{e.g.}, \cs{@@_neg_o:w}, and expands once after the +% Here, |#2| is \emph{e.g.}, \cs{@@_sin_o:w}, and expands once after the % calculation.\footnote{Bruno: explain.} The argument |#3| may be an % array, so either we map through all its items, or we feed all items % at once to the custom function. @@ -2171,7 +2175,7 @@ { #2 #1 #3 \@@_parse_expand:w } \cs_new:Npn \@@_parse_apply_round:NNwN #1#2#3@#4 { - \if_case:w \__int_eval:w \@@_array_count:w #3@ - \c_one \__int_eval_end: + \if_case:w \__int_eval:w \@@_array_count:n {#3} - \c_one \__int_eval_end: \@@_round:Nwn #2 #3 {0} \tex_romannumeral:D \or: \@@_round:Nww #2 #3 \tex_romannumeral:D \else: @@ -2213,8 +2217,8 @@ \@@_parse_expand:w } } -\@@_tmp:w - { neg } -\@@_tmp:w ! { not } +\@@_tmp:w - { - } +\@@_tmp:w ! { ! } % \end{macrocode} % \end{macro} % @@ -2254,18 +2258,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}[int, EXP]{\@@_exp_after_array_f:w} -% \begin{macrocode} -\cs_new:Npn \@@_exp_after_array_f:w #1 - { - \cs:w @@_exp_after \@@_type_from_scan:N #1 _f:nw \cs_end: - { \@@_exp_after_array_f:w } - #1 - } -\cs_new:Npn \@@_exp_after_stop_f:nw #1#2 { } -% \end{macrocode} -% \end{macro} -% % \begin{macro}[int]{\@@_parse_prefix_.:Nw} % This function is called when a number starts with a dot. % \begin{macrocode} |