diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx | 113 |
1 files changed, 3 insertions, 110 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 9a0f8a233f6..dd473d12422 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -38,7 +38,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2018-04-30} +% \date{Released 2018-05-12} % % \maketitle % @@ -496,14 +496,14 @@ % \item If the next token is a control sequence, it could be the % special marker \cs{s_@@_mark}, and % otherwise it is a case of juxtaposing numbers, such as -% |2\c_zero|, with an implied multiplication. +% |2\c_zero_int|, with an implied multiplication. % \item If the next token is a letter, it is also a case of % juxtaposition, as letters cannot be proper infix operators. % \item Otherwise (including in the case of digits), if the token is a % known infix operator, the appropriate % |\__fp_infix_|\meta{operator}|:N| function is built, and if it % does not exist, we complain. In particular, the juxtaposition -% |\c_zero 2| is disallowed. +% |\c_zero_int 2| is disallowed. % \end{itemize} % % In the above, we need to test whether a character token~|#1| is a @@ -2812,113 +2812,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Candidate: defining new \pkg{l3fp} functions} -% -% \begin{macro}[EXP]{\fp_function:Nw} -% Parse the argument of the function~|#1| using -% \cs{@@_parse_operand:Nw} with a precedence of~$16$, and pass the -% function and argument to \cs{@@_function_apply:nw}. -% \begin{macrocode} -\cs_new:Npn \fp_function:Nw #1 - { - \exp_after:wN \@@_function_apply:nw - \exp_after:wN #1 - \exp:w - \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\fp_new_function:Npn} -% \begin{macro}{\@@_new_function:NNnnn, \@@_new_function:Ncfnn} -% \begin{macro}{\@@_function_args:Nwn} -% Save the code provided by the user in the control sequence -% |\__fp_user_#1|. Define |#1| to call \cs{@@_function_apply:nw} -% after parsing one operand using \cs{@@_parse_operand:Nw} with -% precedence~$16$. The auxiliary \cs{@@_function_args:Nwn} receives -% the user function and the number of arguments (half of the number of -% tokens in the parameter text~|#2|), followed by the operand (as a -% token list of floating points). It checks the number of arguments, -% and applies the user function to the arguments (without the outer -% brace group). -% \begin{macrocode} -\cs_new_protected:Npn \fp_new_function:Npn #1#2# - { - \@@_new_function:Ncfnn #1 - { @@_user_ \cs_to_str:N #1 } - { \int_eval:n { \tl_count:n {#2} / 2 } } - {#2} - } -\cs_new_protected:Npn \@@_new_function:NNnnn #1#2#3#4#5 - { - \cs_new:Npn #1 - { - \exp_after:wN \@@_function_apply:nw \exp_after:wN - { - \exp_after:wN \@@_function_args:Nwn - \exp_after:wN #2 - \int_value:w #3 \exp_after:wN ; \exp_after:wN - } - \exp:w - \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w - } - \cs_new:Npn #2 #4 {#5} - } -\cs_generate_variant:Nn \@@_new_function:NNnnn { Ncf } -\cs_new:Npn \@@_function_args:Nwn #1#2; #3 - { - \int_compare:nNnTF { \tl_count:n {#3} } = {#2} - { #1 #3 } - { - \__kernel_msg_expandable_error:nnnnn - { kernel } { fp-num-args } { #1() } {#2} {#2} - \c_nan_fp - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_function_apply:nw, -% \@@_function_store:wwNwnn, -% \@@_function_store_end:wnnn -% } -% The auxiliary \cs{@@_function_apply:nw} is called after parsing an -% operand, so it receives some code~|#1|, then the operand ending -% with~|@|, then a function such as \cs{@@_parse_infix_+:N} (but not -% always of this form, see comparisons for instance). Package the -% operand (an array) into a token list with floating point items: this -% is the role of \cs{@@_function_store:wwNwnn} and -% \cs{@@_function_store_end:wnnn}. Then apply \cs{@@_parse:n} to the -% code~|#1| followed by a brace group with this token list. This -% results in a floating point result, which is then correctly parsed -% as the next operand of whatever was looking for one. The trailing -% \cs{s_@@_mark} is used as a special infix operator to indicate that -% the next token has already gone through \cs{@@_parse_infix:NN}. -% \begin{macrocode} -\cs_new:Npn \@@_function_apply:nw #1#2 @ - { - \@@_parse:n - { - \@@_function_store:wwNwnn #2 - \s_@@_mark \@@_function_store:wwNwnn ; - \s_@@_mark \@@_function_store_end:wnnn - \s_@@_stop { } { } {#1} - } - \s_@@_mark - } -\cs_new:Npn \@@_function_store:wwNwnn - #1; #2 \s_@@_mark #3#4 \s_@@_stop #5#6 - { #3 #2 \s_@@_mark #3#4 \s_@@_stop { #5 #6 } { { #1; } } } -\cs_new:Npn \@@_function_store_end:wnnn - #1 \s_@@_stop #2#3#4 - { #4 {#2} } -% \end{macrocode} -% \end{macro} -% % ^^A end[todo] % % \subsection{Messages} |