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 | 81 |
1 files changed, 61 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index 15227cc22ae..ff05d8a2260 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2019-05-09} +% \date{Released 2019-05-28} % % \maketitle % @@ -96,6 +96,7 @@ % \c_@@_prec_hatii_int, % \c_@@_prec_hat_int, % \c_@@_prec_not_int, +% \c_@@_prec_juxt_int, % \c_@@_prec_times_int, % \c_@@_prec_plus_int, % \c_@@_prec_comp_int, @@ -118,7 +119,8 @@ % \item[16] Function calls. % \item[13/14] Binary |**| and~|^| (right to left). % \item[12] Unary |+|, |-|, |!| (right to left). -% \item[10] Binary |*|, |/|, and juxtaposition (implicit~|*|). +% \item[11] Juxtaposition (implicit~|*|) with no parenthesis. +% \item[10] Binary |*| and~|/|. % \item[9] Binary |+| and~|-|. % \item[7] Comparisons. % \item[6] Logical \texttt{and}, denoted by~|&&|. @@ -134,6 +136,7 @@ \int_const:Nn \c_@@_prec_hatii_int { 14 } \int_const:Nn \c_@@_prec_hat_int { 13 } \int_const:Nn \c_@@_prec_not_int { 12 } +\int_const:Nn \c_@@_prec_juxt_int { 11 } \int_const:Nn \c_@@_prec_times_int { 10 } \int_const:Nn \c_@@_prec_plus_int { 9 } \int_const:Nn \c_@@_prec_comp_int { 7 } @@ -1946,7 +1949,7 @@ { \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_stop \exp_not:N \exp_after:wN - \exp_not:N \@@_parse_infix:NN + \exp_not:N \@@_parse_infix_after_paren:NN \exp_not:N \exp_after:wN #1 \exp_not:N \exp:w \exp_not:N \@@_parse_expand:w @@ -1981,7 +1984,7 @@ \fi: \exp_end_continue_f:w \fi: - \@@_parse_infix:NN #1 ) + \@@_parse_infix_after_paren:NN #1 ) } % \end{macrocode} % \end{macro} @@ -2268,7 +2271,7 @@ \exp_after:wN \@@_parse_infix_mark:NNN \else: \exp_after:wN \exp_after:wN - \exp_after:wN \@@_parse_infix_mul:N + \exp_after:wN \@@_parse_infix_juxt:N \fi: \else: \if_int_compare:w @@ -2276,7 +2279,7 @@ ( `#2 \if_int_compare:w `#2 > `Z - 32 \fi: ) / 26 = 3 \exp_stop_f: \exp_after:wN \exp_after:wN - \exp_after:wN \@@_parse_infix_mul:N + \exp_after:wN \@@_parse_infix_juxt:N \else: \exp_after:wN \@@_parse_infix_check:NNN \cs:w @@ -2288,22 +2291,57 @@ #1 #2 } -\cs_new:Npx \@@_parse_infix_check:NNN #1#2#3 +\cs_new:Npn \@@_parse_infix_check:NNN #1#2#3 { - \exp_not:N \if_meaning:w \scan_stop: #1 - \exp_not:N \__kernel_msg_expandable_error:nnn + \if_meaning:w \scan_stop: #1 + \__kernel_msg_expandable_error:nnn { kernel } { fp-missing } { * } - \exp_not:N \exp_after:wN - \exp_not:c { @@_parse_infix_*:N } - \exp_not:N \exp_after:wN #2 - \exp_not:N \exp_after:wN #3 - \exp_not:N \else: - \exp_not:N \exp_after:wN #1 - \exp_not:N \exp_after:wN #2 - \exp_not:N \exp:w - \exp_not:N \exp_after:wN - \exp_not:N \@@_parse_expand:w - \exp_not:N \fi: + \exp_after:wN \@@_parse_infix_mul:N + \exp_after:wN #2 + \exp_after:wN #3 + \else: + \exp_after:wN #1 + \exp_after:wN #2 + \exp:w \exp_after:wN \@@_parse_expand:w + \fi: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_parse_infix_after_paren:NN} +% Variant of \cs{@@_parse_infix:NN} for use after a closing +% parenthesis. The only difference is that \cs{@@_parse_infix_juxt:N} +% is replaced by \cs{@@_parse_infix_mul:N}. +% \begin{macrocode} +\cs_new:Npn \@@_parse_infix_after_paren:NN #1 #2 + { + \if_catcode:w \scan_stop: \exp_not:N #2 + \if_int_compare:w + \@@_str_if_eq:nn { \s_@@_mark } { \exp_not:N #2 } + = 0 \exp_stop_f: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mark:NNN + \else: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mul:N + \fi: + \else: + \if_int_compare:w + \@@_int_eval:w + ( `#2 \if_int_compare:w `#2 > `Z - 32 \fi: ) / 26 + = 3 \exp_stop_f: + \exp_after:wN \exp_after:wN + \exp_after:wN \@@_parse_infix_mul:N + \else: + \exp_after:wN \@@_parse_infix_check:NNN + \cs:w + @@_parse_infix_ \token_to_str:N #2 :N + \exp_after:wN \exp_after:wN \exp_after:wN + \cs_end: + \fi: + \fi: + #1 + #2 } % \end{macrocode} % \end{macro} @@ -2411,6 +2449,7 @@ % \begin{macro}[EXP] % { % \@@_parse_infix_+:N, \@@_parse_infix_-:N, +% \@@_parse_infix_juxt:N, % \@@_parse_infix_/:N, \@@_parse_infix_mul:N, % \@@_parse_infix_and:N, \@@_parse_infix_or:N, % } @@ -2442,6 +2481,8 @@ } \exp_args:Nc \@@_tmp:w { @@_parse_infix_^:N } ^ \c_@@_prec_hatii_int \c_@@_prec_hat_int +\exp_args:Nc \@@_tmp:w { @@_parse_infix_juxt:N } * + \c_@@_prec_juxt_int \c_@@_prec_juxt_int \exp_args:Nc \@@_tmp:w { @@_parse_infix_/:N } / \c_@@_prec_times_int \c_@@_prec_times_int \exp_args:Nc \@@_tmp:w { @@_parse_infix_mul:N } * |