diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-16 22:41:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-16 22:41:08 +0000 |
commit | ca1c73f9a8de69e467230c4a57ccf8b07cd275a9 (patch) | |
tree | 6272657307f73c14327d6b8bce5d6b7ff97c3f66 /Master/texmf-dist/tex | |
parent | 22c251adda514ed7b453066de05b2f89707d0fe6 (diff) |
finish l3 update
git-svn-id: svn://tug.org/texlive/trunk@27427 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
28 files changed, 2071 insertions, 1971 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 7b8c68154f9..6adfc5fed60 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -60,8 +60,8 @@ } \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2012/07/16} -\def\ExplFileVersion{3990} +\def\ExplFileDate{2012/08/14} +\def\ExplFileVersion{4091} \RequirePackage{etex} \reserveinserts{32} \ProvidesExplPackage @@ -88,37 +88,58 @@ { \token_to_str:N #1 } } } - \cs_set_protected:Npn \tl_set:Nn #1#2 + \cs_set_protected:Npn \__cs_tmp:w #1 { - \__cs_check_exists:N #1 - \cs_set_nopar:Npx #1 { \exp_not:n {#2} } - } - \cs_set_protected:Npn \tl_set:Nx #1#2 - { - \__cs_check_exists:N #1 - \cs_set_nopar:Npx #1 {#2} + \if_meaning:w ? #1 + \exp_after:wN \use_none_delimit_by_q_recursion_stop:w + \fi: + \use:x + { + \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 } + { + \__cs_check_exists:N \exp_not:n {##1} + \exp_not:o { #1 {##1} {##2} } + } + } + \__cs_tmp:w } - \cs_set_protected:Npn \tl_gset:Nn #1#2 + \__cs_tmp:w + \tl_set:Nn \tl_set:No \tl_set:Nx + \tl_gset:Nn \tl_gset:No \tl_gset:Nx + \tl_put_left:Nn \tl_put_left:NV + \tl_put_left:No \tl_put_left:Nx + \tl_gput_left:Nn \tl_gput_left:NV + \tl_gput_left:No \tl_gput_left:Nx + \tl_put_right:Nn \tl_put_right:NV + \tl_put_right:No \tl_put_right:Nx + \tl_gput_right:Nn \tl_gput_right:NV + \tl_gput_right:No \tl_gput_right:Nx + ? \q_recursion_stop + \cs_set_protected:Npn \tl_set_eq:NN #1#2 { \__cs_check_exists:N #1 - \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } + \__cs_check_exists:N #2 + \cs_set_eq:NN #1 #2 } - \cs_set_protected:Npn \tl_gset:Nx #1#2 + \cs_set_protected:Npn \tl_gset_eq:NN #1#2 { \__cs_check_exists:N #1 - \cs_gset_nopar:Npx #1 {#2} + \__cs_check_exists:N #2 + \cs_gset_eq:NN #1 #2 } - \cs_set_protected:Npn \tl_set_eq:NN #1#2 + \cs_set_protected:Npn \tl_concat:NNN #1#2#3 { \__cs_check_exists:N #1 \__cs_check_exists:N #2 - \cs_set_eq:NN #1 #2 + \__cs_check_exists:N #3 + \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } } - \cs_set_protected:Npn \tl_gset_eq:NN #1#2 + \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3 { \__cs_check_exists:N #1 \__cs_check_exists:N #2 - \cs_gset_eq:NN #1 #2 + \__cs_check_exists:N #3 + \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } } \fi \RequirePackage { l3seq, l3int, l3quark, l3prg } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty index 6b6c8e90276..c7c5bcb0eb8 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3basics.dtx 3987 2012-07-15 21:57:39Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3basics.dtx 4069 2012-08-08 23:12:57Z bruno $ {L3 Basic definitions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -94,6 +94,7 @@ { \exp_args:Nc \cs_meaning:N {#1} } { \tl_to_str:n {undefined} } } +\tex_let:D \token_to_meaning:c = \cs_meaning:c \etex_protected:D \tex_def:D \cs_show:c { \group_begin: \exp_args:NNc \group_end: \cs_show:N } \tex_let:D \c_minus_one \m@ne @@ -135,6 +136,7 @@ { \etex_protected:D \tex_long:D \cs_gset_nopar:Npn } \cs_set_protected_nopar:Npn \cs_gset_protected:Npx { \etex_protected:D \tex_long:D \cs_gset_nopar:Npx } +\cs_set_nopar:Npn \l__exp_internal_tl { } \cs_set:Npn \use:c #1 { \cs:w #1 \cs_end: } \cs_set_protected:Npn \use:x #1 { @@ -214,30 +216,31 @@ } \cs_set_protected:Npn \__prg_generate_conditional:nnNnnnnn #1#2#3#4#5#6#7#8 { - \if_meaning:w \c_true_bool #3 - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { - \__prg_generate_conditional:nnnnnnw - {#4} {#5} {#1} {#2} {#6} {#8} - #7 , , \q_recursion_stop - } - { + \if_meaning:w \c_false_bool #3 \__msg_kernel_error:nnx { kernel } { missing-colon } { \token_to_str:c {#1} } - } + \exp_after:wN \use_none:nn + \fi: + \use:x + { + \exp_not:N \__prg_generate_conditional:nnnnnnw + \exp_not:n { {#4} {#5} {#1} {#2} {#6} {#8} } + \etex_detokenize:D {#7} + \exp_not:n { , \q_recursion_tail , \q_recursion_stop } + } } \cs_set_protected:Npn \__prg_generate_conditional:nnnnnnw #1#2#3#4#5#6#7 , { - \if_catcode:w \scan_stop: \etex_detokenize:D {#7} \scan_stop: + \if_meaning:w \q_recursion_tail #7 \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: - \use:c { __prg_generate_ \etex_detokenize:D {#7} _form:wnnnnnn } - \__msg_kernel_error:nnxx - { kernel } { conditional-form-unknown } - { \tl_to_str:n {#7} } { \token_to_str:c { #3 : #4 } } + \use:c { __prg_generate_ #7 _form:wnnnnnn } + \tl_if_empty:nF {#7} + { + \__msg_kernel_error:nnxx + { kernel } { conditional-form-unknown } + {#7} { \token_to_str:c { #3 : #4 } } + } \use_none:nnnnnnn \q_stop {#1} {#2} {#3} {#4} {#5} {#6} @@ -274,21 +277,21 @@ \exp_args:Nc \exp_args:Nc { cs_ #2 #3 :Npn } { #4 : #5 TF } #6 { #7 \c_zero } } -\cs_set_protected:Npn \prg_set_eq_conditional:NNn #1#2 - { - \__cs_split_function:NN #2 \__prg_set_eq_conditional:nnNNNn - \cs_set_eq:cc #1 - } -\cs_set_protected:Npn \prg_new_eq_conditional:NNn #1#2 +\cs_set_protected_nopar:Npn \prg_set_eq_conditional:NNn + { \__prg_set_eq_conditional:NNNn \cs_set_eq:cc } +\cs_set_protected_nopar:Npn \prg_new_eq_conditional:NNn + { \__prg_set_eq_conditional:NNNn \cs_new_eq:cc } +\cs_set_protected:Npn \__prg_set_eq_conditional:NNNn #1#2#3#4 { - \__cs_split_function:NN #2 \__prg_set_eq_conditional:nnNNNn - \cs_new_eq:cc #1 - } -\cs_set_protected:Npn \__prg_set_eq_conditional:nnNNNn #1#2#3#4#5#6 - { - \__cs_split_function:NN #5 \__prg_set_eq_conditional:nnNnnNNw - {#1} {#2} #3 #4 - #6 , \scan_stop: , \q_recursion_stop + \use:x + { + \exp_not:N \__prg_set_eq_conditional:nnNnnNNw + \__cs_split_function:NN #2 \prg_do_nothing: + \__cs_split_function:NN #3 \prg_do_nothing: + \exp_not:N #1 + \etex_detokenize:D {#4} + \exp_not:n { , \q_recursion_tail , \q_recursion_stop } + } } \cs_set_protected:Npn \__prg_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6 { @@ -306,29 +309,41 @@ } \cs_set_protected:Npn \__prg_set_eq_conditional_loop:nnnnNw #1#2#3#4#5#6 , { - \if_meaning:w \scan_stop: #6 \scan_stop: + \if_meaning:w \q_recursion_tail #6 \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \fi: - \cs_if_exist:cTF - { \use:c { __prg_conditional_ #6 _form:nn } {#3} {#4} } - { - #5 - { \use:c { __prg_conditional_ #6 _form:nn } {#1} {#2} } - { \use:c { __prg_conditional_ #6 _form:nn } {#3} {#4} } - } - { - \__msg_kernel_error:nnx { kernel } { command-not-defined } + \use:c { __prg_set_eq_conditional_ #6 _form:wNnnnn } + \tl_if_empty:nF {#6} { - \token_to_str:c - { \use:c { __prg_conditional_ #6 _form:nn } {#3} {#4} } + \__msg_kernel_error:nnxx + { kernel } { conditional-form-unknown } + {#6} { \token_to_str:c { #1 : #2 } } } - } + \use_none:nnnnnn + \q_stop + #5 {#1} {#2} {#3} {#4} \__prg_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5 } -\cs_set:Npn \__prg_conditional_p_form:nn #1#2 { #1 _p : #2 } -\cs_set:Npn \__prg_conditional_TF_form:nn #1#2 { #1 : #2 TF } -\cs_set:Npn \__prg_conditional_T_form:nn #1#2 { #1 : #2 T } -\cs_set:Npn \__prg_conditional_F_form:nn #1#2 { #1 : #2 F } +\cs_set:Npn \__prg_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6 + { + \__chk_if_exist_cs:c { #5 _p : #6 } + #2 { #3 _p : #4 } { #5 _p : #6 } + } +\cs_set:Npn \__prg_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6 + { + \__chk_if_exist_cs:c { #5 : #6 TF } + #2 { #3 : #4 TF } { #5 : #6 TF } + } +\cs_set:Npn \__prg_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6 + { + \__chk_if_exist_cs:c { #5 : #6 T } + #2 { #3 : #4 T } { #5 : #6 T } + } +\cs_set:Npn \__prg_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6 + { + \__chk_if_exist_cs:c { #5 : #6 F } + #2 { #3 : #4 F } { #5 : #6 F } + } \tex_chardef:D \c_true_bool = 1 ~ \tex_chardef:D \c_false_bool = 0 ~ \cs_set_nopar:Npn \cs_to_str:N @@ -808,6 +823,9 @@ \fi: \__prg_map_break:Nn #1 {#2} } +\cs_new_eq:NN \__prg_break_point: \prg_do_nothing: +\cs_new:Npn \__prg_break: #1 \__prg_break_point: { } +\cs_new:Npn \__prg_break:n #1#2 \__prg_break_point: {#1} \cs_new_eq:NN \str_if_eq_p:xx \str_if_eq_x_p:nn \cs_new_eq:NN \str_if_eq:xxT \str_if_eq_x:nnT \cs_new_eq:NN \str_if_eq:xxF \str_if_eq_x:nnF diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty b/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty index 8a260b26410..263ab7bf875 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty @@ -102,7 +102,7 @@ {% \def\ExplFileDate{#1/#2/#3}% } -\GetIdInfo$Id: l3bootstrap.dtx 3986 2012-07-15 19:23:51Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Bootstrap code} \ProvidesPackage{l3bootstrap} [% @@ -169,10 +169,24 @@ \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 1 \relax } \expandafter\chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0 \relax -\protected\def\ProvidesExplPackage#1#2#3#4% +\protected\def\ProvidesExplPackage {% - \ProvidesPackage{#1}[#2 v#3 #4]% - \ExplSyntaxOn + \@ifpackageloaded{expl3} + {} + {% + \PackageError{expl3} + {Cannot load the expl3 modules separately} + {% + The expl3 modules cannot be loaded separately;\MessageBreak + please \string\usepackage\string{expl3\string} instead.% + }% + }% + \protected\def\ProvidesExplPackage##1##2##3##4% + {% + \ProvidesPackage{##1}[##2 v##3 ##4]% + \ExplSyntaxOn + }% + \ProvidesExplPackage } \protected\def\ProvidesExplClass#1#2#3#4% {% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty index 7e275624379..c1da395227b 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3box.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3box.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Experimental boxes} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty b/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty index 1a867d3501c..6ee3e3a018b 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{l3names} +\RequirePackage{l3bootstrap} \GetIdInfo$Id: l3candidates.dtx 3633 2012-05-12 20:11:32Z joseph $ {L3 Experimental additions to l3kernel} \ProvidesExplPackage @@ -201,22 +201,11 @@ \cs_generate_variant:Nn \box_resize:Nnn { c } \cs_new_protected:Npn \__box_resize:Nnn #1#2#3 { - \dim_compare:nNnTF {#2} > \c_zero_dim - { \dim_set:Nn \l__box_right_new_dim {#2} } - { \dim_set:Nn \l__box_right_new_dim { \c_zero_dim - ( #2 ) } } - \dim_compare:nNnTF {#3} > \c_zero_dim - { - \dim_set:Nn \l__box_top_new_dim - { \fp_use:N \l__box_scale_y_fp \l__box_top_dim } - \dim_set:Nn \l__box_bottom_new_dim - { \fp_use:N \l__box_scale_y_fp \l__box_bottom_dim } - } - { - \dim_set:Nn \l__box_top_new_dim - { - \fp_use:N \l__box_scale_y_fp \l__box_top_dim } - \dim_set:Nn \l__box_bottom_new_dim - { - \fp_use:N \l__box_scale_y_fp \l__box_bottom_dim } - } + \dim_set:Nn \l__box_right_new_dim { \dim_abs:n {#2} } + \dim_set:Nn \l__box_bottom_new_dim + { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim } + \dim_set:Nn \l__box_top_new_dim + { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim } \__box_resize_common:N #1 } \cs_new_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2 @@ -267,27 +256,17 @@ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 } \dim_set:Nn \l__box_right_dim { \box_wd:N #1 } \dim_zero:N \l__box_left_dim - \__box_scale:Nnn #1 {#2} {#3} + \dim_set:Nn \l__box_top_new_dim + { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim } + \dim_set:Nn \l__box_bottom_new_dim + { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim } + \dim_set:Nn \l__box_right_new_dim + { \fp_abs:n { \l__box_scale_x_fp } \l__box_right_dim } + \__box_resize_common:N #1 \group_end: } } \cs_generate_variant:Nn \box_scale:Nnn { c } -\cs_new_protected:Npn \__box_scale:Nnn #1#2#3 - { - \fp_compare:nNnTF \l__box_scale_y_fp > \c_zero_fp - { - \dim_set:Nn \l__box_top_new_dim { #3 \l__box_top_dim } - \dim_set:Nn \l__box_bottom_new_dim { #3 \l__box_bottom_dim } - } - { - \dim_set:Nn \l__box_top_new_dim { -#3 \l__box_bottom_dim } - \dim_set:Nn \l__box_bottom_new_dim { -#3 \l__box_top_dim } - } - \fp_compare:nNnTF \l__box_scale_x_fp > \c_zero_fp - { \l__box_right_new_dim #2 \l__box_right_dim } - { \l__box_right_new_dim -#2 \l__box_right_dim } - \__box_resize_common:N #1 - } \cs_new_protected:Npn \__box_resize_common:N #1 { \hbox_set:Nn \l__box_internal_box @@ -635,12 +614,13 @@ \dim_new:N \l__coffin_scaled_width_dim \cs_new_protected:Npn \coffin_resize:Nnn #1#2#3 { - \__coffin_set_user_dimensions:N #1 - \box_resize:Nnn #1 {#2} {#3} \fp_set:Nn \l__coffin_scale_x_fp - { \dim_to_fp:n {#2} / \dim_to_fp:n \Width } + { \dim_to_fp:n {#2} / \dim_to_fp:n { \coffin_wd:N #1 } } \fp_set:Nn \l__coffin_scale_y_fp - { \dim_to_fp:n {#3} / \dim_to_fp:n \TotalHeight } + { + \dim_to_fp:n {#3} / \dim_to_fp:n { \coffin_ht:N #1 + \coffin_dp:N #1 } + } + \box_resize:Nnn #1 {#2} {#3} \__coffin_resize_common:Nnn #1 {#2} {#3} } \cs_generate_variant:Nn \coffin_resize:Nnn { c } @@ -657,20 +637,18 @@ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop } { \__coffin_x_shift_pole:Nnnnnn #1 {##1} ##2 } } - \__coffin_end_user_dimensions: } \cs_new_protected:Npn \coffin_scale:Nnn #1#2#3 { - \box_scale:Nnn #1 {#2} {#3} - \__coffin_set_user_dimensions:N #1 \fp_set:Nn \l__coffin_scale_x_fp {#2} \fp_set:Nn \l__coffin_scale_y_fp {#3} - \fp_compare:nNnTF \l__coffin_scale_y_fp > \c_zero_fp - { \l__coffin_scaled_total_height_dim #3 \TotalHeight } - { \l__coffin_scaled_total_height_dim -#3 \TotalHeight } - \fp_compare:nNnTF \l__coffin_scale_x_fp > \c_zero_fp - { \l__coffin_scaled_width_dim -#2 \Width } - { \l__coffin_scaled_width_dim #2 \Width } + \box_scale:Nnn #1 { \l__coffin_scale_x_fp } { \l__coffin_scale_y_fp } + \dim_set:Nn \l__coffin_internal_dim + { \coffin_ht:N #1 + \coffin_dp:N #1 } + \dim_set:Nn \l__coffin_scaled_total_height_dim + { \fp_abs:n { \l__coffin_scale_y_fp } \l__coffin_internal_dim } + \dim_set:Nn \l__coffin_scaled_width_dim + { -\fp_abs:n { \l__coffin_scale_x_fp } \coffin_wd:N #1 } \__coffin_resize_common:Nnn #1 { \l__coffin_scaled_width_dim } { \l__coffin_scaled_total_height_dim } } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty index 1f78b1b4851..35d5381e677 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty @@ -47,8 +47,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3clist.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3clist.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Comma separated lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty b/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty index 75927ce708b..a126e8fd5c4 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty @@ -46,8 +46,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{l3names} -\GetIdInfo$Id: l3coffins.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3coffins.dtx 4011 2012-07-20 21:02:59Z joseph $ {L3 Coffin code layer} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -83,14 +83,6 @@ \dim_new:N \l__coffin_y_dim \dim_new:N \l__coffin_x_prime_dim \dim_new:N \l__coffin_y_prime_dim -\dim_new:N \l__coffin_Depth_dim -\dim_new:N \l__coffin_Height_dim -\dim_new:N \l__coffin_TotalHeight_dim -\dim_new:N \l__coffin_Width_dim -\cs_new_nopar:Npn \__coffin_saved_Depth: { } -\cs_new_nopar:Npn \__coffin_saved_Height: { } -\cs_new_nopar:Npn \__coffin_saved_TotalHeight: { } -\cs_new_nopar:Npn \__coffin_saved_Width: { } \prg_new_conditional:Npnn \coffin_if_exist:N #1 { p , T , F , TF } { \cs_if_exist:NTF #1 @@ -280,52 +272,26 @@ \prop_gset_eq:cc { l__coffin_poles_ \__int_value:w #1 _prop } { l__coffin_poles_ \__int_value:w #2 _prop } } -\cs_new_protected:Npn \__coffin_set_user_dimensions:N #1 - { - \cs_set_eq:NN \__coffin_saved_Height: \Height - \cs_set_eq:NN \__coffin_saved_Depth: \Depth - \cs_set_eq:NN \__coffin_saved_TotalHeight: \TotalHeight - \cs_set_eq:NN \__coffin_saved_Width: \Width - \cs_set_eq:NN \Height \l__coffin_Height_dim - \cs_set_eq:NN \Depth \l__coffin_Depth_dim - \cs_set_eq:NN \TotalHeight \l__coffin_TotalHeight_dim - \cs_set_eq:NN \Width \l__coffin_Width_dim - \dim_set:Nn \Height { \box_ht:N #1 } - \dim_set:Nn \Depth { \box_dp:N #1 } - \dim_set:Nn \TotalHeight { \box_ht:N #1 + \box_dp:N #1 } - \dim_set:Nn \Width { \box_wd:N #1 } - } -\cs_new_protected_nopar:Npn \__coffin_end_user_dimensions: - { - \cs_set_eq:NN \Height \__coffin_saved_Height: - \cs_set_eq:NN \Depth \__coffin_saved_Depth: - \cs_set_eq:NN \TotalHeight \__coffin_saved_TotalHeight: - \cs_set_eq:NN \Width \__coffin_saved_Width: - } \cs_new_protected:Npn \coffin_set_horizontal_pole:Nnn #1#2#3 { \__coffin_if_exist:NT #1 { - \__coffin_set_user_dimensions:N #1 \__coffin_set_pole:Nnx #1 {#2} { { 0 pt } { \dim_eval:n {#3} } { 1000 pt } { 0 pt } } - \__coffin_end_user_dimensions: } } \cs_new_protected:Npn \coffin_set_vertical_pole:Nnn #1#2#3 { \__coffin_if_exist:NT #1 { - \__coffin_set_user_dimensions:N #1 \__coffin_set_pole:Nnx #1 {#2} { { \dim_eval:n {#3} } { 0 pt } { 0 pt } { 1000 pt } } - \__coffin_end_user_dimensions: } } \cs_new_protected:Npn \__coffin_set_pole:Nnn #1#2#3 @@ -639,9 +605,9 @@ } \cs_new_protected:Npn \coffin_typeset:Nnnnn #1#2#3#4#5 { + \hbox_unpack:N \c_empty_box \__coffin_align:NnnNnnnnN \c_empty_coffin { H } { l } #1 {#2} {#3} {#4} {#5} \l__coffin_aligned_coffin - \hbox_unpack:N \c_empty_box \box_use:N \l__coffin_aligned_coffin } \cs_generate_variant:Nn \coffin_typeset:Nnnnn { c } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3color.sty b/Master/texmf-dist/tex/latex/l3kernel/l3color.sty index 5ea45852215..1584c055979 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3color.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3color.sty @@ -46,8 +46,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{l3names} -\GetIdInfo$Id: l3color.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3color.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Experimental colour support} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index c1adee8c71f..111db55e442 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -52,7 +52,7 @@ \let \fileversionOld \ExplFileVersion \let \filedescriptionOld \ExplFileDescription \RequirePackage{expl3,xparse,calc} -\GetIdInfo$Id: l3doc.dtx 3989 2012-07-16 01:15:43Z bruno $ +\GetIdInfo$Id: l3doc.dtx 4070 2012-08-09 11:04:46Z joseph $ {L3 Experimental documentation class} \ProvidesExplClass {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -60,69 +60,63 @@ \let \ExplFileDate \filedateOld \let \ExplFileVersion \fileversionOld \let \ExplFileDescription \filedescriptionOld -\coffin_new:N \l_doc_output_box -\coffin_new:N \l_doc_names_coffin -\coffin_new:N \l_doc_descr_coffin -\coffin_new:N \l_doc_syntax_coffin -\bool_new:N \l_doc_long_name_bool -\bool_new:N \g_doc_implementation_bool -\dim_new:N \l_doc_trial_width_dim -\tl_new:N \l_doc_macro_tl -\int_new:N \l_doc_macro_int -\int_new:N \g_doc_nested_macro_int -\prop_new:N \g_doc_missing_tests_prop +\coffin_new:N \l__codedoc_output_box +\coffin_new:N \l__codedoc_names_coffin +\coffin_new:N \l__codedoc_descr_coffin +\coffin_new:N \l__codedoc_syntax_coffin +\box_new:N \g__codedoc_syntax_box +\bool_new:N \l__codedoc_long_name_bool +\bool_new:N \g__codedoc_implementation_bool +\dim_new:N \l__codedoc_trial_width_dim +\tl_new:N \l__codedoc_macro_tl +\int_new:N \l__codedoc_macro_int +\int_new:N \g__codedoc_nested_macro_int +\int_new:N \g__codedoc_codeline_int +\prop_new:N \g__codedoc_missing_tests_prop \clist_new:N \g_docinput_clist -\seq_new:N \g_doc_testfiles_seq +\tl_new:N \l__codedoc_at_replaced_macro_tl +\seq_new:N \g__codedoc_testfiles_seq \seq_new:N \g_doc_functions_seq \seq_new:N \g_doc_macros_seq -\seq_new:N \g_doc_not_tested_seq -\bool_new:N \l_doc_meta_TF_bool -\bool_new:N \l_doc_meta_pTF_bool -\bool_new:N \l_doc_meta_EXP_bool -\bool_new:N \l_doc_meta_rEXP_bool -\bool_new:N \l_doc_macro_internal_bool -\bool_new:N \l_doc_macro_aux_bool -\bool_new:N \l_doc_macro_TF_bool -\bool_new:N \l_doc_macro_pTF_bool -\bool_new:N \l_doc_macro_var_bool -\bool_new:N \g_doc_full_bool -\bool_new:N \g_doc_lmodern_bool -\bool_new:N \g_doc_checkfunc_bool -\bool_new:N \g_doc_checktest_bool -\seq_new:N \g_doc_tmpa_seq -\tl_new:N \l_doc_tmpa_tl -\tl_new:N \l_doc_tmpb_tl -\int_new:N \l_doc_tmpa_int -\bool_new:N \l_doc_tested_bool -\cs_set_protected_nopar:Npn \coffin_gset_eq:NN #1#2 - { - \coffin_if_exist:NT #1 - { - \box_gset_eq:NN #1 #2 - \__coffin_gset_eq_structure:NN #1 #2 - } - } -\cs_generate_variant:Nn \coffin_gset_eq:NN { c , Nc , cc } +\seq_new:N \g__codedoc_not_tested_seq +\bool_new:N \l__codedoc_meta_TF_bool +\bool_new:N \l__codedoc_meta_pTF_bool +\bool_new:N \l__codedoc_meta_EXP_bool +\bool_new:N \l__codedoc_meta_rEXP_bool +\bool_new:N \l__codedoc_macro_internal_bool +\bool_new:N \l__codedoc_macro_aux_bool +\bool_new:N \l__codedoc_macro_TF_bool +\bool_new:N \l__codedoc_macro_pTF_bool +\bool_new:N \l__codedoc_macro_var_bool +\bool_new:N \g__codedoc_full_bool +\bool_new:N \g__codedoc_lmodern_bool +\bool_new:N \g__codedoc_checkfunc_bool +\bool_new:N \g__codedoc_checktest_bool +\seq_new:N \g__codedoc_tmpa_seq +\tl_new:N \l__codedoc_tmpa_tl +\tl_new:N \l__codedoc_tmpb_tl +\int_new:N \l__codedoc_tmpa_int +\bool_new:N \l__codedoc_tested_bool \DeclareOption{a5paper}{\@latexerr{Option not supported}{}} -\DeclareOption{full}{ \bool_set_true:N \g_doc_full_bool } -\DeclareOption{onlydoc}{ \bool_set_false:N \g_doc_full_bool } -\DeclareOption{check}{ \bool_set_true:N \g_doc_checkfunc_bool } -\DeclareOption{nocheck}{ \bool_set_false:N \g_doc_checkfunc_bool } -\DeclareOption{checktest}{ \bool_set_true:N \g_doc_checktest_bool } -\DeclareOption{nochecktest}{ \bool_set_false:N \g_doc_checktest_bool } -\DeclareOption{cm-default}{ \bool_set_false:N \g_doc_lmodern_bool } -\DeclareOption{lm-default}{ \bool_set_true:N \g_doc_lmodern_bool } +\DeclareOption{full}{ \bool_set_true:N \g__codedoc_full_bool } +\DeclareOption{onlydoc}{ \bool_set_false:N \g__codedoc_full_bool } +\DeclareOption{check}{ \bool_set_true:N \g__codedoc_checkfunc_bool } +\DeclareOption{nocheck}{ \bool_set_false:N \g__codedoc_checkfunc_bool } +\DeclareOption{checktest}{ \bool_set_true:N \g__codedoc_checktest_bool } +\DeclareOption{nochecktest}{ \bool_set_false:N \g__codedoc_checktest_bool } +\DeclareOption{cm-default}{ \bool_set_false:N \g__codedoc_lmodern_bool } +\DeclareOption{lm-default}{ \bool_set_true:N \g__codedoc_lmodern_bool } \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ExecuteOptions{full,a4paper,nocheck,nochecktest,lm-default} \msg_new:nnn {l3doc} {input-cfg} - { - Local~config~file~l3doc.cfg~loaded. - } + { + Local~config~file~l3doc.cfg~loaded. + } \file_if_exist:nT {l3doc.cfg} - { - \file_input:n {l3doc.cfg} - \msg_info:nn {l3doc} {input-cfg} - } + { + \file_input:n {l3doc.cfg} + \msg_info:nn {l3doc} {input-cfg} + } \ProcessOptions \LoadClass{article} \RequirePackage{doc} @@ -135,53 +129,36 @@ color, colortbl, fixltx2e, + hologo, enumitem, pifont, textcomp, trace, underscore, csquotes, - fancyvrb + fancyvrb, + verbatim } \raggedbottom \fvset{gobble=2} \cs_set_eq:NN \verbatim \Verbatim \cs_set_eq:NN \endverbatim \endVerbatim -\bool_if:NT \g_doc_lmodern_bool { +\bool_if:NT \g__codedoc_lmodern_bool + { \RequirePackage[T1]{fontenc} \RequirePackage{lmodern} - \begingroup + \group_begin: \ttfamily \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{} - \endgroup -} + \group_end: + } \RequirePackage{hypdoc} -\let\doc@verbatim\verbatim -\let\enddoc@verbatim\endverbatim -\let\doc@@verbatim\@verbatim -\expandafter\let\csname doc@verbatim*\expandafter\endcsname - \csname verbatim*\endcsname -\expandafter\let\csname enddoc@verbatim*\expandafter\endcsname - \csname endverbatim*\endcsname -\expandafter\let\csname doc@@verbatim*\expandafter\endcsname - \csname @verbatim*\endcsname -\RequirePackage{verbatim} -\AtBeginDocument{% - \let\verbatim\doc@verbatim - \let\endverbatim\enddoc@verbatim - \let\@verbatim\doc@@verbatim - \expandafter\let\csname verbatim*\expandafter\endcsname - \csname doc@verbatim*\endcsname - \expandafter\let\csname endverbatim*\expandafter\endcsname - \csname enddoc@verbatim*\endcsname - \expandafter\let\csname @verbatim*\expandafter\endcsname - \csname doc@@verbatim*\endcsname -} -\cs_set_nopar:Npn \MakePrivateLetters { +\cs_set_nopar:Npn \MakePrivateLetters + { \char_set_catcode_letter:N \@ \char_set_catcode_letter:N \_ \char_set_catcode_letter:N \: -} + } \setcounter{StandardModuleDepth}{1} \@addtoreset{CodelineNo}{part} \tl_replace_once:Nnn \theCodelineNo @@ -191,12 +168,14 @@ \addtolength \marginparwidth { 30pt } \addtolength \oddsidemargin { 20pt } \addtolength \evensidemargin { 20pt } -\cs_set_eq:NN \@@oldlist\list -\cs_set_nopar:Npn \list#1#2{\@@oldlist{#1}{#2\listparindent\z@}} +\cs_set_eq:NN \__codedoc_oldlist:nn \list +\cs_set_nopar:Npn \list #1 #2 { \__codedoc_oldlist:nn {#1} { #2 \listparindent\z@ } } \setlength \parindent { 2em } \setlength \itemindent { 0pt } \setlength \parskip { 0pt plus 3pt minus 0pt } -\cs_set_nopar:Npn \l@section #1#2 { +\@addtoreset{section}{part} +\cs_set_nopar:Npn \l@section #1#2 + { \ifnum \c@tocdepth >\z@ \addpenalty\@secpenalty \addvspace{1.0em \@plus\p@} @@ -209,36 +188,33 @@ \hskip -\leftskip #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par \endgroup - \fi} + \fi + } \cs_set_nopar:Npn\l@subsection{\@dottedtocline{2}{2.5em}{2.3em}} % #2 = 1.5em -\AtBeginDocument { +\AtBeginDocument + { \MakeShortVerb \" \MakeShortVerb \| -} -\providecommand*\eTeX{ - \if b\expandafter\@car\f@series\@nil\boldmath\fi - $\m@th\varepsilon$-\TeX -} -\providecommand*\IniTeX{Ini\TeX} + } +\providecommand*\eTeX{\hologo{eTeX}} +\providecommand*\IniTeX{\hologo{iniTeX}} \providecommand*\Lua{Lua} -\providecommand*\LuaTeX{\Lua\TeX} -\providecommand*\pdfTeX{pdf\TeX} -\RequirePackage{graphicx} -\cs_if_free:NT \XeTeX { - \cs_new_protected_nopar:Npn \XeTeX - {X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\TeX} -} -\cs_set_nopar:Npn \cmd #1 { \cs{\expandafter \doc_cmd_to_cs:w \string#1} } -\cs_set_nopar:Npn \doc_cmd_to_cs:w #1#2 { \char\number`#2\relax } -\DeclareRobustCommand \cs [1] - { - \tl_set_rescan:Nnn \l_doc_tmpb_tl { } { _ } - \tl_set:Nn \l_doc_tmpa_tl {#1} - \tl_replace_all:NVn \l_doc_tmpa_tl \l_doc_tmpb_tl { _ } - \doc_replace_at_at:N \l_doc_tmpa_tl - \tl_replace_all:NnV \l_doc_tmpa_tl { _ } \l_doc_tmpb_tl - \texttt { \char`\\ \tl_use:N \l_doc_tmpa_tl} - } +\providecommand*\LuaTeX{\hologo{LuaTeX}} +\providecommand*\pdfTeX{\hologo{pdfTeX}} +\providecommand*\XeTeX{\hologo{XeTeX}} +\DeclareDocumentCommand \cmd {m} { \__codedoc_cmd:n { #1 } } +\DeclareDocumentCommand \cs {m} { \__codedoc_cs:n { #1 } } +\cs_new:Npn \__codedoc_cmd:n #1 { \cs{ \expandafter \__codedoc_cmd_to_cs:w \string#1 } } +\cs_set_nopar:Npn \__codedoc_cmd_to_cs:w #1#2 { \char\number`#2\relax } +\cs_new:Npn \__codedoc_cs:n #1 + { + \tl_set_rescan:Nnn \l__codedoc_tmpb_tl { } { _ } + \tl_set:Nn \l__codedoc_tmpa_tl {#1} + \tl_replace_all:NVn \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl { _ } + \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl + \tl_replace_all:NnV \l__codedoc_tmpa_tl { _ } \l__codedoc_tmpb_tl + \texttt { \char`\\ \tl_use:N \l__codedoc_tmpa_tl} + } \cs_generate_variant:Nn \tl_replace_all:Nnn { NV , NnV } \providecommand\marg[1]{ \texttt{\char`\{} \meta{#1} \texttt{\char`\}} } \providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] } @@ -247,95 +223,113 @@ \DeclareRobustCommand \env {\texttt} \DeclareRobustCommand \pkg {\textsf} \DeclareRobustCommand \cls {\textsf} -\newenvironment{texnote}{ +\newenvironment{texnote} + { \endgraf \vspace{3mm} \small\textbf{\TeX~hackers~note:} -}{ + } + { \vspace{3mm} -} -\newcommand\tn[1]{ + } +\DeclareDocumentCommand \tn {m} + { \texttt { \char`\\ #1 } - \index{TeX~and~LaTeX2e~commands\actualchar - \string\TeX{}~and~\string\LaTeXe{}~commands:\levelchar - #1\actualchar{\string\ttfamily\string\bslash{}#1}}} -\cs_new:Npn \doc_implementation: { - \DeclareDocumentCommand {\variable} { O{} } { \doc_macro:n { var , ##1 } } + \index + { + TeX~and~LaTeX2e~commands\actualchar + \string\TeX{}~and~\string\LaTeXe{}~commands:\levelchar + #1\actualchar{\string\ttfamily\string\bslash{}#1} + } + } +\cs_new:Npn \__codedoc_implementation: + { + \DeclareDocumentCommand {\variable} { O{} } { \__codedoc_macro:n { var , ##1 } } \cs_set_eq:NN \endvariable \endmacro -} -\cs_new:Npn \doc_docu: { + } +\cs_new:Npn \__codedoc_docu: + { \cs_set_eq:NN \variable \variabledoc \cs_set_eq:NN \endvariable \endvariabledoc -} -\AtEndOfPackage{\doc_docu:} -\newenvironment{documentation}{\doc_docu:}{} -\newenvironment{implementation}{\doc_implementation:}{} -\newcommand\EnableDocumentation{% - \renewenvironment{documentation}{\doc_docu:}{}% -} -\newcommand\EnableImplementation{% - \renewenvironment{implementation}{\doc_implementation:}{}% -} -\newcommand\DisableDocumentation{% + } +\AtEndOfPackage{\__codedoc_docu:} +\newenvironment{documentation}{\__codedoc_docu:}{} +\newenvironment{implementation}{\__codedoc_implementation:}{} +\NewDocumentCommand \EnableDocumentation {} + { + \renewenvironment{documentation}{\__codedoc_docu:}{} + } +\NewDocumentCommand \EnableImplementation {} + { + \renewenvironment{implementation}{\__codedoc_implementation:}{} + } +\NewDocumentCommand \DisableDocumentation {} + { \cs_set_eq:NN \documentation \comment \cs_set_eq:NN \enddocumentation \endcomment -} -\newcommand\DisableImplementation{% + } +\NewDocumentCommand \DisableImplementation {} + { \cs_set_eq:NN \implementation \comment \cs_set_eq:NN \endimplementation \endcomment -} -\newenvironment{arguments}{ + } +\newenvironment{arguments} + { \enumerate[ nolistsep, label=\texttt{\#\arabic*}~:, labelsep=*, ] -}{ + } + { \endenumerate -} + } \keys_define:nn { l3doc/function } - { - TF .code:n = - { - \bool_gset_true:N \l_doc_meta_TF_bool - } , - EXP .code:n = - { - \bool_gset_true:N \l_doc_meta_EXP_bool - \bool_gset_false:N \l_doc_meta_rEXP_bool - } , - rEXP .code:n = - { - \bool_gset_false:N \l_doc_meta_EXP_bool - \bool_gset_true:N \l_doc_meta_rEXP_bool - } , - pTF .code:n = - { - \bool_gset_true:N \l_doc_meta_pTF_bool - \bool_gset_true:N \l_doc_meta_TF_bool - \bool_gset_true:N \l_doc_meta_EXP_bool - } , - added .tl_set:N = \l_doc_date_added_tl , - updated .tl_set:N = \l_doc_date_updated_tl , - } + { + TF .code:n = + { + \bool_gset_true:N \l__codedoc_meta_TF_bool + } , + EXP .code:n = + { + \bool_gset_true:N \l__codedoc_meta_EXP_bool + \bool_gset_false:N \l__codedoc_meta_rEXP_bool + } , + rEXP .code:n = + { + \bool_gset_false:N \l__codedoc_meta_EXP_bool + \bool_gset_true:N \l__codedoc_meta_rEXP_bool + } , + pTF .code:n = + { + \bool_gset_true:N \l__codedoc_meta_pTF_bool + \bool_gset_true:N \l__codedoc_meta_TF_bool + \bool_gset_true:N \l__codedoc_meta_EXP_bool + } , + added .tl_set:N = \l__codedoc_date_added_tl , + updated .tl_set:N = \l__codedoc_date_updated_tl , + tested .code:n = { } , + } \char_set_catcode_active:N \< -\DeclareDocumentEnvironment {function} { O{} } { +\DeclareDocumentEnvironment {function} { O{} } + { \par\bigskip\noindent \phantomsection - \coffin_clear:N \l_doc_descr_coffin - \coffin_clear:N \l_doc_syntax_coffin - \coffin_clear:N \l_doc_names_coffin + \coffin_clear:N \l__codedoc_descr_coffin + \box_gclear:N \g__codedoc_syntax_box + \coffin_clear:N \l__codedoc_syntax_coffin + \coffin_clear:N \l__codedoc_names_coffin - \bool_set_false:N \l_doc_meta_TF_bool - \bool_set_false:N \l_doc_meta_pTF_bool - \bool_set_false:N \l_doc_meta_EXP_bool - \bool_set_false:N \l_doc_meta_rEXP_bool + \bool_set_false:N \l__codedoc_meta_TF_bool + \bool_set_false:N \l__codedoc_meta_pTF_bool + \bool_set_false:N \l__codedoc_meta_EXP_bool + \bool_set_false:N \l__codedoc_meta_rEXP_bool \keys_set:nn { l3doc/function } {#1} - \char_set_active_eq:NN < \doc_open_meta:w + \char_set_active_eq:NN < \__codedoc_open_meta:w \group_begin: \MakePrivateLetters @@ -346,408 +340,423 @@ \char_set_catcode_ignore:N \^^I \exp_after:wN \group_end: - \function_aux:n - } - { - \vcoffin_set_end: - \bool_if:NTF \l_doc_long_name_bool - { - \coffin_join:NnnNnnnn - \l_doc_output_box {hc} {vc} - \l_doc_syntax_coffin {l} {T} - {0pt} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {t} - \l_doc_names_coffin {r} {t} - {-\marginparsep} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {b} - \l_doc_descr_coffin {l} {t} - {0.75\marginparwidth + \marginparsep} {-\medskipamount} + \__codedoc_function:n + } + { + \vcoffin_set_end: + \hcoffin_set:Nn \l__codedoc_syntax_coffin { \box_use:N \g__codedoc_syntax_box } + \bool_if:NTF \l__codedoc_long_name_bool + { + \coffin_join:NnnNnnnn + \l__codedoc_output_box {hc} {vc} + \l__codedoc_syntax_coffin {l} {T} + {0pt} {0pt} + \coffin_join:NnnNnnnn + \l__codedoc_output_box {l} {t} + \l__codedoc_names_coffin {r} {t} + {-\marginparsep} {0pt} + \coffin_join:NnnNnnnn + \l__codedoc_output_box {l} {b} + \l__codedoc_descr_coffin {l} {t} + {0.75\marginparwidth + \marginparsep} {-\medskipamount} - \coffin_typeset:Nnnnn \l_doc_output_box {\l_doc_descr_coffin-l} {\l_doc_descr_coffin-t} {0pt} {0pt} - } - { - \coffin_join:NnnNnnnn - \l_doc_output_box {hc} {vc} - \l_doc_syntax_coffin {l} {t} - {0pt} {0pt} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {b} - \l_doc_descr_coffin {l} {t} - {0pt} {-\medskipamount} - \coffin_join:NnnNnnnn - \l_doc_output_box {l} {t} - \l_doc_names_coffin {r} {t} - {-\marginparsep} {0pt} + \coffin_typeset:Nnnnn \l__codedoc_output_box {\l__codedoc_descr_coffin-l} {\l__codedoc_descr_coffin-t} {0pt} {0pt} + } + { + \coffin_join:NnnNnnnn + \l__codedoc_output_box {hc} {vc} + \l__codedoc_syntax_coffin {l} {t} + {0pt} {0pt} + \coffin_join:NnnNnnnn + \l__codedoc_output_box {l} {b} + \l__codedoc_descr_coffin {l} {t} + {0pt} {-\medskipamount} + \coffin_join:NnnNnnnn + \l__codedoc_output_box {l} {t} + \l__codedoc_names_coffin {r} {t} + {-\marginparsep} {0pt} - \coffin_typeset:Nnnnn - \l_doc_output_box {\l_doc_syntax_coffin-l} {\l_doc_syntax_coffin-T} - {0pt} {0pt} - } - \par - \allowbreak - } + \coffin_typeset:Nnnnn + \l__codedoc_output_box {\l__codedoc_syntax_coffin-l} {\l__codedoc_syntax_coffin-T} + {0pt} {0pt} + } + \par + \allowbreak + } \char_set_catcode_other:N \< \cs_set_eq:NN \variabledoc \function \cs_set_eq:NN \endvariabledoc \endfunction -\cs_set_nopar:Npn \function_aux:n #1 { +\cs_set_nopar:Npn \__codedoc_function:n #1 + { - \tl_set:Nn \l_doc_function_input_tl {#1} + \tl_set:Nn \l__codedoc_function_input_tl {#1} - \dim_zero:N \l_doc_trial_width_dim - \hcoffin_set:Nn \l_doc_names_coffin { \function_typeset:n {#1} } - \dim_set:Nn \l_doc_trial_width_dim { \box_wd:N \l_doc_names_coffin } + \dim_zero:N \l__codedoc_trial_width_dim + \hcoffin_set:Nn \l__codedoc_names_coffin { \function_typeset:n {#1} } + \dim_set:Nn \l__codedoc_trial_width_dim { \box_wd:N \l__codedoc_names_coffin } - \bool_set:Nn \l_doc_long_name_bool - { \dim_compare_p:nNn \l_doc_trial_width_dim > \marginparwidth } + \bool_set:Nn \l__codedoc_long_name_bool + { \dim_compare_p:nNn \l__codedoc_trial_width_dim > \marginparwidth } - \vcoffin_set:Nnw \l_doc_descr_coffin {\textwidth} + \vcoffin_set:Nnw \l__codedoc_descr_coffin {\textwidth} \noindent\ignorespaces -} + } \cs_gset_nopar:Npn \function_typeset:n #1 %^^A todo: use "\cs_new:Npn" here - { - \tl_gclear:N \g_doc_macro_tl + { + \tl_gclear:N \g__codedoc_macro_tl - % populate "\l_doc_functions_block_prop" with info on the functions present: - \clist_map_function:nN {#1} \doc_parse_functions:n + % populate "\l__codedoc_functions_block_prop" with info on the functions present: + \clist_map_function:nN {#1} \__codedoc_parse_functions:n - \small\ttfamily - \begin{tabular}{ @{} l @{} r @{} } - \toprule - \prop_map_function:NN \l_doc_functions_block_prop \doc_typeset_functions:nn - \doc_typeset_dates: - \bottomrule - \end{tabular} - \normalfont\normalsize - } -\prop_new:N \l_doc_functions_block_prop + \small\ttfamily + \begin{tabular}{ @{} l @{} r @{} } + \toprule + \prop_map_function:NN \l__codedoc_functions_block_prop \__codedoc_typeset_functions:nn + \__codedoc_typeset_dates: + \bottomrule + \end{tabular} + \normalfont\normalsize + } +\prop_new:N \l__codedoc_functions_block_prop \cs_generate_variant:Nn \prop_put:Nnn {Nxx} -\cs_new:Nn \doc_parse_functions:n - { - \exp_args:Nxx \tl_if_head_eq_charcode:nNTF { \token_to_str:N #1 } {\cs_to_str:N \\} - { - \tl_gset_eq:NN \l_doc_function_name_prefix_tl \@backslashchar - % for the weird functions named "\::N" and so on: -\exp_args:Nx \tl_if_head_eq_charcode:nNTF { \cs_to_str:N #1 } { : } -{ - % again, no variants: -\prop_put:Nxx \l_doc_functions_block_prop { \cs_to_str:N #1 } { {-1} {} } -} -{ - % finally, for regular old csnames: -\exp_args:NNf \prop_get:NnNTF - \l_doc_functions_block_prop - { \__cs_get_function_name:N #1 } \l_doc_tmpb_tl -{ -\prop_put:Nxx \l_doc_functions_block_prop -{ \__cs_get_function_name:N #1 } -{ - \l_doc_tmpb_tl , - {\__cs_count_signature:N #1} - {\__cs_get_function_signature:N #1} -} -} -{ -\prop_put:Nxx \l_doc_functions_block_prop -{ \__cs_get_function_name:N #1 } -{ - {\__cs_count_signature:N #1} - {\__cs_get_function_signature:N #1} -} -} -} - } - % for keys and things that aren't actually csnames: - { - % for now don't bother splitting into variants: - \tl_gclear:N \l_doc_function_name_prefix_tl -\prop_put:Nxx \l_doc_functions_block_prop { \tl_to_str:n {#1} } { {-1} {} } - } - } - -\cs_new:Nn \doc_typeset_functions:nn - { - \clist_gset:Nn \l_doc_variants_clist {#2} - \clist_gpop:NN \l_doc_variants_clist \l_doc_tmpb_tl - \exp_args:Nc \doc_typeset_functions_aux:N - { - #1 - \int_compare:nT { \exp_after:wN \use_i:nn \l_doc_tmpb_tl > -1 } {:} - \int_compare:nT { \exp_after:wN \use_i:nn \l_doc_tmpb_tl > 0 } - { \exp_after:wN \use_ii:nn \l_doc_tmpb_tl } - } - \\ - } +\cs_new:Nn \__codedoc_parse_functions:n + { + \exp_args:Nxx \tl_if_head_eq_charcode:nNTF { \token_to_str:N #1 } {\cs_to_str:N \\} + { + \tl_gset_eq:NN \l__codedoc_function_name_prefix_tl \@backslashchar + % for the weird functions named "\::N" and so on: + \exp_args:Nx \tl_if_head_eq_charcode:nNTF { \cs_to_str:N #1 } { : } + { + % again, no variants: + \prop_put:Nxx \l__codedoc_functions_block_prop { \cs_to_str:N #1 } { {-1} {} } + } + { + % finally, for regular old csnames: + \exp_args:NNf \prop_get:NnNTF + \l__codedoc_functions_block_prop + { \__cs_get_function_name:N #1 } \l__codedoc_tmpb_tl + { + \prop_put:Nxx \l__codedoc_functions_block_prop + { \__cs_get_function_name:N #1 } + { + \l__codedoc_tmpb_tl , + {\__cs_count_signature:N #1} + {\__cs_get_function_signature:N #1} + } + } + { + \prop_put:Nxx \l__codedoc_functions_block_prop + { \__cs_get_function_name:N #1 } + { + {\__cs_count_signature:N #1} + {\__cs_get_function_signature:N #1} + } + } + } + } + { + % for now don't bother splitting into variants: + \tl_gclear:N \l__codedoc_function_name_prefix_tl + \prop_put:Nxx \l__codedoc_functions_block_prop { \tl_to_str:n {#1} } { {-1} {} } + } + } +\cs_new:Nn \__codedoc_typeset_functions:nn + { + \clist_gset:Nn \l__codedoc_variants_clist {#2} + \clist_gpop:NN \l__codedoc_variants_clist \l__codedoc_tmpb_tl + \exp_args:Nc \__codedoc_typeset_functions_aux:N + { + #1 + \int_compare:nT { \exp_after:wN \use_i:nn \l__codedoc_tmpb_tl > -1 } {:} + \int_compare:nT { \exp_after:wN \use_i:nn \l__codedoc_tmpb_tl > 0 } + { \exp_after:wN \use_ii:nn \l__codedoc_tmpb_tl } + } + \\ + } -\cs_new_nopar:Nn \doc_typeset_functions_aux:N -{ - \bool_if:NT \l_doc_meta_pTF_bool { - \tl_set:Nx \l_doc_pTF_name_tl - { \l_doc_function_name_prefix_tl \doc_predicate_from_base:N #1 } - \doc_special_main_index:o { \l_doc_pTF_name_tl } +\cs_new_nopar:Nn \__codedoc_typeset_functions_aux:N + { + \bool_if:NT \l__codedoc_meta_pTF_bool + { + \tl_set:Nx \l__codedoc_pTF_name_tl + { \l__codedoc_function_name_prefix_tl \__codedoc_predicate_from_base:N #1 } + \__codedoc_special_main_index:o { \l__codedoc_pTF_name_tl } \seq_gput_right:Nx \g_doc_functions_seq - { \tl_to_str:N \l_doc_pTF_name_tl } - \tl_set:Nx \l_doc_pTF_name_tl { \doc_predicate_from_base:N #1 } - } - - \tl_set:Nx \l_doc_tmpa_tl - { - \l_doc_function_name_prefix_tl - \cs_to_str:N #1 - \bool_if:NT \l_doc_meta_TF_bool { \tl_to_str:n {TF} } - } - \doc_special_main_index:o { \l_doc_tmpa_tl } - \seq_gput_right:No \g_doc_functions_seq { \l_doc_tmpa_tl } + { \tl_to_str:N \l__codedoc_pTF_name_tl } + \tl_set:Nx \l__codedoc_pTF_name_tl { \__codedoc_predicate_from_base:N #1 } + } - \bool_if:NTF \l_doc_meta_pTF_bool { + \tl_set:Nx \l__codedoc_tmpa_tl + { + \l__codedoc_function_name_prefix_tl + \cs_to_str:N #1 + \bool_if:NT \l__codedoc_meta_TF_bool { \tl_to_str:n {TF} } + } + \__codedoc_special_main_index:o { \l__codedoc_tmpa_tl } + \seq_gput_right:No \g_doc_functions_seq { \l__codedoc_tmpa_tl } - \bool_gset_false:N \l_doc_meta_TF_bool - \exp_args:Nc \doc_typeset_function_block:N { \l_doc_pTF_name_tl } - \bool_gset_true:N \l_doc_meta_TF_bool + \bool_if:NTF \l__codedoc_meta_pTF_bool + { + \bool_gset_false:N \l__codedoc_meta_TF_bool + \exp_args:Nc \__codedoc_typeset_function_block:N { \l__codedoc_pTF_name_tl } + \bool_gset_true:N \l__codedoc_meta_TF_bool \\ - \doc_typeset_function_block:N #1 - - }{ + \__codedoc_typeset_function_block:N #1 + } + { \exp_args:Nx \tl_if_head_eq_charcode:nNTF { \exp_after:wN \use_none:n \token_to_str:N #1 } {:} - { \doc_show_macro_unusual:N #1 } - { \doc_typeset_function_block:N #1 } - } + { \__codedoc_show_macro_unusual:N #1 } + { \__codedoc_typeset_function_block:N #1 } + } } -\cs_set_nopar:Nn \doc_typeset_function_block:N { - \tl_gset:Nx \l_doc_function_name_tl { \__cs_get_function_name:N #1 } - \tl_gset:Nx \l_doc_function_sig_tl { \__cs_get_function_signature:N #1 } - \tl_gset:Nx \g_doc_macro_tl { \l_doc_function_name_prefix_tl \l_doc_function_name_tl } - - \doc_typeset_function_basename:N #1 - \bool_if:NT \l_doc_meta_TF_bool { \doc_typeset_TF: } - \doc_typeset_expandability: - \clist_if_empty:NF \l_doc_variants_clist { \doc_typeset_variants: } - \bool_if:NT \g_doc_full_bool { \doc_label_function:N #1 } +\cs_set_nopar:Nn \__codedoc_typeset_function_block:N + { + \tl_gset:Nx \l__codedoc_function_name_tl { \__cs_get_function_name:N #1 } + \tl_gset:Nx \l__codedoc_function_sig_tl { \__cs_get_function_signature:N #1 } + \tl_gset:Nx \g__codedoc_macro_tl { \l__codedoc_function_name_prefix_tl \l__codedoc_function_name_tl } -} -\cs_set:Nn \doc_typeset_function_basename:N - { \l_doc_function_name_prefix_tl \cs_to_str:N #1 } -\cs_set:Nn \doc_typeset_expandability: - { - & - \bool_if:NT \l_doc_meta_EXP_bool { - \hspace{\tabcolsep} - \hyperlink{expstar} {$\star$} - } - \bool_if:NT \l_doc_meta_rEXP_bool { - \hspace{\tabcolsep} - \hyperlink{rexpstar} {\ding{73}} % hollow star - } - } -\cs_set:Nn \doc_typeset_variants: - { - \\ - \doc_typeset_aux:n \g_doc_macro_tl : - \int_compare:nTF { \clist_count:N \l_doc_variants_clist == 1 } - { \exp_after:wN \use_ii:nn \l_doc_variants_clist } - { - \textrm( - \clist_pop:NN \l_doc_variants_clist \l_doc_tmpb_tl - \exp_after:wN \use_ii:nn \l_doc_tmpb_tl - \clist_map_inline:Nn \l_doc_variants_clist {\textrm| \use_ii:nn ##1} - \textrm) - } - \bool_if:NT \l_doc_meta_TF_bool { \doc_typeset_TF: } - & - \bool_if:NT \l_doc_meta_EXP_bool { - \hspace{\tabcolsep} - \hyperlink{expstar} {$\star$} - } - \bool_if:NT \l_doc_meta_rEXP_bool { - \hspace{\tabcolsep} - \hyperlink{rexpstar} {\ding{73}} % hollow star + \__codedoc_typeset_function_basename:N #1 + \bool_if:NT \l__codedoc_meta_TF_bool { \__codedoc_typeset_TF: } + \__codedoc_typeset_expandability: + \clist_if_empty:NF \l__codedoc_variants_clist { \__codedoc_typeset_variants: } + \bool_if:NT \g__codedoc_full_bool { \__codedoc_label_function:N #1 } + } +\cs_set:Nn \__codedoc_typeset_function_basename:N + { \l__codedoc_function_name_prefix_tl \cs_to_str:N #1 } +\cs_set:Nn \__codedoc_typeset_expandability: + { + & + \bool_if:NT \l__codedoc_meta_EXP_bool + { + \hspace{\tabcolsep} + \hyperlink{expstar} {$\star$} + } + \bool_if:NT \l__codedoc_meta_rEXP_bool + { + \hspace{\tabcolsep} + \hyperlink{rexpstar} {\ding{73}} % hollow star } - } -\cs_set:Nn \doc_label_function:N - { - \tl_set:Nx \l_doc_tmpa_tl { \l_doc_function_name_prefix_tl \cs_to_str:N #1 } - \exp_args:NNf \tl_replace_all:Nnn \l_doc_tmpa_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_remove_all:Nn \l_doc_tmpa_tl {\@backslashchar} - \exp_args:Nx \label {doc/function//\l_doc_tmpa_tl} - } -\cs_set_nopar:Nn \doc_show_macro_unusual:N { - \tl_gset:Nx \g_doc_macro_tl { \token_to_str:N #1} + } +\cs_set:Nn \__codedoc_typeset_variants: + { + \\ + \__codedoc_typeset_aux:n \g__codedoc_macro_tl : + \int_compare:nTF { \clist_count:N \l__codedoc_variants_clist == 1 } + { \exp_after:wN \use_ii:nn \l__codedoc_variants_clist } + { + \textrm( + \clist_pop:NN \l__codedoc_variants_clist \l__codedoc_tmpb_tl + \exp_after:wN \use_ii:nn \l__codedoc_tmpb_tl + \clist_map_inline:Nn \l__codedoc_variants_clist {\textrm| \use_ii:nn ##1} + \textrm) + } + \bool_if:NT \l__codedoc_meta_TF_bool { \__codedoc_typeset_TF: } + & + \bool_if:NT \l__codedoc_meta_EXP_bool + { + \hspace{\tabcolsep} + \hyperlink{expstar} {$\star$} + } + \bool_if:NT \l__codedoc_meta_rEXP_bool + { + \hspace{\tabcolsep} + \hyperlink{rexpstar} {\ding{73}} % hollow star + } + } +\cs_set:Nn \__codedoc_label_function:N + { + \tl_set:Nx \l__codedoc_tmpa_tl { \l__codedoc_function_name_prefix_tl \cs_to_str:N #1 } + \exp_args:NNf \tl_replace_all:Nnn \l__codedoc_tmpa_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_remove_all:Nn \l__codedoc_tmpa_tl {\@backslashchar} + \exp_args:Nx \label {doc/function//\l__codedoc_tmpa_tl} + } +\cs_set_nopar:Nn \__codedoc_show_macro_unusual:N + { + \tl_gset:Nx \g__codedoc_macro_tl { \token_to_str:N #1} \token_to_str:N #1 & - \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_replace_all:Nnn \g_doc_macro_tl {\@backslashchar} {} - \bool_if:NT \g_doc_full_bool { - \exp_args:Nx \label { doc/function//\g_doc_macro_tl } - } -} -\cs_set:Nn \doc_typeset_dates: - { - \bool_if:nF { \tl_if_empty_p:N \l_doc_date_added_tl && - \tl_if_empty_p:N \l_doc_date_updated_tl } - { \midrule } + \exp_args:NNf \tl_replace_all:Nnn \g__codedoc_macro_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_replace_all:Nnn \g__codedoc_macro_tl {\@backslashchar} {} + \bool_if:NT \g__codedoc_full_bool + { + \exp_args:Nx \label { doc/function//\g__codedoc_macro_tl } + } + } +\cs_set:Nn \__codedoc_typeset_dates: + { + \bool_if:nF { \tl_if_empty_p:N \l__codedoc_date_added_tl && + \tl_if_empty_p:N \l__codedoc_date_updated_tl } + { \midrule } - \tl_if_empty:NF \l_doc_date_added_tl - { - \multicolumn{2}{@{}r@{}} - { \scriptsize New:\,\l_doc_date_added_tl } \\ - } + \tl_if_empty:NF \l__codedoc_date_added_tl + { + \multicolumn{2}{@{}r@{}} + { \scriptsize New:\,\l__codedoc_date_added_tl } \\ + } - \tl_if_empty:NF \l_doc_date_updated_tl - { - \multicolumn{2}{@{}r@{}} - { \scriptsize Updated:\,\l_doc_date_updated_tl } \\ - } - } -\newenvironment{syntax}{ + \tl_if_empty:NF \l__codedoc_date_updated_tl + { + \multicolumn{2}{@{}r@{}} + { \scriptsize Updated:\,\l__codedoc_date_updated_tl } \\ + } + } +\newenvironment{syntax} + { \small\ttfamily - \bool_if:NTF \l_doc_long_name_bool + \bool_if:NTF \l__codedoc_long_name_bool { - \hcoffin_set:Nw \l_doc_syntax_coffin - \arrayrulecolor{white} - \begin{tabular}{@{}l@{}} - \toprule - \begin{minipage} - { \textwidth+0.75\marginparwidth-\l_doc_trial_width_dim } + \hbox_gset:Nw \g__codedoc_syntax_box + \arrayrulecolor{white} + \begin{tabular}{@{}l@{}} + \toprule + \begin{minipage} + { \textwidth+0.75\marginparwidth-\l__codedoc_trial_width_dim } } { - \hcoffin_set:Nw \l_doc_syntax_coffin - \arrayrulecolor{white} - \begin{tabular}{@{}l@{}} - \toprule - \begin{minipage}{ \textwidth } + \hbox_gset:Nw \g__codedoc_syntax_box + \arrayrulecolor{white} + \begin{tabular}{@{}l@{}} + \toprule + \begin{minipage}{ \textwidth } } \raggedright \obeyspaces\obeylines -}{ + } + { \end{minipage} \end{tabular} \arrayrulecolor{black} - \hcoffin_set_end: - \coffin_gset_eq:NN \l_doc_syntax_coffin \l_doc_syntax_coffin + \hbox_set_end: \ignorespacesafterend -} -\cs_new:Npn \doc_ensuremath_sb:n #1 - { - \ensuremath{\sb{#1}} - } -\cs_set_eq:NN \doc_meta:n \meta + } +\cs_new:Npn \__codedoc_ensuremath_sb:n #1 + { + \ensuremath{\sb{#1}} + } +\cs_set_eq:NN \__codedoc_meta:n \meta \cs_set:Npn \meta - { - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_meta:n - } -\cs_new:Npn \doc_open_meta:w - { - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_meta:w - } + { + \group_begin: + \char_set_active_eq:NN _ \__codedoc_ensuremath_sb:n + \__codedoc_close_meta:n + } +\cs_new:Npn \__codedoc_open_meta:w + { + \group_begin: + \char_set_active_eq:NN _ \__codedoc_ensuremath_sb:n + \__codedoc_close_meta:w + } \cs_new:Npn \Arg - { - \texttt{ \char`\{ } - \group_begin: - \char_set_active_eq:NN _ \doc_ensuremath_sb:n - \doc_close_Arg:n - } -\cs_new_nopar:Npn \doc_close_meta:n #1 { \doc_meta:n {#1} \group_end: } -\cs_new_nopar:Npn \doc_close_meta:w #1> { \doc_meta:n {#1} \group_end: } -\cs_new_nopar:Npn \doc_close_Arg:n #1 { - \doc_meta:n {#1} + { + \texttt{ \char`\{ } + \group_begin: + \char_set_active_eq:NN _ \__codedoc_ensuremath_sb:n + \__codedoc_close_Arg:n + } +\cs_new_nopar:Npn \__codedoc_close_meta:n #1 { \__codedoc_meta:n {#1} \group_end: } +\cs_new_nopar:Npn \__codedoc_close_meta:w #1> { \__codedoc_meta:n {#1} \group_end: } +\cs_new_nopar:Npn \__codedoc_close_Arg:n #1 + { + \__codedoc_meta:n {#1} \group_end: \texttt{ \char`\} } -} + } \keys_define:nn { l3doc/macro } - { - aux .code:n = - { \bool_set_true:N \l_doc_macro_aux_bool } , - internal .code:n = - { \bool_set_true:N \l_doc_macro_internal_bool } , - var .code:n = - { \bool_set_true:N \l_doc_macro_var_bool } , - TF .code:n = - { \bool_set_true:N \l_doc_macro_TF_bool } , - pTF .code:n = - { \bool_set_true:N \l_doc_macro_pTF_bool } , - tested .code:n = - { } , - } -\RenewDocumentCommand { \macro } { O{} } { \doc_macro:n {#1} } -\cs_new_protected:Npn \doc_macro:n #1 { + { + aux .code:n = + { \bool_set_true:N \l__codedoc_macro_aux_bool } , + internal .code:n = + { \bool_set_true:N \l__codedoc_macro_internal_bool } , + int .code:n = + { \bool_set_true:N \l__codedoc_macro_internal_bool } , + var .code:n = + { \bool_set_true:N \l__codedoc_macro_var_bool } , + TF .code:n = + { \bool_set_true:N \l__codedoc_macro_TF_bool } , + pTF .code:n = + { \bool_set_true:N \l__codedoc_macro_pTF_bool } , + tested .code:n = + { } , + EXP .code:n = {} , % TODO + rEXP .code:n = {} , % TODO + added .code:n = {} , % TODO + updated .code:n = {} , % TODO + } +\RenewDocumentCommand { \macro } { O{} } { \__codedoc_macro:n {#1} } +\cs_new_protected:Npn \__codedoc_macro:n #1 + { \int_compare:nNnTF \currentgrouplevel=2 - { \int_gzero:N \g_doc_nested_macro_int } - { \int_incr:N \g_doc_nested_macro_int } + { \int_gzero:N \g__codedoc_nested_macro_int } + { \int_incr:N \g__codedoc_nested_macro_int } - \bool_gset_false:N \l_doc_macro_aux_bool - \bool_gset_false:N \l_doc_macro_internal_bool - \bool_gset_false:N \l_doc_macro_TF_bool - \bool_gset_false:N \l_doc_macro_pTF_bool - \bool_gset_false:N \l_doc_macro_var_bool - \bool_gset_false:N \l_doc_tested_bool + \bool_gset_false:N \l__codedoc_macro_aux_bool + \bool_gset_false:N \l__codedoc_macro_internal_bool + \bool_gset_false:N \l__codedoc_macro_TF_bool + \bool_gset_false:N \l__codedoc_macro_pTF_bool + \bool_gset_false:N \l__codedoc_macro_var_bool + \bool_gset_false:N \l__codedoc_tested_bool - \cs_set_eq:NN \doc_macroname_prefix:n \use:n - \cs_set_eq:NN \doc_macroname_suffix: \c_empty_tl + \cs_set_eq:NN \__codedoc_macroname_prefix:n \use:n + \cs_set_eq:NN \__codedoc_macroname_suffix: \c_empty_tl \keys_set:nn { l3doc/macro } {#1} - \cs_set_eq:NN \testfile \doc_print_testfile:n + \cs_set_eq:NN \testfile \__codedoc_print_testfile:n \peek_meaning_ignore_spaces:NTF \c_group_begin_token - { - \group_begin: - \MakePrivateLetters - \char_set_catcode_letter:N \\ - \char_set_catcode_ignore:N \ % space - \char_set_catcode_ignore:N \^^M - \char_set_catcode_ignore:N \^^I - \doc_macro_aux:n - } - { - \doc_macro_verbatim:w - } -} -\NewDocumentCommand {\doc_macro_verbatim:w} {v} - { - \group_begin: % pretty useless - \doc_macro_aux:n {#1} - } -\keys_define:nn { l3doc/macro } - { - unknown .code:n = { \use:c{doc_macro_opt_#1:} } - } -\clist_new:N \l_doc_macro_input_clist -\cs_new_nopar:Npn \doc_macro_aux:n #1 { + { + \group_begin: + \MakePrivateLetters + \char_set_catcode_letter:N \\ + \char_set_catcode_ignore:N \ % space + \char_set_catcode_ignore:N \^^M + \char_set_catcode_ignore:N \^^I + \__codedoc_macro_aux:n + } + { + \__codedoc_macro_verbatim:w + } + } +\NewDocumentCommand {\__codedoc_macro_verbatim:w} {v} + { + \group_begin: % pretty useless + \__codedoc_macro_aux:n {#1} + } +\clist_new:N \l__codedoc_macro_input_clist +\cs_new_nopar:Npn \__codedoc_macro_aux:n #1 + { \group_end: - \clist_set:Nn \l_doc_macro_input_clist {#1} - \bool_if:NTF \l_doc_macro_pTF_bool - { - \clist_map_inline:Nn \l_doc_macro_input_clist + \clist_set:Nn \l__codedoc_macro_input_clist {#1} + \bool_if:NTF \l__codedoc_macro_pTF_bool + { + \clist_map_inline:Nn \l__codedoc_macro_input_clist { - \exp_args:Nx \doc_macro_single:n { \doc_predicate_from_base:w ##1 \q_nil } + \exp_args:Nx \__codedoc_macro_single:n { \__codedoc_predicate_from_base:w ##1 \q_nil } } - \bool_set_true:N \l_doc_macro_TF_bool - \clist_map_function:NN \l_doc_macro_input_clist \doc_macro_single:n - \bool_set_false:N \l_doc_macro_TF_bool - } - { \clist_map_function:NN \l_doc_macro_input_clist \doc_macro_single:n } -} -\cs_set:Nn \doc_predicate_from_base:N - { - \__cs_get_function_name:N #1 _p: \__cs_get_function_signature:N #1 - } -\cs_set:Npn \doc_predicate_from_base:w #1 : #2 \q_nil - { - #1 _p: #2 - } -\tl_new:N \l_doc_at_replaced_macro_tl -\cs_set_nopar:Npn \doc_macro_single:n #1 { - \int_incr:N \l_doc_macro_int - \tl_set:Nx \l_doc_at_replaced_macro_tl { \token_to_str:N #1 } - \doc_replace_at_at:N \l_doc_at_replaced_macro_tl - \tl_set_eq:NN \saved@macroname \l_doc_at_replaced_macro_tl + \bool_set_true:N \l__codedoc_macro_TF_bool + \clist_map_function:NN \l__codedoc_macro_input_clist \__codedoc_macro_single:n + \bool_set_false:N \l__codedoc_macro_TF_bool + } + { \clist_map_function:NN \l__codedoc_macro_input_clist \__codedoc_macro_single:n } + } +\cs_set:Nn \__codedoc_predicate_from_base:N + { + \__cs_get_function_name:N #1 _p: \__cs_get_function_signature:N #1 + } +\cs_set:Npn \__codedoc_predicate_from_base:w #1 : #2 \q_nil + { + #1 _p: #2 + } +\cs_set_nopar:Npn \__codedoc_macro_single:n #1 + { + \int_incr:N \l__codedoc_macro_int + + \tl_set:Nx \l__codedoc_at_replaced_macro_tl { \token_to_str:N #1 } + \__codedoc_replace_at_at:N \l__codedoc_at_replaced_macro_tl + \tl_set_eq:NN \saved@macroname \l__codedoc_at_replaced_macro_tl + \topsep\MacroTopsep \trivlist \cs_set_nopar:Npn \makelabel ##1 { \llap{##1} } @@ -758,56 +767,67 @@ \cs_set_nopar:Npx \@tempa{\@tempa\hbox{\strut}} \advance\count@\m@ne \repeat - \cs_set_nopar:Npx \makelabel ##1 { + \cs_set_nopar:Npx \makelabel ##1 + { \llap{\vtop to\baselineskip {\@tempa\hbox{##1}\vss}} - } + } \advance \macro@cnt \@ne \else \macro@cnt \@ne \fi - \bool_if:NT \l_doc_macro_aux_bool { - \cs_set_eq:NN \doc_macroname_prefix:n \doc_typeset_aux:n - } - \bool_if:NT \l_doc_macro_TF_bool { - \cs_set_eq:NN \doc_macroname_suffix: \doc_typeset_TF: - } + \bool_if:NT \l__codedoc_macro_aux_bool + { + \cs_set_eq:NN \__codedoc_macroname_prefix:n \__codedoc_typeset_aux:n + } + \bool_if:NT \l__codedoc_macro_TF_bool + { + \cs_set_eq:NN \__codedoc_macroname_suffix: \__codedoc_typeset_TF: + } - \bool_if:NF \l_doc_macro_aux_bool { - \tl_gset:Nx \l_doc_macro_tl { \tl_to_str:N \l_doc_at_replaced_macro_tl } - \exp_args:NNf \tl_greplace_all:Nnn \l_doc_macro_tl {\token_to_str:N _} {/} - \exp_args:NNf \tl_greplace_all:Nnn \l_doc_macro_tl {\@backslashchar} {} - } + \bool_if:NF \l__codedoc_macro_aux_bool + { + \tl_gset:Nx \l__codedoc_macro_tl { \tl_to_str:N \l__codedoc_at_replaced_macro_tl } + \exp_args:NNf \tl_greplace_all:Nnn \l__codedoc_macro_tl {\token_to_str:N _} {/} + \exp_args:NNf \tl_greplace_all:Nnn \l__codedoc_macro_tl {\@backslashchar} {} + } - \use:x { - \exp_not:N \item [ \exp_not:N \doc_print_macroname:n { - \tl_to_str:N \l_doc_at_replaced_macro_tl + \use:x + { + \exp_not:N \item [ \exp_not:N \__codedoc_print_macroname:n { + \tl_to_str:N \l__codedoc_at_replaced_macro_tl }] - } - \global\advance \c@CodelineNo \@ne + } + \int_gincr:N \g__codedoc_codeline_int - \bool_if:NF \l_doc_macro_aux_bool { - \bool_if:NTF \l_doc_macro_TF_bool { - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl \tl_to_str:n {TF} } - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl \tl_to_str:n {T } } - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl \tl_to_str:n { F} } - }{ - \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l_doc_at_replaced_macro_tl } - } - } - \bool_if:NTF \l_doc_macro_TF_bool { - \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl TF}\nobreak - \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl TF} - }{ - \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl }\nobreak - \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l_doc_at_replaced_macro_tl } - } + \bool_if:NF \l__codedoc_macro_aux_bool + { + \bool_if:NTF \l__codedoc_macro_TF_bool + { + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l__codedoc_at_replaced_macro_tl \tl_to_str:n {TF} } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l__codedoc_at_replaced_macro_tl \tl_to_str:n {T } } + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l__codedoc_at_replaced_macro_tl \tl_to_str:n { F} } + } + { + \seq_gput_right:Nx \g_doc_macros_seq { \tl_to_str:N \l__codedoc_at_replaced_macro_tl } + } + } + \bool_if:NTF \l__codedoc_macro_TF_bool + { + \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l__codedoc_at_replaced_macro_tl TF}\nobreak + \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l__codedoc_at_replaced_macro_tl TF} + } + { + \exp_args:Nx \SpecialMainIndex{ \tl_to_str:N \l__codedoc_at_replaced_macro_tl }\nobreak + \exp_args:Nx \DoNotIndex{ \tl_to_str:N \l__codedoc_at_replaced_macro_tl } + } - \global\advance \c@CodelineNo \m@ne + \int_gdecr:N \g__codedoc_codeline_int \ignorespaces -} -\tl_clear:N \l_doc_macro_tl -\cs_set_nopar:Npn \doc_print_macroname:n #1 { + } +\tl_clear:N \l__codedoc_macro_tl +\cs_set_nopar:Npn \__codedoc_print_macroname:n #1 + { \strut \HD@target \int_compare:nTF { \tl_count:n {#1} <= 28 } @@ -815,136 +835,158 @@ % INEFFICIENT: (!) \exp_args:NNx \seq_if_in:NnTF \g_doc_functions_seq - { #1 \bool_if:NT \l_doc_macro_TF_bool { \tl_to_str:n {TF} } } - { - \hyperref [doc/function//\l_doc_macro_tl] - } - { \use:n } - { - \doc_macroname_prefix:n {#1} \doc_macroname_suffix: \ % space! - } -} -\providecommand \MacroLongFont { + { #1 \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} } } + { + \hyperref [doc/function//\l__codedoc_macro_tl] + } + { \use:n } + { + \__codedoc_macroname_prefix:n {#1} \__codedoc_macroname_suffix: \ % space! + } + } +\providecommand \MacroLongFont + { \fontfamily{lmtt}\fontseries{lc}\small -} -\cs_set_nopar:Npn \doc_typeset_TF: { - \hyperlink{explTF}{% - \color{black}% - \itshape TF% - \makebox[0pt][r]{% + } +\cs_set_nopar:Npn \__codedoc_typeset_TF: + { + \hyperlink{explTF} + { + \color{black} + \itshape TF + \makebox[0pt][r] + { \color{red} \underline { \phantom{\itshape TF} \kern-0.1em } - } - } -} -\cs_set_nopar:Npn \doc_typeset_aux:n #1 { - {\color[gray]{0.7} #1} -} -\DeclareDocumentCommand \doc_print_testfile:n {m} { - \bool_set_true:N \l_doc_tested_bool - \tl_if_eq:nnF {#1} {*} { - \seq_if_in:NnF \g_doc_testfiles_seq {#1} - { - \par{\footnotesize(\textit{ - The~ test~ suite~ for~ this~ command,~ and~ others~ in~ this~ file,~ is~ \textsf{#1}}. - )\par} - \seq_gput_right:Nn \g_doc_testfiles_seq {#1} - } - } -} -\DeclareDocumentCommand \TestFiles {m} { + } + } + } +\cs_set_nopar:Npn \__codedoc_typeset_aux:n #1 + { + { \color[gray]{0.7} #1 } + } +\DeclareDocumentCommand \__codedoc_print_testfile:n {m} + { + \bool_set_true:N \l__codedoc_tested_bool + \tl_if_eq:nnF {#1} {*} + { + \seq_if_in:NnF \g__codedoc_testfiles_seq {#1} + { + \seq_gput_right:Nn \g__codedoc_testfiles_seq {#1} + \par + \__codedoc_print_testfile_aux:n {#1} + } + } + } +\cs_new_protected:Npn \__codedoc_print_testfile_aux:n #1 + { + \footnotesize + ( + \textit{ + The~ test~ suite~ for~ this~ command,~ + and~ others~ in~ this~ file,~ is~ \textsf{#1} + }. + )\par + } +\DeclareDocumentCommand \TestFiles {m} + { \par {\itshape The~ following~ test~ files~ are~ used~ for~ this~ code:~ \textsf{#1}. } \par\ignorespaces -} -\DeclareDocumentCommand \UnitTested {} { - \testfile* -} + } +\DeclareDocumentCommand \UnitTested {} { \testfile* } \cs_generate_variant:Nn \prop_gput:Nnn {NVx} -\DeclareDocumentCommand \TestMissing {m} { - \prop_if_in:NVTF \g_doc_missing_tests_prop \l_doc_macro_input_clist - { - \prop_get:NVN \g_doc_missing_tests_prop \l_doc_macro_input_clist \l_doc_tmpa_tl - \prop_gput:NVx \g_doc_missing_tests_prop \l_doc_macro_input_clist - { - *~ \l_doc_tmpa_tl +\DeclareDocumentCommand \TestMissing {m} + { + \prop_if_in:NVTF \g__codedoc_missing_tests_prop \l__codedoc_macro_input_clist + { + \prop_get:NVN \g__codedoc_missing_tests_prop \l__codedoc_macro_input_clist \l__codedoc_tmpa_tl + \prop_gput:NVx \g__codedoc_missing_tests_prop \l__codedoc_macro_input_clist + { + *~ \l__codedoc_tmpa_tl ^^J \exp_not:n {\space\space\space\space\space\space} *~ #1 - } - } - { \prop_gput:NVn \g_doc_missing_tests_prop \l_doc_macro_input_clist {#1} } -} -\tl_new:N \g_doc_module_name_tl -\cs_new_protected:Npn \doc_replace_at_at:N #1 { - \tl_if_empty:NF \g_doc_module_name_tl - { - \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } - \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } - \tl_replace_all:Nox #1 { _@@ } { __ \g_doc_module_name_tl } - \tl_replace_all:Nox #1 { @@ } { __ \g_doc_module_name_tl } - } -} + } + } + { \prop_gput:NVn \g__codedoc_missing_tests_prop \l__codedoc_macro_input_clist {#1} } + } +\tl_new:N \g__codedoc_module_name_tl +\cs_new_protected:Npn \__codedoc_replace_at_at:N #1 + { + \tl_if_empty:NF \g__codedoc_module_name_tl + { + \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } + \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } + \tl_replace_all:Nox #1 { _@ @ } { __ \g__codedoc_module_name_tl } + \tl_replace_all:Nox #1 { @ @ } { __ \g__codedoc_module_name_tl } + } + } \cs_generate_variant:Nn \tl_replace_all:Nnn { Non, Nox } -\cs_new_protected:Nn \doc_endmacro_build_seq:N - { - \seq_gclear:N #1 - \clist_map_inline:Nn \l_doc_macro_input_clist - { - \tl_set:Nn \l_doc_tmpa_tl {##1} - \doc_replace_at_at:N \l_doc_tmpa_tl - \seq_gput_right:No #1 { \l_doc_tmpa_tl } - } - } -\cs_set_protected:Nn \doc_endmacro_wrap_each:N - { - \bool_if:NTF \l_doc_macro_TF_bool - { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 TF } } } - { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 } } } - } -\cs_set:Nn \doc_texttt_comma:n {\,,~\texttt{#1}} -\cs_set:Npn \endmacro { - \int_compare:nT {\g_doc_nested_macro_int<1} - { - \par\nobreak\noindent{\footnotesize(\emph{ +\cs_new_protected:Nn \__codedoc_endmacro_build_seq:N + { + \seq_gclear:N #1 + \clist_map_inline:Nn \l__codedoc_macro_input_clist + { + \tl_set:Nn \l__codedoc_tmpa_tl {##1} + \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl + \seq_gput_right:No #1 { \l__codedoc_tmpa_tl } + } + } +\cs_set_protected:Nn \__codedoc_endmacro_wrap_each:N + { + \bool_if:NTF \l__codedoc_macro_TF_bool + { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 TF } } } + { \seq_gset_map:NNn #1 #1 { \exp_not:N \texttt { ##1 } } } + } +\cs_set:Nn \__codedoc_texttt_comma:n {\,,~\texttt{#1}} +\cs_set:Npn \endmacro + { + \int_compare:nT { \g__codedoc_nested_macro_int < 1 } + { + \par\nobreak\noindent{\footnotesize(\emph{ End~ definition~ for~ - \doc_endmacro_build_seq:N \g_doc_tmpa_seq - \doc_endmacro_wrap_each:N \g_doc_tmpa_seq - \int_compare:nTF { \seq_count:N \g_doc_tmpa_seq <= 3 } + \__codedoc_endmacro_build_seq:N \g__codedoc_tmpa_seq + \__codedoc_endmacro_wrap_each:N \g__codedoc_tmpa_seq + \int_compare:nTF { \seq_count:N \g__codedoc_tmpa_seq <= 3 } { - \seq_use:Nnnn \g_doc_tmpa_seq + \seq_use:Nnnn \g__codedoc_tmpa_seq { \,~and~ } { \,,~ } { \,,~and~ } } - { \seq_item:Nn \g_doc_tmpa_seq {1}\,~and~others. } - \bool_if:nT { - !\l_doc_macro_aux_bool && - !\l_doc_macro_internal_bool && - \int_compare_p:n {\g_doc_nested_macro_int<1} - } - { - \int_compare:nNnTF \l_doc_macro_int=1 {~This~} {~These~} - \bool_if:NTF \l_doc_macro_var_bool{variable}{function} - \int_compare:nNnTF \l_doc_macro_int=1 {~is~}{s~are~} - documented~on~page~ - \exp_args:Nx\pageref{doc/function//\l_doc_macro_tl}. - } - })\par} - } + { \seq_item:Nn \g__codedoc_tmpa_seq {1}\,~and~others. } + + \bool_if:nT + { + !\l__codedoc_macro_aux_bool && + !\l__codedoc_macro_internal_bool && + \int_compare_p:n {\g__codedoc_nested_macro_int<1} + } + { + \int_compare:nNnTF \l__codedoc_macro_int=1 {~This~} {~These~} + \bool_if:NTF \l__codedoc_macro_var_bool{variable}{function} + \int_compare:nNnTF \l__codedoc_macro_int=1 {~is~}{s~are~} + documented~on~page~ + \exp_args:Nx\pageref{doc/function//\l__codedoc_macro_tl}. + } + })\par} + } + \bool_if:nT - { \g_doc_checktest_bool && - !( \l_doc_macro_aux_bool || \l_doc_macro_var_bool ) && - !\l_doc_tested_bool - } - { - \seq_gput_right:Nx \g_doc_not_tested_seq - { - \seq_use:Nnnn \g_doc_tmpa_seq { , } { , } { , } - \bool_if:NT \l_doc_macro_pTF_bool {~(pTF)} - \bool_if:NT \l_doc_macro_TF_bool {~(TF)} - } - } -} + { + \g__codedoc_checktest_bool && + !( \l__codedoc_macro_aux_bool || \l__codedoc_macro_var_bool ) && + !\l__codedoc_tested_bool + } + { + \seq_gput_right:Nx \g__codedoc_not_tested_seq + { + \seq_use:Nnnn \g__codedoc_tmpa_seq { , } { , } { , } + \bool_if:NT \l__codedoc_macro_pTF_bool {~(pTF)} + \bool_if:NT \l__codedoc_macro_TF_bool {~(TF)} + } + } + } \group_begin: \char_set_catcode_escape:N \/ \char_set_catcode_other:N \^^A @@ -958,191 +1000,222 @@ \char_set_lccode:nn { `\^^L } { `\{ } \char_set_lccode:nn { `\^^R } { `\} } \tl_to_lowercase:n - { - \group_end: - \cs_set_protected:Npn \xmacro@code - #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R - { \doc_xmacro_code:n {#1} /end{macrocode} } - } + { + \group_end: + \cs_set_protected:Npn \xmacro@code + #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R + { \__codedoc_xmacro_code:n {#1} /end{macrocode} } + } \group_begin: \char_set_catcode_active:N \< \char_set_catcode_active:N \> - \cs_new_protected:Npn \doc_xmacro_code:n #1 - { - \tl_if_in:nnTF {#1} { < @ @ = } - { \doc_xmacro_code:w #1 \q_stop } - { - \tl_set:Nn \l_doc_tmpa_tl {#1} - \doc_replace_at_at:N \l_doc_tmpa_tl - \tl_use:N \l_doc_tmpa_tl - } - } - \cs_new_protected:Npn \doc_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop - { - \tl_set:Nn \l_doc_tmpa_tl {#1} - \doc_replace_at_at:N \l_doc_tmpa_tl + \cs_new_protected:Npn \__codedoc_xmacro_code:n #1 + { + \tl_if_in:nnTF {#1} { < @ @ = } + { \__codedoc_xmacro_code:w #1 \q_stop } + { + \tl_set:Nn \l__codedoc_tmpa_tl {#1} + \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl + \tl_use:N \l__codedoc_tmpa_tl + } + } + \cs_new_protected:Npn \__codedoc_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop + { + \tl_set:Nn \l__codedoc_tmpa_tl {#1} + \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl - \tl_gset:Nn \g_doc_module_name_tl {#2} - \tl_put_right:Nn \l_doc_tmpa_tl { < @ @ = #2 > } + \tl_gset:Nn \g__codedoc_module_name_tl {#2} + \tl_put_right:Nn \l__codedoc_tmpa_tl { < @ @ = #2 > } - \tl_set:Nn \l_doc_tmpb_tl {#3} - \doc_replace_at_at:N \l_doc_tmpb_tl - \tl_put_right:No \l_doc_tmpa_tl { \l_doc_tmpb_tl } + \tl_set:Nn \l__codedoc_tmpb_tl {#3} + \__codedoc_replace_at_at:N \l__codedoc_tmpb_tl + \tl_put_right:No \l__codedoc_tmpa_tl { \l__codedoc_tmpb_tl } - \tl_use:N \l_doc_tmpa_tl - } -\group_end: -\newcommand*{\DescribeOption}{ - \leavevmode - \@bsphack - \begingroup - \MakePrivateLetters - \Describe@Option -} -\newcommand*{\Describe@Option}[1]{ - \endgroup - \marginpar{ - \raggedleft - \PrintDescribeEnv{#1} - } - \SpecialOptionIndex{#1} - \@esphack - \ignorespaces -} -\newcommand*{\SpecialOptionIndex}[1]{ - \@bsphack - \begingroup - \HD@target - \let\HDorg@encapchar\encapchar - \edef\encapchar usage{ - \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage} - } - \index{ - #1\actualchar{\protect\ttfamily#1}~(option) - \encapchar usage - } - \index{ - options:\levelchar#1\actualchar{\protect\ttfamily#1} - \encapchar usage + \tl_use:N \l__codedoc_tmpa_tl } - \endgroup - \@esphack -} +\group_end: +\newcommand*{\DescribeOption} + { + \leavevmode + \@bsphack + \begingroup + \MakePrivateLetters + \Describe@Option + } +\newcommand*{\Describe@Option}[1] + { + \endgroup + \marginpar{ + \raggedleft + \PrintDescribeEnv{#1} + } + \SpecialOptionIndex{#1} + \@esphack + \ignorespaces + } +\newcommand*{\SpecialOptionIndex}[1] + { + \@bsphack + \begingroup + \HD@target + \let\HDorg@encapchar\encapchar + \edef\encapchar usage + { + \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage} + } + \index + { + #1\actualchar{\protect\ttfamily#1}~(option) + \encapchar usage + } + \index + { + options:\levelchar#1\actualchar{\protect\ttfamily#1} + \encapchar usage + } + \endgroup + \@esphack + } \font\manual=manfnt \cs_set_nopar:Npn \dbend { {\manual\char127} } -\newenvironment {danger} { +\newenvironment {danger} + { \begin{trivlist}\item[]\noindent \begingroup\hangindent=2pc\hangafter=-2 \cs_set_nopar:Npn \par{\endgraf\endgroup} \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces -}{ + } + { \par\end{trivlist} -} -\newenvironment {ddanger} { + } +\newenvironment {ddanger} + { \begin{trivlist}\item[]\noindent \begingroup\hangindent=3.5pc\hangafter=-2 \cs_set_nopar:Npn \par{\endgraf\endgroup} \hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces -}{ + }{ \par\end{trivlist} -} + } \newenvironment{TemplateInterfaceDescription}[1] - {\subsection{The~object~type~`#1'}% - \begingroup - \@beginparpenalty\@M - \description - \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics:}}% - } - {\par\bigskip} + { + \subsection{The~object~type~`#1'} + \begingroup + \@beginparpenalty\@M + \description + \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par} + \def\TemplateSemantics + { + \enddescription\endgroup + \subsubsection*{Semantics:} + } + } + { + \par\bigskip + } \newenvironment{TemplateDescription}[2] - {\subsection{The~template~`#2'~(object~type~#1)}% - \subsubsection*{Attributes:}% + { + \subsection{The~template~`#2'~(object~type~#1)} + \subsubsection*{Attributes:} \begingroup \@beginparpenalty\@M \description - \def\TemplateKey##1##2##3##4{\item[##1~(##2)]##3% + \def\TemplateKey##1##2##3##4 + { + \item[##1~(##2)]##3% \ifx\TemplateKey##4\TemplateKey\else \hfill\penalty500\hbox{}\hfill Default:~##4% \nobreak\hskip-\parfillskip\hskip0pt\relax \fi - \par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics~\&~Comments:}}% + \par + } + \def\TemplateSemantics + { + \enddescription\endgroup + \subsubsection*{Semantics~\&~Comments:} + } } {\par\bigskip} \newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx] - {\subsubsection{The~instance~`#3'~(template~#2/#4)}% - \subsubsection*{Attribute~values:}% + { + \subsubsection{The~instance~`#3'~(template~#2/#4)} + \subsubsection*{Attribute~values:} \begingroup \@beginparpenalty\@M - \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}% + \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\} \def\InstanceSemantics{\endtabbing\endgroup \vskip-30pt\vskip0pt - \subsubsection*{Layout~description~\&~Comments:}}% + \subsubsection*{Layout~description~\&~Comments:}} \tabbing xxxx\=#1\=\kill } {\par\bigskip} -\cs_set_nopar:Npn \AlsoImplementation { - \bool_set_true:N \g_doc_implementation_bool - \cs_set:Npn \StopEventually ##1 { +\cs_set_nopar:Npn \AlsoImplementation + { + \bool_set_true:N \g__codedoc_implementation_bool + \cs_set:Npn \StopEventually ##1 + { \@bsphack \cs_gset_nopar:Npn \Finale { ##1 \check@checksum } \init@checksum \@esphack - } -} + } + } \AlsoImplementation -\cs_set_nopar:Npn \OnlyDescription { +\cs_set_nopar:Npn \OnlyDescription + { \@bsphack - \bool_set_false:N \g_doc_implementation_bool + \bool_set_false:N \g__codedoc_implementation_bool \cs_set:Npn \StopEventually ##1 { ##1 \endinput } \@esphack -} + } \cs_set_eq:NN \Finale \relax \cs_set_nopar:Npn \partname{File} -\cs_set:Npn \DocInput #1 { - \clist_map_inline:nn {#1} { +\cs_set:Npn \DocInput #1 + { + \clist_map_inline:nn {#1} + { \clist_put_right:Nn \g_docinput_clist {##1} \MakePercentIgnore \input{##1} \MakePercentComment - } -} -\cs_set:Npn \DocInputAgain { - \clist_map_inline:Nn \g_docinput_clist { + } + } +\cs_set:Npn \DocInputAgain + { + \clist_map_inline:Nn \g_docinput_clist + { \MakePercentIgnore \input{##1} \MakePercentComment - } -} + } + } \cs_set_nopar:Npn \partname{File} -\newcommand*{\DocInclude}[1]{% +\newcommand*{\DocInclude}[1] + { \relax\clearpage \docincludeaux - \IfFileExists{#1.fdd}{ - \cs_set_nopar:Npn \currentfile{#1.fdd} - }{ - \cs_set_nopar:Npn \currentfile{#1.dtx} - } + \IfFileExists{#1.fdd} + { \cs_set_nopar:Npn \currentfile{#1.fdd} } + { \cs_set_nopar:Npn \currentfile{#1.dtx} } \ifnum\@auxout=\@partaux \@latexerr{\string\include\space cannot~be~nested}\@eha \else \@docinclude #1 \fi -} -\cs_set_nopar:Npn \@docinclude #1 { + } +\cs_set_nopar:Npn \@docinclude #1 + { \clearpage \immediate\write\@mainaux{\string\@input{#1.aux}} \@tempswatrue \if@partsw \@tempswafalse \cs_set_nopar:Npx \@tempb{#1} - \@for\@tempa:=\@partlist\do{ + \@for\@tempa:=\@partlist\do + { \ifx\@tempa\@tempb\@tempswatrue\fi - } + } \fi \if@tempswa \cs_set_eq:NN \@auxout\@partaux @@ -1171,29 +1244,36 @@ \@nameuse{cp@#1} \fi \cs_set_eq:NN \@auxout\@mainaux -} -\cs_gset_nopar:Npn \codeline@wrindex #1 { - \immediate\write\@indexfile { + } +\cs_gset_nopar:Npn \codeline@wrindex #1 + { + \immediate\write\@indexfile + { \string\indexentry{#1} - {\filesep\number\c@CodelineNo} - } -} + { \filesep \int_use:N \g__codedoc_codeline_int } + } + } \cs_set_eq:NN \filesep \@empty -\cs_set_nopar:Npn \docincludeaux { +\cs_set_nopar:Npn \docincludeaux + { \cs_set_nopar:Npn \thepart {\alphalph{part}} \cs_set_nopar:Npn \filesep {\thepart-} \cs_set_eq:NN \filekey\@gobble - \g@addto@macro\index@prologue{ - \cs_gset_nopar:Npn\@oddfoot{ - \parbox{\textwidth}{ + \g@addto@macro\index@prologue + { + \cs_gset_nopar:Npn\@oddfoot + { + \parbox{\textwidth} + { \strut\footnotesize \raggedright{\bfseries File~Key:}~\filekey - } - } + } + } \cs_set_eq:NN \@evenfoot\@oddfoot - } + } \cs_gset_eq:NN \docincludeaux\relax - \cs_gset_nopar:Npn\@oddfoot{ + \cs_gset_nopar:Npn\@oddfoot + { \expandafter\ifx\csname ver@\currentfile\endcsname\relax File~\thepart :~{\ttfamily\currentfile}~ \else @@ -1203,104 +1283,119 @@ Version~\ExplFileVersion \fi \hfill\thepage - } + } \cs_set_eq:NN \@evenfoot \@oddfoot -} -\iow_new:N \g_doc_func_iow -\cs_new_nopar:Npn \doc_show_functions_defined: { - \bool_if:nT { \g_doc_implementation_bool && \g_doc_checkfunc_bool } { + } +\iow_new:N \g__codedoc_func_iow +\cs_new_nopar:Npn \__codedoc_show_functions_defined: + { + \bool_if:nT { \g__codedoc_implementation_bool && \g__codedoc_checkfunc_bool } + { \typeout{ ======================================== ^^J } - \iow_open:Nn \g_doc_func_iow { \c_job_name_tl .cmds } + \iow_open:Nn \g__codedoc_func_iow { \c_job_name_tl .cmds } - \tl_clear:N \l_doc_tmpa_tl - \seq_map_inline:Nn \g_doc_functions_seq { - \seq_if_in:NnT \g_doc_macros_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { > ~ ##1 } - } - } + \tl_clear:N \l__codedoc_tmpa_tl + \seq_map_inline:Nn \g_doc_functions_seq + { + \seq_if_in:NnT \g_doc_macros_seq {##1} + { + \tl_put_right:Nn \l__codedoc_tmpa_tl { ##1 ^^J } + \iow_now:Nn \g__codedoc_func_iow { > ~ ##1 } + } + } - \doc_functions_typeout:n { - Functions~both~documented~and~defined:^^J (In~order~of~being~documented) - } + \__codedoc_functions_typeout:n + { + Functions~both~documented~and~defined:^^J + (In~order~of~being~documented) + } - \seq_map_inline:Nn \g_doc_functions_seq { - \seq_if_in:NnF \g_doc_macros_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { ! ~ ##1} - } - } - \doc_functions_typeout:n { Functions~documented~but~not~defined: } + \seq_map_inline:Nn \g_doc_functions_seq + { + \seq_if_in:NnF \g_doc_macros_seq {##1} + { + \tl_put_right:Nn \l__codedoc_tmpa_tl { ##1 ^^J } + \iow_now:Nn \g__codedoc_func_iow { ! ~ ##1} + } + } + \__codedoc_functions_typeout:n { Functions~documented~but~not~defined: } - \seq_map_inline:Nn \g_doc_macros_seq { - \seq_if_in:NnF \g_doc_functions_seq {##1} { - \tl_put_right:Nn \l_doc_tmpa_tl { ##1 ^^J } - \iow_now:Nn \g_doc_func_iow { ? ~ ##1} - } - } - \doc_functions_typeout:n { Functions~defined~but~not~documented: } + \seq_map_inline:Nn \g_doc_macros_seq + { + \seq_if_in:NnF \g_doc_functions_seq {##1} + { + \tl_put_right:Nn \l__codedoc_tmpa_tl { ##1 ^^J } + \iow_now:Nn \g__codedoc_func_iow { ? ~ ##1} + } + } + \__codedoc_functions_typeout:n { Functions~defined~but~not~documented: } - \iow_close:N \g_doc_func_iow + \iow_close:N \g__codedoc_func_iow \typeout{ ======================================== } } } -\AtEndDocument{ \doc_show_functions_defined: } -\cs_set_nopar:Npn \doc_functions_typeout:n #1 { - \tl_if_empty:NF \l_doc_tmpa_tl { - \typeout{ +\AtEndDocument{ \__codedoc_show_functions_defined: } +\cs_set_nopar:Npn \__codedoc_functions_typeout:n #1 + { + \tl_if_empty:NF \l__codedoc_tmpa_tl + { + \typeout + { -------------------------------------- ^^J #1 ^^J - -------------------------------------- ^^J \l_doc_tmpa_tl - } - \tl_clear:N \l_doc_tmpa_tl - } -} -\cs_new:Npn \doc_show_not_tested: { - \bool_if:NT \g_doc_checktest_bool - { - \bool_if:nT { !(\seq_if_empty_p:N \g_doc_not_tested_seq) || - !(\prop_if_empty_p:N \g_doc_missing_tests_prop) } - { - \tl_clear:N \l_doc_tmpa_tl - \prop_if_empty:NF \g_doc_missing_tests_prop - { - \tl_put_right:Nn \l_doc_tmpa_tl - { + -------------------------------------- ^^J \l__codedoc_tmpa_tl + } + \tl_clear:N \l__codedoc_tmpa_tl + } + } +\cs_new:Npn \__codedoc_show_not_tested: + { + \bool_if:NT \g__codedoc_checktest_bool + { + \bool_if:nT { !(\seq_if_empty_p:N \g__codedoc_not_tested_seq) || + !(\prop_if_empty_p:N \g__codedoc_missing_tests_prop) } + { + \tl_clear:N \l__codedoc_tmpa_tl + \prop_if_empty:NF \g__codedoc_missing_tests_prop + { + \tl_put_right:Nn \l__codedoc_tmpa_tl + { ^^J^^JThe~ following~ macro(s)~ have~ incomplete~ tests:^^J - } - \prop_map_inline:Nn \g_doc_missing_tests_prop - { - \tl_put_right:Nn \l_doc_tmpa_tl + } + \prop_map_inline:Nn \g__codedoc_missing_tests_prop + { + \tl_put_right:Nn \l__codedoc_tmpa_tl {^^J\space\space\space\space ##1 ^^J\space\space\space\space\space\space ##2} - } - } - \seq_if_empty:NF \g_doc_not_tested_seq - { - \tl_put_right:Nn \l_doc_tmpa_tl - { + } + } + \seq_if_empty:NF \g__codedoc_not_tested_seq + { + \tl_put_right:Nn \l__codedoc_tmpa_tl + { ^^J^^J The~ following~ macro(s)~ do~ not~ have~ any~ tests:^^J - } - \seq_map_inline:Nn \g_doc_not_tested_seq - { + } + \seq_map_inline:Nn \g__codedoc_not_tested_seq + { \clist_map_inline:nn {##1} - { - \tl_put_right:Nn \l_doc_tmpa_tl {^^J\space\space\space\space ####1} - } - } + { + \tl_put_right:Nn \l__codedoc_tmpa_tl {^^J\space\space\space\space ####1} + } + } \int_set:Nn \l_tmpa_int {\etex_interactionmode:D} \errorstopmode - \ClassError{l3doc}{\l_doc_tmpa_tl}{} + \ClassError{l3doc}{\l__codedoc_tmpa_tl}{} \int_set:Nn \etex_interactionmode:D {\l_tmpa_int} - } - } - } -} -\AtEndDocument{ \doc_show_not_tested: } + } + } + } + } +\AtEndDocument{ \__codedoc_show_not_tested: } \g@addto@macro\theindex{\MakePrivateLetters} \cs_set:Npn \verbatimchar {&} \setcounter{IndexColumns}{2} -\IndexPrologue{ +\IndexPrologue + { \part*{Index} \markboth{Index}{Index} \addcontentsline{toc}{part}{Index} @@ -1308,64 +1403,80 @@ corresponding~entry~is~described,~ numbers~underlined~point~to~the~definition,~ all~others~indicate~the~places~where~it~is~used. -} + } -\cs_set_nopar:Npn \doc_special_main_index:n #1 { +\cs_set_nopar:Npn \__codedoc_special_main_index:n #1 + { \HD@target - \index{ + \index + { \@gobble#1 \actualchar \string\verb\quotechar*\verbatimchar#1\verbatimchar \encapchar hdclindex{\the\c@HD@hypercount}{usage} - } -} -\cs_generate_variant:Nn \doc_special_main_index:n { o , x } + } + } +\cs_generate_variant:Nn \__codedoc_special_main_index:n { o , x } \msg_new:nnn {l3doc} {print-index-howto} - { - Generate~the~index~by~executing\\ - \iow_indent:n { makeindex~-s~l3doc.ist~-o~\c_job_name_tl .ind~\c_job_name_tl .idx } - } + { + Generate~the~index~by~executing\\ + \iow_indent:n { makeindex~-s~l3doc.ist~-o~\c_job_name_tl .ind~\c_job_name_tl .idx } + } \tl_gput_right:Nn \PrintIndex { \AtEndDocument{ \msg_info:nn {l3doc} {print-index-howto} } } -\GlossaryPrologue{ +\GlossaryPrologue + { \part*{Change~History} {\GlossaryParms\ttfamily\hyphenchar\font=`\-} \markboth{Change~History}{Change~History} \addcontentsline{toc}{part}{Change~History} -} + } \msg_new:nnn {l3doc} {print-changes-howto} - { - Generate~the~change~list~by~executing\\ - \iow_indent:n { makeindex~-s~gglo.ist~-o~\c_job_name_tl .gls~\c_job_name_tl .glo } - } + { + Generate~the~change~list~by~executing\\ + \iow_indent:n { makeindex~-s~gglo.ist~-o~\c_job_name_tl .gls~\c_job_name_tl .glo } + } \tl_gput_right:Nn \PrintChanges { \AtEndDocument{ \msg_info:nn {l3doc} {print-changes-howto} } } -\bool_if:NTF \g_doc_full_bool { +\bool_if:NTF \g__codedoc_full_bool + { \RecordChanges \CodelineIndex \EnableCrossrefs \AlsoImplementation -}{ + } + { \CodelineNumbered \DisableCrossrefs \OnlyDescription -} -\cs_new_nopar:Npn\Team{% - The~\LaTeX3~Project\thanks{% - Frank~Mittelbach,~Denys~Duchier,~Chris~Rowley,~ - Rainer~Sch\"opf,~Johannes~Braams,~Michael~Downes,~ - David~Carlisle,~Alan~Jeffrey,~Morten~H\o{}gholm,~Thomas~Lotze,~ - Javier~Bezos,~Will~Robertson,~Joseph~Wright,~Bruno~Le~Floch}} + } +\tl_new:N \Team +\tl_set:Nn \Team + { + The~\LaTeX3~Project\thanks + { + Frank~Mittelbach,~Denys~Duchier,~Chris~Rowley,~ + Rainer~Sch\"opf,~Johannes~Braams,~Michael~Downes,~ + David~Carlisle,~Alan~Jeffrey,~Morten~H\o{}gholm,~Thomas~Lotze,~ + Javier~Bezos,~Will~Robertson,~Joseph~Wright,~Bruno~Le~Floch + } + } \NewDocumentCommand{\ExplMakeTitle}{mm} { - \title + \title + { + The~\pkg{#1}~package \\ #2 + \thanks { - The~\pkg{#1}~package \\ #2 - \thanks{This~file~describes~v\ExplFileVersion,~ - last~revised~\ExplFileDate.} + This~file~describes~v\ExplFileVersion,~ + last~revised~\ExplFileDate. } - \author{The~\LaTeX3~Project\thanks{E-mail:~ + } + \author + { + The~\LaTeX3~Project\thanks{E-mail:~ \href{mailto:latex-l@listserv.uni-heidelberg.de} - {latex-l@listserv.uni-heidelberg.de}}} + {latex-l@listserv.uni-heidelberg.de}} + } \date{Released~\ExplFileDate} \maketitle } @@ -1374,14 +1485,14 @@ \DeclareDocumentCommand\Ie{}{\emph{I.e.}} \DeclareDocumentCommand\Eg{}{\emph{E.g.}} \AtBeginDocument - { - \clist_map_inline:nn - { - asin, acos, atan, acot, - asinh, acosh, atanh, acoth, round, floor, ceil - } - { \exp_args:Nc \DeclareMathOperator{#1}{#1} } - } + { + \clist_map_inline:nn + { + asin, acos, atan, acot, + asinh, acosh, atanh, acoth, round, floor, ceil + } + { \exp_args:Nc \DeclareMathOperator{#1}{#1} } + } \NewDocumentCommand { \nan } { } { \text { \texttt { nan } } } %% %% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty b/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty index 234f1e45a27..f7a458e9a88 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty @@ -45,13 +45,12 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3expan.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3expan.dtx 4073 2012-08-10 01:33:13Z bruno $ {L3 Argument expansion} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__expl_package_check: -\cs_new_nopar:Npn \l__exp_internal_tl { } \cs_new:Npn \__exp_arg_next:nnn #1#2#3 { #2 \::: { #3 {#1} } } \cs_new:Npn \__exp_arg_next:Nnn #1#2#3 { #2 \::: { #3 #1 } } \cs_new:Npn \::: #1 {#1} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty index e0642b967a3..c222c3a6358 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3file.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3file.dtx 4059 2012-08-08 13:12:06Z bruno $ {L3 File and I/O operations} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -328,7 +328,14 @@ \cs_new_protected:Npn \ior_get:NN #1#2 { \tex_read:D #1 to #2 } \cs_new_protected:Npn \ior_get_str:NN #1#2 - { \etex_readline:D #1 to #2 } + { + \use:x + { + \int_set_eq:NN \tex_endlinechar:D \c_minus_one + \exp_not:n { \etex_readline:D #1 to #2 } + \int_set:Nn \tex_endlinechar:D { \int_use:N \tex_endlinechar:D } + } + } \cs_new_eq:NN \c_log_iow \c_minus_one \cs_new_eq:NN \c_term_iow \c_sixteen \cs_new_eq:NN \c__iow_streams_tl \c__ior_streams_tl @@ -401,7 +408,7 @@ { \int_compare:nNnF #1 > \c_fifteen { - \tex_closeout:D #1 + \tex_immediate:D \tex_closeout:D #1 \prop_gremove:NV \g__iow_streams_prop #1 \cs_gset_eq:NN #1 \c_term_iow } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty index a7680dc7803..3918bd5a161 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty @@ -58,8 +58,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{l3names} -\GetIdInfo$Id: l3fp.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3fp.dtx 4089 2012-08-14 04:52:20Z bruno $ {L3 Floating points} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -146,6 +146,8 @@ \exp_after:wN 0 \fi: } +\cs_new:Npn \__fp_neg_sign:N #1 + { \__int_eval:w \c_two - #1 \__int_eval_end: } \cs_new:Npn \__fp_sanitize:Nw #1 #2; { \if_case:w \if_int_compare:w #2 > \c__fp_max_exponent_int \c_one \else: @@ -221,8 +223,15 @@ \int_const:Nn \c__fp_big_trailing_shift_int { 15 2374 * 10000 } \cs_new:Npn \__fp_pack_big:NNNNNNw #1#2 #3#4#5#6 #7; { + #1#2#3#4#5#6 ; {#7} } +\int_const:Nn \c__fp_Bigg_leading_shift_int { - 20 0000 } +\int_const:Nn \c__fp_Bigg_middle_shift_int { 20 0000 * 9999 } +\int_const:Nn \c__fp_Bigg_trailing_shift_int { 20 0000 * 10000 } +\cs_new:Npn \__fp_pack_Bigg:NNNNNNw #1#2 #3#4#5#6 #7; + { + #1#2#3#4#5#6 ; {#7} } \cs_new:Npn \__fp_pack_twice_four:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9 { #1 {#2#3#4#5} {#6#7#8#9} ; } +\cs_new:Npn \__fp_pack_eight:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9 + { #1 {#2#3#4#5#6#7#8#9} ; } \cs_new:Npn \__fp_decimate:nNnnnn #1 { \cs:w @@ -245,7 +254,7 @@ { \exp_after:wN ##1 \__int_value:w - \exp_after:wN \__fp_decimate_round:Nw #2 ; + \exp_after:wN \__fp_round_digit:Nw #2 ; \__fp_decimate_pack:nnnnnnnnnnw #3 ; } } @@ -265,17 +274,6 @@ \__fp_tmp:w {xiv} {\use_none:nn #2#3+#4#5} { 00{0000}0000{0000}#2 #3 #4 #5 } \__fp_tmp:w {xv} {\use_none:n #2#3+#4#5} { 000{0000}0000{0000}#2 #3 #4 #5 } \__fp_tmp:w {xvi} { #2#3+#4#5} {{0000}0000{0000}0000 #2 #3 #4 #5 } -\cs_new:Npn \__fp_decimate_round:Nw #1 #2; - { - \if_int_odd:w \if_meaning:w 0 #1 \c_one \else: - \if_meaning:w 5 #1 \c_one \else: - \c_zero \fi: \fi: - \if_int_compare:w \__int_eval:w #2 > \c_zero - \__int_eval:w 1 + - \fi: - \fi: - #1 - } \cs_new:Npn \__fp_decimate_pack:nnnnnnnnnnw #1#2#3#4#5 { \__fp_decimate_pack_ii:nnnnnnw { #1#2#3#4#5 } } \cs_new:Npn \__fp_decimate_pack_ii:nnnnnnw #1 #2#3#4#5#6 @@ -288,6 +286,8 @@ { \fi: \__fp_exp_after_o:w \s__fp } \cs_new:Npn \__fp_case_return_o:Nww #1#2 \fi: #3 \s__fp #4 ; #5 ; { \fi: \exp_after:wN #1 } +\cs_new:Npn \__fp_case_return_i_o:ww #1 \fi: #2 \s__fp #3 ; \s__fp #4 ; + { \fi: \__fp_exp_after_o:w \s__fp #3 ; } \cs_new:Npn \__fp_case_return_ii_o:ww #1 \fi: #2 \s__fp #3 ; { \fi: \__fp_exp_after_o:w } \cs_new:Npn \__fp_small_int:wTF \s__fp \__fp_chk:w #1 @@ -321,7 +321,7 @@ \exp_after:wN \__fp_small_int_true:wTF \__int_value:w \if_meaning:w 2 #5 - \fi: #3 \else: - \exp_after:wN \use_iii:nnn + \exp_after:wN \use_i:nn \fi: } \cs_new:Npn \__fp_array_count:w #1 @ @@ -375,11 +375,11 @@ %% %% ----------------------------------------------------------------------- %% -\cs_new_protected:Npn \__fp_flag_off:n #1 +\cs_new_protected:Npn \fp_flag_off:n #1 { \cs_set_eq:cN { l__fp_ #1 _flag_token } \c_undefined:D } -\cs_new:Npn \__fp_flag_on:n #1 +\cs_new:Npn \fp_flag_on:n #1 { \exp_args:Nc \use_none:n { l__fp_ #1 _flag_token } } -\prg_new_conditional:Npnn \__fp_if_flag_on:n #1 { p , T , F , TF } +\prg_new_conditional:Npnn \fp_if_flag_on:n #1 { p , T , F , TF } { \if_cs_exist:w l__fp_ #1 _flag_token \cs_end: \prg_return_true: @@ -391,7 +391,7 @@ \cs_new_eq:NN \l__fp_division_by_zero_flag_token \c_undefined:D \cs_new_eq:NN \l__fp_overflow_flag_token \c_undefined:D \cs_new_eq:NN \l__fp_underflow_flag_token \c_undefined:D -\cs_new_protected:Npn \__fp_trap:nn #1#2 +\cs_new_protected:Npn \fp_trap:nn #1#2 { \cs_if_exist_use:cF { __fp_trap_#1_set_#2: } { @@ -408,64 +408,78 @@ \cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_error: { \__fp_trap_invalid_operation_set:N \prg_do_nothing: } \cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_flag: - { \__fp_trap_invalid_operation_set:N \use_none:nn } + { \__fp_trap_invalid_operation_set:N \use_none:nnnnn } \cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_none: - { \__fp_trap_invalid_operation_set:N \use_none:nnnn } + { \__fp_trap_invalid_operation_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_invalid_operation_set:N #1 { - \__fp_trap_invalid_operation_set:Nnn #1 - { invalid_operation } { Invalid~operation~ } + \exp_args:Nno \use:n + { \cs_set:Npn \__fp_invalid_operation:nnw ##1##2##3; } + { + #1 + \__fp_error:nffn { invalid } {##2} { \__fp_to_tl:w ##3; } { } + \fp_flag_on:n { invalid_operation } + ##1 + } + \exp_args:Nno \use:n + { \cs_set:Npn \__fp_invalid_operation_o:Nww ##1##2; ##3; } + { + #1 + \__fp_error:nffn { invalid-ii } + { \__fp_to_tl:w ##2; } { \__fp_to_tl:w ##3; } {##1} + \fp_flag_on:n { invalid_operation } + \exp_after:wN \c_nan_fp + } + \exp_args:Nno \use:n + { \cs_set:Npn \__fp_array_invalid_operation_o:nw ##1##2@ } + { + #1 + \__fp_error:nffn { invalid } + {##1} { \__fp_array_to_clist:w ##2 @ } { } + \fp_flag_on:n { invalid_operation } + \exp_after:wN \c_nan_fp + } } \cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_error: { \__fp_trap_division_by_zero_set:N \prg_do_nothing: } \cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_flag: - { \__fp_trap_division_by_zero_set:N \use_none:nn } + { \__fp_trap_division_by_zero_set:N \use_none:nnnnn } \cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_none: - { \__fp_trap_division_by_zero_set:N \use_none:nnnn } + { \__fp_trap_division_by_zero_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_division_by_zero_set:N #1 { - \__fp_trap_invalid_operation_set:Nnn #1 - { division_by_zero } { Division~by~zero~in~ } - } -\cs_new_protected:Npn \__fp_trap_invalid_operation_set:Nnn #1#2#3 - { \exp_args:Nno \use:n - { \cs_set:cpn { __fp_ #2 :Nnw } ##1##2##3; } + { \cs_set:Npn \__fp_division_by_zero_o:Nnw ##1##2##3; } { #1 - \__fp_error:x { { #3 ##2 } ( \__fp_to_tl:w ##3; ) } - \__fp_flag_on:n {#2} + \__fp_error:nffn { zero-div } {##2} { \__fp_to_tl:w ##3; } { } + \fp_flag_on:n { division_by_zero } \exp_after:wN ##1 } \exp_args:Nno \use:n - { \cs_set:cpn { __fp_ #2 :Nnww } ##1##2##3; ##4; } + { \cs_set:Npn \__fp_division_by_zero_o:NNww ##1##2##3; ##4; } { #1 - \__fp_error:x - { - {#3} - \tl_if_single:nTF {##2} - { ( \__fp_to_tl:w ##3; ) ##2 ( \__fp_to_tl:w ##4; ) } - { { ##2 ( } \__fp_to_tl:w ##3; { , ~ } \__fp_to_tl:w ##4; ) } - } - \__fp_flag_on:n {#2} + \__fp_error:nffn { zero-div-ii } + { \__fp_to_tl:w ##3; } { \__fp_to_tl:w ##4; } {##2} + \fp_flag_on:n { division_by_zero } \exp_after:wN ##1 } } \cs_new_protected_nopar:Npn \__fp_trap_overflow_set_error: { \__fp_trap_overflow_set:N \prg_do_nothing: } \cs_new_protected_nopar:Npn \__fp_trap_overflow_set_flag: - { \__fp_trap_overflow_set:N \use_none:nn } + { \__fp_trap_overflow_set:N \use_none:nnnnn } \cs_new_protected_nopar:Npn \__fp_trap_overflow_set_none: - { \__fp_trap_overflow_set:N \use_none:nnnn } + { \__fp_trap_overflow_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_overflow_set:N #1 { \__fp_trap_overflow_set:NnNn #1 { overflow } \__fp_inf_fp:N { inf } } \cs_new_protected_nopar:Npn \__fp_trap_underflow_set_error: { \__fp_trap_underflow_set:N \prg_do_nothing: } \cs_new_protected_nopar:Npn \__fp_trap_underflow_set_flag: - { \__fp_trap_underflow_set:N \use_none:nn } + { \__fp_trap_underflow_set:N \use_none:nnnnn } \cs_new_protected_nopar:Npn \__fp_trap_underflow_set_none: - { \__fp_trap_underflow_set:N \use_none:nnnn } + { \__fp_trap_underflow_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_underflow_set:N #1 { \__fp_trap_overflow_set:NnNn #1 { underflow } \__fp_zero_fp:N { 0 } } \cs_new_protected:Npn \__fp_trap_overflow_set:NnNn #1#2#3#4 @@ -474,46 +488,46 @@ { \cs_set:cpn { __fp_ #2 :w } \s__fp \__fp_chk:w ##1##2##3; } { #1 - \__fp_error:x - { - \token_if_eq_meaning:NNTF 1 ##1 - { - \__fp_to_tl:w \s__fp \__fp_chk:w ##1##2##3; ~ #2 ed ~ to ~ - \token_if_eq_meaning:NNF 0 ##2 { - } #4 . - } - { An~#2~occurred. } - } - \__fp_flag_on:n {#2} + \__fp_error:nffn + { flow \if_meaning:w 1 ##1 -to \fi: } + { \__fp_to_tl:w \s__fp \__fp_chk:w ##1##2##3; } + { \token_if_eq_meaning:NNF 0 ##2 { - } #4 } + {#2} + \fp_flag_on:n {#2} #3 ##2 } } -\cs_new_protected_nopar:Npn \__fp_invalid_operation:Nnw { } -\cs_new_protected_nopar:Npn \__fp_invalid_operation:Nnww { } -\cs_new_protected_nopar:Npn \__fp_division_by_zero:Nnw { } -\cs_new_protected_nopar:Npn \__fp_division_by_zero:Nnww { } -\cs_new_protected_nopar:Npn \__fp_overflow:w { } -\cs_new_protected_nopar:Npn \__fp_underflow:w { } -\__fp_trap:nn { invalid_operation } { error } -\__fp_trap:nn { division_by_zero } { flag } -\__fp_trap:nn { overflow } { flag } -\__fp_trap:nn { underflow } { flag } -\cs_new_eq:NN \__fp_error:n \__msg_expandable_error:n -\cs_new:Npn \__fp_error:x #1 - { - \exp_args:Nf \__msg_expandable_error:n - { - \__fp_error_loop:nwnN { \exp_stop_f: } #1 \prg_do_nothing: - \s__fp_mark { } \__fp_error_loop:nwnN \s__fp_mark { } \__fp_error_end:nw - } +\cs_new:Npn \__fp_invalid_operation:nnw #1#2#3; { } +\cs_new:Npn \__fp_invalid_operation_o:Nww #1#2; #3; { } +\cs_new:Npn \__fp_array_invalid_operation_o:nw #1 #2 @ { } +\cs_new:Npn \__fp_division_by_zero_o:Nnw #1#2#3; { } +\cs_new:Npn \__fp_division_by_zero_o:NNww #1#2#3; #4; { } +\cs_new:Npn \__fp_overflow:w { } +\cs_new:Npn \__fp_underflow:w { } +\fp_trap:nn { invalid_operation } { error } +\fp_trap:nn { division_by_zero } { flag } +\fp_trap:nn { overflow } { flag } +\fp_trap:nn { underflow } { flag } +\cs_new_nopar:Npn \__fp_invalid_operation_o:nw + { \__fp_invalid_operation:nnw { \exp_after:wN \c_nan_fp } } +\cs_new:Npn \__fp_error:nnnn #1 + { \__msg_kernel_expandable_error:nnnnn { kernel } { fp - #1 } } +\cs_generate_variant:Nn \__fp_error:nnnn { nff } +\cs_new:Npn \__fp_array_to_clist:w #1 @ + { + \__fp_array_to_clist_i:wwww ; + #1 + \__fp_array_to_clist_ii:ww \s__fp ; @ } -\cs_new:Npn \__fp_error_end:nw #1#2 \__fp_error_end:nw { #1 } -\cs_new:Npn \__fp_error_loop:nwnN #1#2 \s__fp_mark #3 #4 +\cs_new:Npn \__fp_array_to_clist_i:wwww #1; #2 \s__fp #3; #4 @ { - \exp_after:wN #4 \tex_romannumeral:D -`0 #2 - \s__fp_mark { #3 #1 } #4 + \exp_after:wN \__fp_array_to_clist_i:wwww + \tex_romannumeral:D -`0 \__fp_to_tl:w \s__fp #3 ; ; + #4 , ~ #1 @ } -\msg_new:nnnn { kernel } { unknown-fpu-exception } +\cs_new:Npn \__fp_array_to_clist_ii:ww #1 ; , ~ , ~ #2 @ {#2} +\__msg_kernel_new:nnnn { kernel } { unknown-fpu-exception } { The~FPU~exception~'#1'~is~not~known:~that~trap~will~never~be~triggered. } { The~only~exceptions~to~which~traps~can~be~attached~are \\ @@ -525,7 +539,7 @@ * ~ underflow } } -\msg_new:nnnn { kernel } { unknown-fpu-trap-type } +\__msg_kernel_new:nnnn { kernel } { unknown-fpu-trap-type } { The~FPU~trap~type~'#2'~is~not~known. } { The~trap~type~must~be~one~of \\ @@ -536,6 +550,18 @@ * ~ none } } +\__msg_kernel_new:nnn { kernel } { fp-flow } + { An ~ #3 ~ occurred. } +\__msg_kernel_new:nnn { kernel } { fp-flow-to } + { #1 ~ #3 ed ~ to ~ #2 . } +\__msg_kernel_new:nnn { kernel } { fp-zero-div } + { Division~by~zero~in~ #1 (#2) } +\__msg_kernel_new:nnn { kernel } { fp-zero-div-ii } + { Division~by~zero~in~ (#1) #3 (#2) } +\__msg_kernel_new:nnn { kernel } { fp-invalid } + { Invalid~operation~ #1 (#2) } +\__msg_kernel_new:nnn { kernel } { fp-invalid-ii } + { Invalid~operation~ (#1) #3 (#2) } %% File: l3fp-round.dtx Copyright(C) 2011-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the @@ -620,21 +646,16 @@ #3 ; } -\cs_new:Npn \__fp_round:NNNN #1 #2 #3 #4 +\cs_new:Npn \__fp_round_digit:Nw #1 #2; { - \exp_after:wN \__fp_round:NNN - \exp_after:wN #1 - \exp_after:wN #2 - \int_use:N \__int_eval:w - \if_int_odd:w 0 \if_meaning:w 0 #3 1 \fi: - \if_meaning:w 5 #3 1 \fi: - \exp_stop_f: - \if_int_compare:w #4 > \c_zero - 1 + - \fi: + \if_int_odd:w \if_meaning:w 0 #1 \c_one \else: + \if_meaning:w 5 #1 \c_one \else: + \c_zero \fi: \fi: + \if_int_compare:w \__int_eval:w #2 > \c_zero + \__int_eval:w \c_one + \fi: - #3 - \__int_eval_end: + \fi: + #1 } \cs_new:Npn \__fp_round_to_ninf_neg:NNN #1 #2 #3 { @@ -666,10 +687,7 @@ \cs_new:Npn \__fp_round:Nww #1#2 ; #3 ; { \__fp_small_int:wTF #3; { \__fp_round:Nwn #1#2; } - { - \__fp_error:x { {round(x,n)~with~n=} \__fp_to_tl:w #3; } - \exp_after:wN \c_nan_fp - } + { \__fp_array_invalid_operation_o:nw { round } #2; #3; @ } } \cs_new:Npn \__fp_round:Nwn #1 \s__fp \__fp_chk:w #2#3#4; #5 { @@ -872,7 +890,7 @@ } \s__fp #2 { - \__fp_error:n { Premature~end~in~fp~expression. } + \__msg_kernel_expandable_error:nn { kernel } { fp-early-end } \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 \__fp_parse_infix:NN #1 @@ -880,7 +898,8 @@ } \s__fp_mark { - \__fp_error:n { Erroneous~variable~#2 used! } + \__msg_kernel_expandable_error:nnn + { kernel } { bad-variable } {#2} \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 \exp_after:wN \__fp_parse_infix:NN @@ -937,7 +956,8 @@ { \cs_if_exist_use:cF { __fp_parse_word_#2:N } { - \__msg_expandable_error:n { Unknown~word~#2. } + \__msg_kernel_expandable_error:nnn + { kernel } { unknown-fp-word } {#2} \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 \__fp_parse_infix:NN @@ -957,13 +977,15 @@ { \cs_if_exist:cTF { __fp_parse_infix_#1:N } { - \__fp_error:n { Missing~number~before~'#1'. } + \__msg_kernel_expandable_error:nnn + { kernel } { fp-missing-number } {#1} \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 \__fp_parse_infix:NN #3 #1 } { - \__fp_error:n { Unknown~symbol~#1~ignored. } + \__msg_kernel_expandable_error:nnn + { kernel } { fp-unknown-symbol } {#1} \__fp_parse_operand:Nw #3 } } @@ -1211,10 +1233,14 @@ \if_catcode:w \tex_relax:D #1 \if_meaning:w \tex_relax:D #1 \if_int_compare:w \pdftex_strcmp:D { \s__fp } { #1 } = \c_zero - 0 \__fp_error:n { Cannot~use~floating~point~after~'e'. } + 0 + \__msg_kernel_expandable_error:nnn + { kernel } { fp-after-e } { floating~point~ } \prg_return_true: \else: - 0 \__fp_error:n { Erroneous~variable~#1 used. } + 0 + \__msg_kernel_expandable_error:nnn + { kernel } { bad-variable } {#1} \prg_return_false: \fi: \else: @@ -1223,12 +1249,16 @@ = \c_zero \__int_value:w #1 \else: - 0 \__fp_error:n { Cannot~use~a~dimension~(#1)~after~'e'. } + 0 + \__msg_kernel_expandable_error:nnn + { kernel } { fp-after-e } { dimension~#1 } \fi: \prg_return_false: \fi: \else: - 0 \__fp_error:n { Missing~exponent~after~'e'. } + 0 + \__msg_kernel_expandable_error:nnn + { kernel } { fp-missing } { exponent } \prg_return_true: \fi: } @@ -1398,7 +1428,7 @@ \cs_new:Npn \__fp_parse_infix_check:NNN #1#2#3 { \if_meaning:w \tex_relax:D #1 - \__msg_expandable_error:n { Missing~*~inserted. } + \__msg_kernel_expandable_error:nnn { kernel } { fp-missing } { * } \exp_after:wN \__fp_parse_infix_*:N \exp_after:wN #2 \exp_after:wN #3 @@ -1434,7 +1464,7 @@ \tex_romannumeral:D -`0 #4 #1 } \cs_new:Npn \__fp_parse_unary_type:N #1 - { \__fp_type_from_scan:N #1 :w \cs_end: #1 } + { \__fp_type_from_scan:N #1 _o:w \cs_end: #1 } \cs_set_protected:Npn \__fp_tmp:w #1 #2 { \cs_new_nopar:cpn { __fp_parse_word_#1:N } @@ -1497,9 +1527,8 @@ \__fp_parse_until:Nw \c_sixteen \__fp_parse_expand:w } } -\__fp_tmp:w \__fp_parse_word_max:N \__fp_max:w -\__fp_tmp:w \__fp_parse_word_min:N \__fp_min:w - % \__fp_tmp:w \__fp_parse_word_mod:N \__fp_mod:w %^^A todo: not implemented! +\__fp_tmp:w \__fp_parse_word_max:N \__fp_max_o:w +\__fp_tmp:w \__fp_parse_word_min:N \__fp_min_o:w \cs_new:Npn \__fp_parse_word_round:N #1#2 { \if_meaning:w + #2 @@ -1528,7 +1557,8 @@ \__fp_round:Nwn #2 #3 {0} \tex_romannumeral:D \or: \__fp_round:Nww #2 #3 \tex_romannumeral:D \else: - \__fp_error:n { round()~expects~1~or~2~arguments. } + \__msg_kernel_expandable_error:nnnnn + { kernel } { fp-num-args } { round() } { 1 } { 2 } \exp_after:wN \c_nan_fp \tex_romannumeral:D \fi: -`0 #4 #1 @@ -1576,7 +1606,7 @@ \tex_romannumeral:D \__fp_parse_expand:w } { - \__fp_error:n { Missing~')'~inserted. } + \__msg_kernel_expandable_error:nnn { kernel } { fp-missing } { ) } #2 @ \__fp_parse_stop_until:N #3 } } @@ -1689,50 +1719,44 @@ } \cs_new:Npn \__fp_parse_infix_excl_aux:NN #1#2 { - \if_catcode:w \tex_relax:D #2 - \__fp_parse_infix_excl_error: - \else: - \if_int_compare:w `#2 > `? \exp_stop_f: - \__fp_parse_infix_excl_error: - \else: - \if_int_compare:w `#2 < `< \exp_stop_f: - \__fp_parse_infix_excl_error: - \fi: - \fi: - \fi: \__fp_infix_compare:N #1 \c_zero_fp \c_one_fp \c_one_fp \c_one_fp \c_one_fp #2 } \cs_new:Npn \__fp_parse_infix_excl_error: - { \__msg_expandable_error:n { Missing~relation~symbol~after~'!'. } } + { + \__msg_kernel_expandable_error:nnnn + { kernel } { fp-missing } { = } { ~after~!. } + } \cs_new:Npn \__fp_infix_compare:N #1 { \if_int_compare:w #1 < \c_seven - \exp_after:wN \__fp_parse_compare:NNNNNw + \exp_after:wN \__fp_parse_compare:NNNNNNw + \exp_after:wN \__fp_parse_infix_excl_error: \else: \exp_after:wN @ \exp_after:wN \__fp_parse_stop_until:N \exp_after:wN \__fp_infix_compare:N \fi: } -\cs_new:Npn \__fp_parse_compare:NNNNNw #1#2#3#4#5#6 +\cs_new:Npn \__fp_parse_compare:NNNNNNw #1#2#3#4#5#6#7 { \if_case:w - \if_catcode:w \tex_relax:D #6 + \if_catcode:w \tex_relax:D #7 \c_minus_one \else: - \__int_eval:w `#6 - `< \__int_eval_end: + \__int_eval:w `#7 - `< \__int_eval_end: \fi: - \__fp_parse_compare_expand:NNNNNw #1#1#3#4#5 - \or: \__fp_parse_compare_expand:NNNNNw #1#2#1#4#5 - \or: \__fp_parse_compare_expand:NNNNNw #1#2#3#1#5 - \or: \__fp_parse_compare_expand:NNNNNw #1#2#3#4#1 - \else: \__fp_parse_compare_end:NNNN #2#3#4#5#6 + \__fp_parse_compare_expand:NNNNNw #2#2#4#5#6 + \or: \__fp_parse_compare_expand:NNNNNw #2#3#2#5#6 + \or: \__fp_parse_compare_expand:NNNNNw #2#3#4#2#6 + \or: \__fp_parse_compare_expand:NNNNNw #2#3#4#5#2 + \else: #1 \__fp_parse_compare_end:NNNN #3#4#5#6#7 \fi: } \cs_new:Npn \__fp_parse_compare_expand:NNNNNw #1#2#3#4#5 { - \exp_after:wN \__fp_parse_compare:NNNNNw + \exp_after:wN \__fp_parse_compare:NNNNNNw + \exp_after:wN \prg_do_nothing: \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 @@ -1760,7 +1784,7 @@ \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN - \if_case:w \__fp_compare:ww #2 #7 \exp_stop_f: + \if_case:w \__fp_compare_back:ww #7 #2 \exp_stop_f: #4 \or: #5 \or: #6 @@ -1787,7 +1811,8 @@ \cs_new:Npn \__fp_parse_infix_::N #1 { \if_int_compare:w #1 < \c_three - \__msg_expandable_error:n { Missing~'?'~inserted~for~'?:'. } + \__msg_kernel_expandable_error:nnnn + { kernel } { fp-missing } { ? } { ~for~?: } \exp_after:wN @ \exp_after:wN \__fp_ternary_ii:NwwN \tex_romannumeral:D @@ -1805,7 +1830,7 @@ \cs_new:Npn \__fp_parse_infix_):N #1 { \if_int_compare:w #1 < \c_zero - \__fp_error:n { Extra~')'~ignored. } + \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) } \exp_after:wN \__fp_parse_infix:NN \exp_after:wN #1 \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w @@ -1842,10 +1867,28 @@ { #1 @ \__fp_parse_stop_until:N } \cs_new:Npn \__fp_parse_infix_comma_gobble:w #1 @ { - \__fp_error:n { Unexpected~comma:~extra~arguments~ignored. } + \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma } @ \__fp_parse_stop_until:N } \group_end: +\__msg_kernel_new:nnn { kernel } { unknown-fp-word } + { Unknown~fp~word~#1. } +\__msg_kernel_new:nnn { kernel } { fp-missing } + { Missing~#1~inserted #2. } +\__msg_kernel_new:nnn { kernel } { fp-extra } + { Extra~#1~ignored. } +\__msg_kernel_new:nnn { kernel } { fp-early-end } + { Premature~end~in~fp~expression. } +\__msg_kernel_new:nnn { kernel } { fp-after-e } + { Cannot~use~#1 after~'e'. } +\__msg_kernel_new:nnn { kernel } { fp-missing-number } + { Missing~number~before~'#1'. } +\__msg_kernel_new:nnn { kernel } { fp-unknown-symbol } + { Unknown~symbol~#1~ignored. } +\__msg_kernel_new:nnn { kernel } { fp-extra-comma } + { Unexpected~comma:~extra~arguments~ignored. } +\__msg_kernel_new:nnn { kernel } { fp-num-args } + { #1~expects~between~#2~and~#3~arguments. } %% File: l3fp-logic.dtx Copyright (C) 2011-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the @@ -1887,29 +1930,56 @@ \cs_new_eq:NN \fp_if_exist:cT \cs_if_exist:cT \cs_new_eq:NN \fp_if_exist:cF \cs_if_exist:cF \cs_new_eq:NN \fp_if_exist_p:c \cs_if_exist_p:c -\cs_new:Npn \__fp_compare:ww \s__fp \__fp_chk:w #1#2#3; \s__fp \__fp_chk:w #4#5#6; +\prg_new_conditional:Npnn \fp_compare:n #1 { p , T , F , TF } + { + \exp_after:wN \__fp_compare_return:w + \tex_romannumeral:D -`0 \__fp_parse:n {#1} + } +\cs_new:Npn \__fp_compare_return:w \s__fp \__fp_chk:w #1#2; + { + \if_meaning:w 0 #1 + \prg_return_false: + \else: + \prg_return_true: + \fi: + } +\prg_new_conditional:Npnn \fp_compare:nNn #1#2#3 { p , T , F , TF } + { + \if_int_compare:w + \exp_after:wN \__fp_compare_aux:wn + \tex_romannumeral:D -`0 \__fp_parse:n {#1} {#3} + = \__int_eval:w `#2 - `= \__int_eval_end: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\cs_new:Npn \__fp_compare_aux:wn #1; #2 + { + \exp_after:wN \__fp_compare_back:ww + \tex_romannumeral:D -`0 \__fp_parse:n {#2} #1; + } +\cs_new:Npn \__fp_compare_back:ww + \s__fp \__fp_chk:w #1 #2 #3; + \s__fp \__fp_chk:w #4 #5 #6; { \__int_value:w \if_meaning:w 3 #1 \exp_after:wN \__fp_compare_nan:w \fi: \if_meaning:w 3 #4 \exp_after:wN \__fp_compare_nan:w \fi: - \if_meaning:w 2 #2 - \fi: + \if_meaning:w 2 #5 - \fi: \if_meaning:w #2 #5 \if_meaning:w #1 #4 \if_meaning:w 1 #1 - \__fp_compare_mantissa:ww #3; #6; + \__fp_compare_npos:nwnw #6; #3; \else: 0 \fi: \else: - \if_int_compare:w #1 < #4 - \fi: 1 + \if_int_compare:w #4 < #1 - \fi: 1 \fi: \else: - \if_meaning:w 0 #1 - \if_meaning:w 0 #4 - 0 - \else: - 1 - \fi: + \if_int_compare:w #1#4 = \c_zero + 0 \else: 1 \fi: @@ -1917,7 +1987,7 @@ \exp_stop_f: } \cs_new:Npn \__fp_compare_nan:w #1 \exp_stop_f: { \c_two } -\cs_new:Npn \__fp_compare_mantissa:ww #1#2; #3#4; +\cs_new:Npn \__fp_compare_npos:nwnw #1#2; #3#4; { \if_int_compare:w #1 = #3 \exp_stop_f: \__fp_compare_mantissa:nnnnnnnn #2 #4 @@ -1927,54 +1997,63 @@ } \cs_new:Npn \__fp_compare_mantissa:nnnnnnnn #1#2#3#4#5#6#7#8 { - \if_int_compare:w #1 = #5 \exp_stop_f: - \if_int_compare:w #2 = #6 \exp_stop_f: - \if_int_compare:w #3 = #7 \exp_stop_f: - \if_int_compare:w #4 = #8 \exp_stop_f: - 0 - \else: - \if_int_compare:w #4 < #8 - \fi: 1 - \fi: - \else: - \if_int_compare:w #3 < #7 - \fi: 1 - \fi: + \if_int_compare:w #1#2 = #5#6 \exp_stop_f: + \if_int_compare:w #3#4 = #7#8 \exp_stop_f: + 0 \else: - \if_int_compare:w #2 < #6 - \fi: 1 + \if_int_compare:w #3#4 < #7#8 - \fi: 1 \fi: \else: - \if_int_compare:w #1 < #5 - \fi: 1 + \if_int_compare:w #1#2 < #5#6 - \fi: 1 \fi: } -\prg_new_conditional:Npnn \fp_compare:nNn #1#2#3 { p , T , F , TF } +\cs_new:Npn \__fp_max_o:w #1 @ { - \if_int_compare:w - \exp_after:wN \__fp_compare_aux:wn - \tex_romannumeral:D -`0 \__fp_parse:n {#3} {#1} - = \__int_eval:w `#2 - `= \__int_eval_end: - \prg_return_true: - \else: - \prg_return_false: - \fi: - } -\cs_new:Npn \__fp_compare_aux:wn #1; #2 - { - \exp_after:wN \__fp_compare:ww - \tex_romannumeral:D -`0 \__fp_parse:n {#2} #1; + \exp_after:wN \__fp_minmax_loop:Nww + \exp_after:wN \c_minus_one + \c_minus_inf_fp + #1 + \s__fp \__fp_chk:w { 3 \__fp_minmax_break_o:w } ; } -\prg_new_conditional:Npnn \fp_compare:n #1 { p , T , F , TF } +\cs_new:Npn \__fp_min_o:w #1 @ { - \exp_after:wN \__fp_compare_aux:w - \tex_romannumeral:D -`0 \__fp_parse:n {#1} + \exp_after:wN \__fp_minmax_loop:Nww + \exp_after:wN \c_one + \c_inf_fp + #1 + \s__fp \__fp_chk:w { 3 \__fp_minmax_break_o:w } ; } -\cs_new:Npn \__fp_compare_aux:w \s__fp \__fp_chk:w #1#2; +\cs_new:Npn \__fp_minmax_loop:Nww + #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5; { - \if_meaning:w 0 #1 - \prg_return_false: + \if_meaning:w 3 #4 + \if_meaning:w 3 #2 + \__fp_minmax_i:ww + \else: + \__fp_minmax_ii:ww + \fi: \else: - \prg_return_true: + \if_int_compare:w + \__fp_compare_back:ww + \s__fp \__fp_chk:w #4#5; + \s__fp \__fp_chk:w #2#3; + = #1 + \__fp_minmax_ii:ww + \else: + \__fp_minmax_i:ww + \fi: \fi: + \__fp_minmax_loop:Nww #1 + \s__fp \__fp_chk:w #2#3; + \s__fp \__fp_chk:w #4#5; } -\cs_new:Npn \__fp_not:w \s__fp \__fp_chk:w #1#2; +\cs_new:Npn \__fp_minmax_i:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4; + { \fi: \fi: #2 \s__fp #3 ; } +\cs_new:Npn \__fp_minmax_ii:ww #1 \fi: \fi: #2 \s__fp #3 ; + { \fi: \fi: #2 } +\cs_new:Npn \__fp_minmax_break_o:w #1 \fi: \fi: #2 \s__fp #3; #4; + { \fi: \__fp_exp_after_o:w \s__fp #3; } +\cs_new:Npn \__fp_not_o:w \s__fp \__fp_chk:w #1#2; { \if_meaning:w 0 #1 \exp_after:wN \exp_after:wN \exp_after:wN \c_one_fp @@ -1982,15 +2061,18 @@ \exp_after:wN \exp_after:wN \exp_after:wN \c_zero_fp \fi: } -\cs_new:cpn { __fp_ \iow_char:N \& _o:ww } #1 \s__fp \__fp_chk:w #2#3; - { - \if_meaning:w 0 #2 #1 - \__fp_and_return:wNw \s__fp \__fp_chk:w #2#3; - \fi: - \__fp_exp_after_o:w - } -\cs_new_nopar:cpx { __fp_ \iow_char:N \| _o:ww } - { \exp_not:c { __fp_ \iow_char:N \& _o:ww } \exp_not:N \else: } +\group_begin: + \char_set_catcode_letter:N & + \char_set_catcode_letter:N | + \cs_new:Npn \__fp_&_o:ww #1 \s__fp \__fp_chk:w #2#3; + { + \if_meaning:w 0 #2 #1 + \__fp_and_return:wNw \s__fp \__fp_chk:w #2#3; + \fi: + \__fp_exp_after_o:w + } + \cs_new_nopar:Npn \__fp_|_o:ww { \__fp_&_o:ww \else: } +\group_end: \cs_new:Npn \__fp_and_return:wNw #1; \fi: #2#3; { \fi: #2 #1; } \cs_new:Npn \__fp_ternary:NwwN #1 #2@ #3@ #4 { @@ -2007,7 +2089,8 @@ \__fp_parse_until:Nw \c_two \__fp_parse_expand:w \else: - \__fp_error:n { Missing~':'~clause~for~'?:'. } + \__msg_kernel_expandable_error:nnnn + { kernel } { fp-missing } { : } { ~for~?: } \exp_after:wN \__fp_parse_until_test:NwN \exp_after:wN #1 \tex_romannumeral:D -`0 @@ -2045,54 +2128,6 @@ \__fp_parse_exp_after_array:wf #3 \s__fp_stop #4 #1 } -\cs_new:Npn \__fp_max:w #1@ - { - \exp_after:wN \__fp_minmax_loop:Nww - \exp_after:wN \c_minus_one - \c_minus_inf_fp - #1 - \s__fp \__fp_chk:w { 3 \__fp_minmax_break:w } ; - } -\cs_new:Npn \__fp_min:w #1@ - { - \exp_after:wN \__fp_minmax_loop:Nww - \exp_after:wN \c_one - \c_inf_fp - #1 - \s__fp \__fp_chk:w { 3 \__fp_minmax_break:w } ; - } -\cs_new:Npn \__fp_minmax_loop:Nww - #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5; - { - \if_meaning:w 3 #4 - \if_meaning:w 3 #2 - \__fp_minmax_i:ww - \else: - \__fp_minmax_ii:ww - \fi: - \else: - \if_int_compare:w \__fp_compare:ww \s__fp \__fp_chk:w #2#3; - \s__fp \__fp_chk:w #4#5; = #1 - \__fp_minmax_ii:ww - \else: - \__fp_minmax_i:ww - \fi: - \fi: - \__fp_minmax_loop:Nww #1 - \s__fp \__fp_chk:w #2#3; - \s__fp \__fp_chk:w #4#5; - } -\cs_new:Npn \__fp_minmax_i:ww - #1 \__fp_minmax_loop:Nww #2 \s__fp #3; \s__fp #4; - { #1 \__fp_minmax_loop:Nww #2 \s__fp #3; } -\cs_new:Npn \__fp_minmax_ii:ww - #1 \__fp_minmax_loop:Nww #2 \s__fp #3; \s__fp #4; - { #1 \__fp_minmax_loop:Nww #2 \s__fp #4; } -\cs_new:Npn \__fp_minmax_break:w #1 \__fp_minmax_loop:Nww #2 #3; #4; - { - \fi: - \__fp_exp_after_o:w #3; - } %% File: l3fp-basics.dtx Copyright (C) 2011-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the @@ -2142,159 +2177,138 @@ } \cs_new:Npn \__fp_basics_pack_high_carry:w \fi: ; #1 { \fi: + \c_one ; {1000} } -\cs_new:Npn \__fp_basics_return_nan_nan:NNww #1#2 #3; #4; - { \__fp_exp_after_o:w \s__fp \__fp_chk:w 3 1 #3 ; } -\cs_new:Npn \__fp_basics_return_zero:NNww #1#2 #3; #4; - { - \if_meaning:w #1 #2 - \exp_after:wN \exp_after:wN \exp_after:wN \c_zero_fp - \else: - \exp_after:wN \exp_after:wN \exp_after:wN \c_minus_zero_fp - \fi: - } -\cs_new:Npn \__fp_basics_return_inf:NNww #1#2 #3; #4; +\cs_new:Npn \__fp_basics_pack_weird_low:NNNNw #1 #2#3#4 #5; { - \if_meaning:w #1 #2 - \exp_after:wN \exp_after:wN \exp_after:wN \c_inf_fp - \else: - \exp_after:wN \exp_after:wN \exp_after:wN \c_minus_inf_fp + \if_meaning:w 2 #1 + + \c_one \fi: + \__int_eval_end: + #2#3#4; {#5} ; } -\cs_new:Npn \__fp_basics_return_i:NNNNww #1#2 #3#4 #5; #6; - { \__fp_exp_after_o:w \s__fp \__fp_chk:w #1 #3 #5; } -\cs_new:Npn \__fp_basics_return_ii:NNNNww #1#2 #3#4 #5; #6; - { \__fp_exp_after_o:w \s__fp \__fp_chk:w #2 #4 #6; } -\cs_new:Npn \__fp_basics_return_nan:NNww #1#2 +\cs_new:Npn \__fp_basics_pack_weird_high:NNNNNNNNw + 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} } +\cs_new_nopar:cpx { __fp_-_o:ww } \s__fp { - \if_meaning:w 1 #1 - \exp_after:wN \__fp_basics_return_i:NNNNww - \else: - \exp_after:wN \__fp_basics_return_ii:NNNNww - \fi: - 3 3 #1 #2 + \exp_not:c { __fp_+_o:ww } + \exp_not:n { \s__fp \__fp_neg_sign:N } } \cs_new:cpn { __fp_+_o:ww } - \s__fp \__fp_chk:w #1 #2 #3 ; \s__fp \__fp_chk:w #4 #5 - { \__fp_add_cases:NN #1 #4 #2 #5 #3 ; } -\cs_new:cpn { __fp_-_o:ww } - \s__fp \__fp_chk:w #1 #2 #3 ; \s__fp \__fp_chk:w #4 #5 + \s__fp #1 \__fp_chk:w #2 #3 ; \s__fp \__fp_chk:w #4 #5 { - \exp_after:wN \__fp_add_cases:NN - \exp_after:wN #1 - \exp_after:wN #4 - \exp_after:wN #2 - \int_use:N \__int_eval:w \c_two - #5 \__int_eval_end: - #3 ; - } -\cs_new:Npn \__fp_add_cases:NN #1 #2 - { - \if_int_compare:w #1 = #2 \exp_stop_f: - \exp_after:wN \__fp_add_cases_eq:N - \else: - \if_int_compare:w #1 < #2 \exp_stop_f: - \exp_after:wN \exp_after:wN - \exp_after:wN \__fp_basics_return_ii:NNNNww + \if_case:w + \if_meaning:w #2 #4 + #2 \exp_stop_f: \else: - \exp_after:wN \exp_after:wN - \exp_after:wN \__fp_basics_return_i:NNNNww + \if_int_compare:w #2 > #4 \exp_stop_f: + \c_three + \else: + \c_minus_one + \fi: \fi: - \exp_after:wN #1 - \fi: - #2 - } -\cs_new:Npn \__fp_add_cases_eq:N #1 - { - \if_case:w #1 \exp_stop_f: - \exp_after:wN \__fp_add_zeros:NNww - \or: \exp_after:wN \__fp_add_normal:NNww - \or: \exp_after:wN \__fp_add_inf:NNww - \or: \exp_after:wN \__fp_basics_return_nan_nan:NNww - \fi: + \exp_after:wN \__fp_add_zeros_o:Nww \__int_value:w + \or: \exp_after:wN \__fp_add_normal_o:Nww \__int_value:w + \or: \exp_after:wN \__fp_add_inf_o:Nww \__int_value:w + \or: \__fp_case_return_i_o:ww + \else: \exp_after:wN \__fp_add_return_ii_o:Nww \__int_value:w + \fi: + #1 #5 + \s__fp \__fp_chk:w #2 #3 ; + \s__fp \__fp_chk:w #4 #5 } -\cs_new:Npn \__fp_add_zeros:NNww #1#2 #3; +\cs_new:Npn \__fp_add_return_ii_o:Nww #1 #2 ; \s__fp \__fp_chk:w #3 #4 + { \__fp_exp_after_o:w \s__fp \__fp_chk:w #3 #1 } +\cs_new:Npn \__fp_add_zeros_o:Nww #1 \s__fp \__fp_chk:w 0 #2 { - \if_int_compare:w #1 #2 = 02 \exp_stop_f: - \__fp_case_return_o:Nw \c_zero_fp + \if_int_compare:w #2 #1 = 20 \exp_stop_f: + \exp_after:wN \__fp_add_return_ii_o:Nww \else: - \__fp_case_return_same_o:w + \__fp_case_return_i_o:ww \fi: + #1 \s__fp \__fp_chk:w 0 #2 } -\cs_new:Npn \__fp_add_inf:NNww #1#2 #3; +\cs_new:Npn \__fp_add_inf_o:Nww + #1 \s__fp \__fp_chk:w 2 #2 #3; \s__fp \__fp_chk:w 2 #4 { \if_meaning:w #1 #2 - \__fp_case_return_same_o:w + \__fp_case_return_i_o:ww \else: \__fp_case_use:nw { - \__fp_invalid_operation:Nnww \c_nan_fp { + } - \s__fp \__fp_chk:w 2 #1 #3 ; + \if_meaning:w #1 #4 + \exp_after:wN \__fp_invalid_operation_o:Nww + \exp_after:wN + + \else: + \exp_after:wN \__fp_invalid_operation_o:Nww + \exp_after:wN - + \fi: } \fi: - \s__fp \__fp_chk:w 2 #2 + \s__fp \__fp_chk:w 2 #2 #3; + \s__fp \__fp_chk:w 2 #4 } -\cs_new:Npn \__fp_add_normal:NNww #1#2 +\cs_new:Npn \__fp_add_normal_o:Nww #1 \s__fp \__fp_chk:w 1 #2 { \if_meaning:w #1#2 - \exp_after:wN \__fp_add_npos:Nnwnw + \exp_after:wN \__fp_add_npos_o:NnwNnw \else: - \exp_after:wN \__fp_sub_npos:Nnwnw + \exp_after:wN \__fp_sub_npos_o:NnwNnw \fi: - #1 + #2 } -\cs_new:Npn \__fp_add_npos:Nnwnw #1 #2#3; #4 +\cs_new:Npn \__fp_add_npos_o:NnwNnw #1#2#3 ; \s__fp \__fp_chk:w 1 #4 #5 { \exp_after:wN \__fp_sanitize:Nw \exp_after:wN #1 \int_use:N \__int_eval:w - \if_int_compare:w #2 > #4 \exp_stop_f: + \if_int_compare:w #2 > #5 \exp_stop_f: #2 - \exp_after:wN \__fp_add_big_i:wNww \__int_value:w - + \exp_after:wN \__fp_add_big_i_o:wNww \__int_value:w - \else: - #4 - \exp_after:wN \__fp_add_big_ii:wNww \__int_value:w + #5 + \exp_after:wN \__fp_add_big_ii_o:wNww \__int_value:w \fi: - \__int_eval:w #4 - #2 ; #1 #3; + \__int_eval:w #5 - #2 ; #1 #3; } -\cs_new:Npn \__fp_add_big_i:wNww #1; #2 #3; #4; +\cs_new:Npn \__fp_add_big_i_o:wNww #1; #2 #3; #4; { \__fp_decimate:nNnnnn {#1} - \__fp_add_mantissa:NnnwnnnnN + \__fp_add_mantissa_o:NnnwnnnnN #4 #3 #2 } -\cs_new:Npn \__fp_add_big_ii:wNww #1; #2 #3; #4; +\cs_new:Npn \__fp_add_big_ii_o:wNww #1; #2 #3; #4; { \__fp_decimate:nNnnnn {#1} - \__fp_add_mantissa:NnnwnnnnN + \__fp_add_mantissa_o:NnnwnnnnN #3 #4 #2 } -\cs_new:Npn \__fp_add_mantissa:NnnwnnnnN #1 #2#3 #4; #5#6#7#8 +\cs_new:Npn \__fp_add_mantissa_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8 { - \exp_after:wN \__fp_add_mantissa_test:N + \exp_after:wN \__fp_add_mantissa_test_o:N \int_use:N \__int_eval:w 1#5#6 + #2 \exp_after:wN \__fp_add_mantissa_pack:NNNNNNN \int_use:N \__int_eval:w 1#7#8 + #3 ; #1 } \cs_new:Npn \__fp_add_mantissa_pack:NNNNNNN #1 #2#3#4#5#6#7 { - \if:w 2 #1 + \if_meaning:w 2 #1 + \c_one \fi: ; #2 #3 #4 #5 #6 #7 ; } -\cs_new:Npn \__fp_add_mantissa_test:N #1 +\cs_new:Npn \__fp_add_mantissa_test_o:N #1 { - \if:w 2 #1 - \exp_after:wN \__fp_add_mantissa_carry:wwNNNN + \if_meaning:w 2 #1 + \exp_after:wN \__fp_add_mantissa_carry_o:wwwNN \else: - \exp_after:wN \__fp_add_mantissa_no_carry:wwNNNN + \exp_after:wN \__fp_add_mantissa_no_carry_o:wwwNN \fi: } -\cs_new:Npn \__fp_add_mantissa_no_carry:wwNNNN +\cs_new:Npn \__fp_add_mantissa_no_carry_o:wwwNN #1; #2; #3#4 ; #5#6 { \exp_after:wN \__fp_basics_pack_high:NNNNNw @@ -2304,205 +2318,220 @@ + \__fp_round:NNN #6 #4 #5 \exp_after:wN ; } -\cs_new:Npn \__fp_add_mantissa_carry:wwNNNN +\cs_new:Npn \__fp_add_mantissa_carry_o:wwwNN #1; #2; #3#4; #5#6 { + \c_one - \exp_after:wN \__fp_add_mantissa_carry_pack:NNNNNNNNw - \int_use:N \__int_eval:w 1 #1 - \exp_after:wN \__fp_add_mantissa_carry_pack_ii:NNNNw - \int_use:N \__int_eval:w 1 #2#3 - + \__fp_round:NNNN #6 #3 #4 #5 + \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw + \int_use:N \__int_eval:w 1 1 #1 + \exp_after:wN \__fp_basics_pack_weird_low:NNNNw + \int_use:N \__int_eval:w 1 #2#3 + + \exp_after:wN \__fp_round:NNN + \exp_after:wN #6 + \exp_after:wN #3 + \__int_value:w \__fp_round_digit:Nw #4 #5 ; \exp_after:wN ; } -\cs_new:Npn \__fp_add_mantissa_carry_pack_ii:NNNNw #1 #2#3#4 #5; +\cs_new:Npn \__fp_sub_npos_o:NnwNnw #1#2#3; \s__fp \__fp_chk:w 1 #4#5#6; { - \if:w 2 #1 - + \c_one + \if_case:w \__fp_compare_npos:nwnw {#2} #3; {#5} #6; \exp_stop_f: + \exp_after:wN \__fp_sub_eq_o:Nnwnw + \or: + \exp_after:wN \__fp_sub_npos_i_o:Nnwnw + \else: + \exp_after:wN \__fp_sub_npos_ii_o:Nnwnw \fi: - \__int_eval_end: - #2#3#4; {#5} ; + #1 {#2} #3; {#5} #6; } -\cs_new:Npn \__fp_add_mantissa_carry_pack:NNNNNNNNw - #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} } -\cs_new:Npn \__fp_sub_npos:Nnwnw #1 #2#3; #4 #5; +\cs_new:Npn \__fp_sub_eq_o:Nnwnw #1#2; #3; { \exp_after:wN \c_zero_fp } +\cs_new:Npn \__fp_sub_npos_ii_o:Nnwnw #1 #2; #3; { - \exp_after:wN \__fp_sanitize:wN - \int_use:N \__int_eval:w - \if_int_compare:w #2 > #4 \exp_stop_f: - #2 - \exp_after:wN \__fp_sub_big_i:wNww \__int_value:w - - \else: - #4 - \if_int_compare:w #2 = #4 \exp_stop_f: - \__fp_sub_exponent_eq:nnnnnnnn #3 #5 - \else: - \exp_after:wN \__fp_sub_big_ii:wNww \__int_value:w - \fi: - \fi: - \__int_eval:w #4 - #2 ; #1 #3; #5; + \exp_after:wN \__fp_sub_npos_i_o:Nnwnw + \int_use:N \__int_eval:w \c_two - #1 \__int_eval_end: + #3; #2; } -\cs_new:Npn \__fp_sub_exponent_eq:nnnnnnnn #1#2#3#4 #5#6#7#8 +\cs_new:Npn \__fp_sub_npos_i_o:Nnwnw #1 #2#3; #4#5; { - \if_int_compare:w #1#2 > #5#6 \exp_stop_f: - \exp_after:wN \__fp_sub_big_i:wNww \__int_value:w - \else: - \if_int_compare:w #1#2 < #5#6 \exp_stop_f: - \exp_after:wN \__fp_sub_big_ii:wNww \__int_value:w + \exp_after:wN \__fp_sanitize:Nw + \exp_after:wN #1 + \int_use:N \__int_eval:w + #2 + \if_int_compare:w #2 = #4 \exp_stop_f: + \exp_after:wN \__fp_sub_back_near_o:nnnnnnnnN \else: - \if_int_compare:w #3#4 > #7#8 \exp_stop_f: - \exp_after:wN \__fp_sub_big_i:wNww \__int_value:w - \else: - \if_int_compare:w #3#4 < #7#8 \exp_stop_f: - \exp_after:wN \__fp_sub_big_ii:wNww \__int_value:w - \else: - \exp_after:wN \__fp_sub_eq:wNww \__int_value:w - \fi: - \fi: + \exp_after:wN \__fp_decimate:nNnnnn \exp_after:wN + { \int_use:N \__int_eval:w #2 - #4 - \c_one \exp_after:wN } + \exp_after:wN \__fp_sub_back_far_o:NnnwnnnnN \fi: - \fi: + #5 + #3 + #1 } -\cs_new:Npn \__fp_sub_eq:wNww #1; #2 #3; #4; - { \exp_after:wN ; \exp_after:wN 1 \exp_after:wN ; } -\cs_new:Npn \__fp_sub_big_i:wNww #1; #2 #3; #4; +\cs_new:Npn \__fp_sub_back_near_o:nnnnnnnnN #1#2#3#4 #5#6#7#8 #9 { - \__fp_decimate:nNnnnn {#1} - \__fp_sub_back_mantissa:NnnwNnnnn - #4 - #2 - #3 + \exp_after:wN \__fp_sub_back_near_after:wNNNNw + \int_use:N \__int_eval:w 10#5#6 - #1#2 - \c_eleven + \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw + \int_use:N \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ; } -\cs_new:Npn \__fp_sub_big_ii:wNww #1; #2 #3; #4; +\cs_new:Npn \__fp_sub_back_near_pack:NNNNNNw #1#2#3#4#5#6#7 ; + { + #1#2 ; {#3#4#5#6} {#7} ; } +\cs_new:Npn \__fp_sub_back_near_after:wNNNNw 10 #1#2#3#4 #5 ; { - \exp_after:wN \__fp_sub_big_i:wNww - \__int_value:w #1 \exp_after:wN ; - \int_use:N \__int_eval:w 2 - #2 \__int_eval_end: - #4; #3; + \if_meaning:w 0 #1 + \exp_after:wN \__fp_sub_back_shift:wnnnn + \fi: + ; {#1#2#3#4} {#5} } -\cs_new:Npn \__fp_sub_back_mantissa:NnnwNnnnn #1 #2#3 #4; #5 #6#7#8#9 +\cs_new:Npn \__fp_sub_back_shift:wnnnn ; #1#2 { - \exp_after:wN \__fp_sub_back_mantissa_i:NNwNNNNwN - \exp_after:wN #1 - \exp_after:wN #5 - \int_use:N \__int_eval:w 2#6#7 - #2 - \c_two + - \exp_after:wN \__fp_sub_back_mantissa_round:wNN - \int_use:N \__int_eval:w 2#8#9 - #3 ; #1 #5 + \exp_after:wN \__fp_sub_back_shift_ii:ww + \__int_value:w #1 #2 0 ; } -\cs_new:Npn \__fp_sub_back_mantissa_round:wNN #1; #2 #3 +\cs_new:Npn \__fp_sub_back_shift_ii:ww #1 0 ; #2#3 ; { - \exp_after:wN \__fp_sub_back_mantissa_iii:N - \__int_value:w - \exp_after:wN \__fp_round_neg:NNN - \exp_after:wN #3 - \use_none:nnnnnnnn #1 #2 - + #1 + \if_meaning:w @ #1 @ + - \c_seven + - \exp_after:wN \use_i:nnn + \exp_after:wN \__fp_sub_back_shift_iii:NNNNNNNNw + \__int_value:w #2#3 0 ~ 123456789; + \else: + - \__fp_sub_back_shift_iii:NNNNNNNNw #1 123456789; + \fi: + \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN + \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN + \exp_after:wN \__fp_sub_back_shift_iv:nnnnw \exp_after:wN ; + \__int_value:w + #1 ~ #2#3 0 ~ 0000 0000 0000 000 ; } -\cs_new:Npn \__fp_sub_back_mantissa_iii:N #1 - { - \exp_after:wN \__fp_sub_back_mantissa_ii:NNNNNNw - \exp_after:wN #1 - \int_use:N \__int_eval:w - - #1 - } -\cs_new:Npn \__fp_sub_back_mantissa_ii:NNNNNNw #1 #2 #3#4#5#6 #7; - { #2 ; #1 {#3#4#5#6} {#7} ; } -\cs_new:Npn \__fp_sub_back_mantissa_i:NNwNNNNwN #1#2 #3 #4#5#6#7 #8; #9 +\cs_new:Npn \__fp_sub_back_shift_iii:NNNNNNNNw #1#2#3#4#5#6#7#8#9; {#8} +\cs_new:Npn \__fp_sub_back_shift_iv:nnnnw #1 ; #2 ; { ; #1 ; } +\cs_new:Npn \__fp_sub_back_far_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8 { - \if:w 0 #4 - \exp_after:wN \__fp_sub_back_carry:NNwNnnnn - \exp_after:wN #1 - \exp_after:wN #9 + \if_case:w + \if_int_compare:w 1 #2 = #5#6 \use_i:nnnn #7 \exp_stop_f: + \if_int_compare:w #3 = \use_none:n #7#8 0 \exp_stop_f: + \c_zero + \else: + \if_int_compare:w #3 > \use_none:n #7#8 0 - \fi: \c_one + \fi: + \else: + \if_int_compare:w 1 #2 > #5#6 \use_i:nnnn #7 - \fi: \c_one + \fi: + \exp_after:wN \__fp_sub_back_quite_far_o:wwNN + \or: \exp_after:wN \__fp_sub_back_very_far_o:wwwwNN + \else: \exp_after:wN \__fp_sub_back_not_far_o:wwwwNN \fi: - ; #2 - {#4#5#6#7} {#8} + #2 ~ #3 ; #5 #6 ~ #7 #8 ; #1 } -\cs_new:Npn \__fp_sub_back_carry:NNwNnnnn #1#2 ; #3 #4#5#6#7 ; +\cs_new:Npn \__fp_sub_back_quite_far_o:wwNN #1; #2; #3#4 { - \exp_after:wN \__fp_sub_back_carry_i:wwN - \int_use:N \__int_eval:w #4 #5 - 1 + \exp_after:wN \__fp_use_s:n - \int_use:N \__int_eval:w 1 #6 #7 0 + #2 0 - #1 ; #3 + \exp_after:wN \__fp_sub_back_quite_far_ii:NN + \exp_after:wN #3 + \exp_after:wN #4 } -\cs_new:Npn \__fp_sub_back_carry_i:wwN #1 ; +\cs_new:Npn \__fp_sub_back_quite_far_ii:NN #1#2 { - \if:w 0 #1 - - 8 - \exp_after:wN \__fp_sub_back_carry_small:wN \__int_value:w + \if_case:w \__fp_round_neg:NNN #2 0 #1 + \exp_after:wN \use_i:nn \else: - - \__fp_sub_back_carry_ii:NNNNNNNNw #1 1234567; - \exp_after:wN \__fp_sub_back_carry_large:NNNNNNNNw + \exp_after:wN \use_ii:nn \fi: - #1 + { ; {1000} {0000} {0000} {0000} ; } + { - \c_one ; {9999} {9999} {9999} {9999} ; } } -\cs_new:Npn \__fp_sub_back_carry_ii:NNNNNNNNw #1#2#3#4#5#6#7#8#9; {#8} -\cs_new:Npn \__fp_sub_back_carry_large:NNNNNNNNw #1#2#3#4 #5#6#7#8 #9; - { - \__fp_sub_back_carry_large_ii:NNNNNNNNw - #9 000000 ; {#1#2#3#4} {#5#6#7#8} - } -\cs_new:Npn \__fp_sub_back_carry_large_ii:NNNNNNNNw #1#2#3#4 #5#6#7#8 #9; - { \__fp_sub_back_carry_large_iii:nnnnN {#1#2#3#4} {#5#6#7#8} } -\cs_new:Npn \__fp_sub_back_carry_large_iii:nnnnN #1#2 #3#4 #5 - { ; #5 {#3}{#4} {#1}{#2} ; } -\cs_new:Npn \__fp_sub_back_carry_small:wN #1; - { - - \exp_after:wN \__fp_use_i_until_s:nw - \use_none:nnnnnnnnn #1 012345678; - \__fp_sub_back_carry_small_ii:NNNNNNNN #1 00000000 ; - } -\cs_new:Npn \__fp_sub_back_carry_small_ii:NNNNNNNN #1#2#3#4 #5#6#7#8 - { \__fp_sub_back_carry_small_iii:nnNwN {#1#2#3#4} {#5#6#7#8} } -\cs_new:Npn \__fp_sub_back_carry_small_iii:nnNwN #1 #2 #3 #4; #5 - { ; #5 {#1} {#2} {#3000} {0000} ; } -\cs_new:cpn { __fp_*_o:ww } - \s__fp \__fp_chk:w #1 #2 #3 ; \s__fp \__fp_chk:w #4 #5 - { \__fp_mul_cases:NN #1 #4 #2 #5 #3 ; } -\cs_new:Npn \__fp_mul_cases:NN #1 #2 - { - \if_case:w \if_meaning:w 1 #1 #2 \else: - \if_meaning:w 1 #2 #1 \else: - \if_meaning:w #1#2 #1 \else: - \if_int_compare:w \__int_eval:w #1 + #2 > \c_two - 3 \else: 4 \fi: \fi: \fi: \fi: - \exp_stop_f: - \exp_after:wN \__fp_basics_return_zero:NNww - \or: \exp_after:wN \__fp_mul_normal:NNww - \or: \exp_after:wN \__fp_basics_return_inf:NNww - \or: \exp_after:wN \__fp_basics_return_nan:NNww - \or: - \exp_after:wN \__fp_mul_invalid:NNNNww - \exp_after:wN #1 - \exp_after:wN #2 - \fi: +\cs_new:Npn \__fp_sub_back_not_far_o:wwwwNN #1 ~ #2; #3 ~ #4; #5#6 + { + - \c_one + \exp_after:wN \__fp_sub_back_near_after:wNNNNw + \int_use:N \__int_eval:w 1#30 - #1 - \c_eleven + \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw + \int_use:N \__int_eval:w 11 0000 0000 + #40 - #2 + - \exp_after:wN \__fp_round_neg:NNN + \exp_after:wN #6 + \use_none:nnnnnnn #2 #5 + \exp_after:wN ; } -\cs_new:Npn \__fp_mul_invalid:NNNNww #1#2#3#4#5; #6; +\cs_new:Npn \__fp_sub_back_very_far_o:wwwwNN #1#2#3#4#5#6#7 { - \__fp_invalid_operation:Nnww \c_nan_fp { * } - \s__fp \__fp_chk:w #1 #3 #5 ; - \s__fp \__fp_chk:w #2 #4 #6 ; + \__fp_pack_eight:wNNNNNNNN + \__fp_sub_back_very_far_ii_o:nnNwwNN + { 0 #1#2#3 #4#5#6#7 } + ; } -\cs_new:Npn \__fp_mul_normal:NNww #1#2 +\cs_new:Npn \__fp_sub_back_very_far_ii_o:nnNwwNN #1#2 ; #3 ; #4 ~ #5; #6#7 { - \if:w #1#2 - \exp_after:wN \__fp_mul_npos:Nnwnw - \exp_after:wN 0 - \else: - \exp_after:wN \__fp_mul_npos:Nnwnw - \exp_after:wN 2 + \exp_after:wN \__fp_basics_pack_high:NNNNNw + \int_use:N \__int_eval:w 1#4 - #1 - \c_one + \exp_after:wN \__fp_basics_pack_low:NNNNNw + \int_use:N \__int_eval:w 2#5 - #2 + - \exp_after:wN \__fp_round_neg:NNN + \exp_after:wN #7 + \__int_value:w + \if_int_odd:w \__int_eval:w #5 - #2 \__int_eval_end: + 1 \else: 2 \fi: + \__int_value:w \__fp_round_digit:Nw #3 #6 ; + \exp_after:wN ; + } +\cs_new_nopar:cpn { __fp_*_o:ww } + { + \__fp_mul_cases_o:NnNnww + * + { - \c_two + } + \__fp_mul_npos_o:Nww + { } + } +\cs_new:Npn \__fp_mul_cases_o:NnNnww + #1#2#3#4 \s__fp \__fp_chk:w #5#6#7; \s__fp \__fp_chk:w #8#9 + { + \if_case:w \__int_eval:w + \if_int_compare:w #5 #8 = \c_eleven + \c_one + \else: + \if_meaning:w 3 #8 + \c_three + \else: + \if_meaning:w 3 #5 + \c_two + \else: + \if_int_compare:w #5 #8 = \c_ten + \c_nine #2 - \c_two + \else: + (#5 #2 #8) / \c_two * \c_two + \c_seven + \fi: + \fi: + \fi: + \fi: + \if_meaning:w #6 #9 - \c_one \fi: + \__int_eval_end: + \__fp_case_use:nw { #3 0 } + \or: \__fp_case_use:nw { #3 2 } + \or: \__fp_case_return_i_o:ww + \or: \__fp_case_return_ii_o:ww + \or: \__fp_case_return_o:Nww \c_zero_fp + \or: \__fp_case_return_o:Nww \c_minus_zero_fp + \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 } + \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 } + \or: \__fp_case_return_o:Nww \c_inf_fp + \or: \__fp_case_return_o:Nww \c_minus_inf_fp + #4 \fi: + \s__fp \__fp_chk:w #5 #6 #7; + \s__fp \__fp_chk:w #8 #9 } -\cs_new:Npn \__fp_mul_npos:Nnwnw #1 #2#3; #4 #5; +\cs_new:Npn \__fp_mul_npos_o:Nww + #1 \s__fp \__fp_chk:w #2 #3 #4 #5 ; \s__fp \__fp_chk:w #6 #7 #8 #9 ; { \exp_after:wN \__fp_sanitize:Nw \exp_after:wN #1 \int_use:N \__int_eval:w - #2 + #4 - \__fp_mul_mantissa:nnnnNnnnn #3 #1 #5 - \exp_after:wN ; + #4 + #8 + \__fp_mul_mantissa_o:nnnnNnnnn #5 #1 #9 } -\cs_new:Npn \__fp_mul_mantissa:nnnnNnnnn #1#2#3#4 #5 #6#7#8#9 +\cs_new:Npn \__fp_mul_mantissa_o:nnnnNnnnn #1#2#3#4 #5 #6#7#8#9 { - \exp_after:wN \__fp_mul_mantissa_after:NNN + \exp_after:wN \__fp_mul_mantissa_test_f:NNN \exp_after:wN #5 \int_use:N \__int_eval:w 99990000 + #1*#6 + \exp_after:wN \__fp_mul_mantissa_keep:NNNNNw @@ -2516,229 +2545,174 @@ \exp_after:wN \__fp_mul_mantissa_drop:NNNNNw \int_use:N \__int_eval:w 99990000 + #3*#9 + #4*#8 + \exp_after:wN \__fp_mul_mantissa_drop:NNNNNw - \int_use:N \__int_eval:w 100000000 + #4*#9 \exp_after:wN ; + \int_use:N \__int_eval:w 100000000 + #4*#9 ; + ; \exp_after:wN ; } \cs_new:Npn \__fp_mul_mantissa_drop:NNNNNw #1#2#3#4#5 #6; { #1#2#3#4#5 ; + #6 } \cs_new:Npn \__fp_mul_mantissa_keep:NNNNNw #1#2#3#4#5 #6; { #1#2#3#4#5 ; #6 ; } -\cs_new:Npn \__fp_mul_mantissa_after:NNN #1 #2 #3 +\cs_new:Npn \__fp_mul_mantissa_test_f:NNN #1 #2 #3 { - \if:w 0 #3 - \exp_after:wN \__fp_mul_mantissa_small:NNwwwN + \if_meaning:w 0 #3 + \exp_after:wN \__fp_mul_mantissa_small_f:NNwwwN \else: - \exp_after:wN \__fp_mul_mantissa_large:NwwNNNN + \exp_after:wN \__fp_mul_mantissa_large_f:NwwNNNN \fi: #1 #3 } -\cs_new:Npn \__fp_mul_mantissa_large:NwwNNNN #1 #2; #3; #4#5#6#7; + +\cs_new:Npn \__fp_mul_mantissa_large_f:NwwNNNN #1 #2; #3; #4#5#6#7; + { \exp_after:wN \__fp_basics_pack_high:NNNNNw \int_use:N \__int_eval:w 1#2 \exp_after:wN \__fp_basics_pack_low:NNNNNw - \int_use:N \__int_eval:w 1#3#4#5#6#7 + \__fp_round_s:NNNw #1 #7 + \int_use:N \__int_eval:w 1#3#4#5#6#7 + + \exp_after:wN \__fp_round:NNN + \exp_after:wN #1 + \exp_after:wN #7 + \__int_value:w \__fp_round_digit:Nw } -\cs_new:Npn \__fp_mul_mantissa_small:NNwwwN #1 #2#3; #4; #5; + #6 +\cs_new:Npn \__fp_mul_mantissa_small_f:NNwwwN #1 #2#3; #4#5; #6; + #7 { - \c_one \exp_after:wN \__fp_basics_pack_high:NNNNNw - \int_use:N \__int_eval:w 1#3 - \exp_after:wN \__fp_mul_mantissa_small_pack:NNNNNNw - \int_use:N \__int_eval:w 1#4#5#6 + \__fp_round_s:NNNw #1 #6 - } -\cs_new:Npn \__fp_mul_mantissa_small_pack:NNNNNNw #1#2 #3#4#5#6 #7; - { - #2 - \if:w 2 #1 - + \c_ten - \fi: - ; {#3#4#5#6} {#7} ; - } -\cs_new:cpn { __fp_/_o:ww } - \s__fp \__fp_chk:w #1 #2 #3 ; \s__fp \__fp_chk:w #4 #5 #6 ; - { \__fp_div_back_cases:NN #4 #1 #5 #2 #6 ; #3 ; } -\cs_new:Npn \__fp_div_back_cases:NN #1 #2 - { - \if_case:w \if_int_compare:w #1 = #2 \exp_stop_f: - #1 \exp_stop_f: - \else: - \if_int_compare:w #1 < #2 \exp_stop_f: - \if:w 3 #2 \c_four \else: \c_five \fi: - \else: - \if:w 3 #1 \c_six \else: \c_seven \fi: - \fi: - \fi: - \exp_after:wN \__fp_div_back_invalid:NNNww \exp_after:wN 0 - \or: \exp_after:wN \__fp_div_back_normal:NNww - \or: \exp_after:wN \__fp_div_back_invalid:NNNww \exp_after:wN 2 - \or: \exp_after:wN \__fp_basics_return_nan_nan:NNww - \or: - \exp_after:wN \__fp_basics_return_ii:NNNNww - \exp_after:wN #1 - \exp_after:wN #2 - \or: \exp_after:wN \__fp_basics_return_inf:NNww - \or: - \exp_after:wN \__fp_basics_return_i:NNNNww - \exp_after:wN #1 - \exp_after:wN #2 - \or: \exp_after:wN \__fp_basics_return_zero:NNww - \fi: - } -\cs_new:Npn \__fp_div_back_invalid:NNNww #1#2#3 #4; #5; - { - \__fp_invalid_operation:Nnww \c_nan_fp { / } - \s__fp \__fp_chk:w #1 #3 #5 ; - \s__fp \__fp_chk:w #1 #2 #4 ; + \int_use:N \__int_eval:w 1#3#4 + \exp_after:wN \__fp_basics_pack_low:NNNNNw + \int_use:N \__int_eval:w 1#5#6#7 + + \exp_after:wN \__fp_round:NNN + \exp_after:wN #1 + \exp_after:wN #7 + \__int_value:w \__fp_round_digit:Nw } -\cs_new:Npn \__fp_div_back_normal:NNww #1#2 +\cs_new_nopar:cpn { __fp_/_o:ww } { - \if:w #1#2 - \exp_after:wN \__fp_div_back_npos:Nnwnw - \exp_after:wN 0 - \else: - \exp_after:wN \__fp_div_back_npos:Nnwnw - \exp_after:wN 2 - \fi: + \__fp_mul_cases_o:NnNnww + / + { - } + \__fp_div_npos_o:Nww + { + \or: + \__fp_case_use:nw + { \__fp_division_by_zero_o:NNww \c_inf_fp / } + \or: + \__fp_case_use:nw + { \__fp_division_by_zero_o:NNww \c_minus_inf_fp / } + } } -\cs_new:Npn \__fp_div_back_npos:Nnwnw #1 #2 #3#4#5#6; #7 #8; +\cs_new:Npn \__fp_div_npos_o:Nww + #1 \s__fp \__fp_chk:w 1 #2 #3 #4 ; \s__fp \__fp_chk:w 1 #5 #6 #7#8#9; { \exp_after:wN \__fp_sanitize:Nw \exp_after:wN #1 \int_use:N \__int_eval:w - #7 - #2 - \__fp_div_mantissa_i:wNwnn #3; #4; - #8 {#3}{#4}{#5}{#6} #1 - } -\cs_new:Npn \__fp_div_mantissa_i:wNwnn #1; #2 #3; #4 #5 - { - \exp_after:wN \__fp_div_mantissa_ii:ww - \int_use:N \__int_eval:w #1#2 + \c_one ; - #4 #5 ; - } -\cs_new:Npn \__fp_div_mantissa_ii:ww #1; #2; - { - \exp_after:wN \__fp_div_mantissa_iii:www - \__int_value:w #1 \exp_after:wN ; - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w #20/#1 + 999999 ; #2 ; + #3 - #6 + \exp_after:wN \__fp_div_mantissa_i_o:wnnw + \int_use:N \__int_eval:w #7 \use_i:nnnn #8 + \c_one ; + #4 + {#7}{#8}#9 ; + #1 } -\cs_new:Npn \__fp_div_mantissa_calc:Nwwnnnnnn 1#1#2; #3;#4#5 #6#7#8#9 +\cs_new:Npn \__fp_div_mantissa_i_o:wnnw #1 ; #2#3 #4 ; { - 1 #1 #2 \exp_after:wN ; + \exp_after:wN \__fp_div_mantissa_test_o:w \int_use:N \__int_eval:w - - 200000 + #3 - #2 * #6 - \if_meaning:w 1 #1 - - #6#70 - \fi: - + - \exp_after:wN \__fp_div_mantissa_calc_last:NNNNNN - \int_use:N \__int_eval:w - 1999800000 + #4 - #2*#7 - \if_meaning:w 1 #1 - - #80 - \fi: - + - \exp_after:wN \__fp_div_mantissa_calc_pack:NNNNNNw - \int_use:N \__int_eval:w - 1999800000 + #5 - #2*#8 - \if_meaning:w 1 #1 - - #90 - \fi: - + - \exp_after:wN \__fp_div_mantissa_calc_pack:NNNNNNw - \int_use:N \__int_eval:w 2000000000 - #2*#9 ; - {#6}{#7}{#8}{#9} - } -\cs_new:Npn \__fp_div_mantissa_calc_pack:NNNNNNw #1#2#3#4#5#6 #7; - { #1#2#3#4#5#6 ; {#7} } -\cs_new:Npn \__fp_div_mantissa_calc_last:NNNNNN #1#2#3#4#5#6 - { #1#2#3#4#5#6 \__int_eval_end: } -\cs_new:Npn \__fp_div_mantissa_iii:www #1; #2; #3; - { - \exp_after:wN \__fp_div_mantissa_iii_after:w - \int_use:N \__int_eval:w #2 - \exp_after:wN \__fp_div_mantissa_iv:www - \__int_value:w #1 \exp_after:wN ; - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w #30/#1 + 999999 ; - #3 ; + \exp_after:wN \__fp_div_mantissa_calc:wwnnnnnnn + \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; + #2 #3 ; + #4 + { \exp_after:wN \__fp_div_mantissa_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_div_mantissa_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_div_mantissa_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_div_mantissa_iii:wwnnnnn \__int_value:w #1 } } -\cs_new:Npn \__fp_div_mantissa_iv:www #1; #2; #3; +\cs_new:Npn \__fp_div_mantissa_calc:wwnnnnnnn 1#1 { - \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w #2 - \exp_after:wN \__fp_div_mantissa_v:www - \__int_value:w #1 \exp_after:wN ; - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w #30/#1 + 999999 ; - #3 ; - } -\cs_new:Npn \__fp_div_mantissa_v:www #1; #2; #3; + \if_meaning:w 1 #1 + \exp_after:wN \__fp_div_mantissa_calc_i:wwnnnnnnn + \else: + \exp_after:wN \__fp_div_mantissa_calc_ii:wwnnnnnnn + \fi: + } +\cs_new:Npn \__fp_div_mantissa_calc_i:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9 + { + 1 1 #1 + #9 \exp_after:wN ; + \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int + + #2 - #1 * #5 - #5#60 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int + + #3 - #1 * #6 - #70 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int + + #4 - #1 * #7 - #80 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int + - #1 * #8 ; + {#5}{#6}{#7}{#8} + } +\cs_new:Npn \__fp_div_mantissa_calc_ii:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9 + { + 1 0 #1 + #9 \exp_after:wN ; + \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int + + #2 - #1 * #5 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int + + #3 - #1 * #6 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int + + #4 - #1 * #7 + \exp_after:wN \__fp_pack_Bigg:NNNNNNw + \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int + - #1 * #8 ; + {#5}{#6}{#7}{#8} + } +\cs_new:Npn \__fp_div_mantissa_ii:wwn #1; #2;#3 { \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w #2 - \exp_after:wN \__fp_div_mantissa_vi:wwnnnn - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w #30/#1 + 999999 ; - #3 ; + \int_use:N \__int_eval:w + \exp_after:wN \__fp_div_mantissa_calc:wwnnnnnnn + \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ; } -\cs_new:Npn \__fp_div_mantissa_vi:wwnnnn #1; #2;#3#4 #5#6 +\cs_new:Npn \__fp_div_mantissa_iii:wwnnnnn #1; #2;#3#4#5 #6#7 { - \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w #10 - \exp_after:wN \__fp_div_mantissa_vii:wwnnnnnn - \int_use:N \__int_eval:w (\c_two*#2)/#5#6 ; % <- P - #2;{#3}{#4} - {#5}{#6} + 0 + \exp_after:wN \__fp_div_mantissa_iv:wwnnnnnnn + \int_use:N \__int_eval:w (\c_two * #2 #3) / #6 #7 ; % <- P + #2 ; {#3} {#4} {#5} + {#6} {#7} } -\cs_new:Npn \__fp_div_mantissa_vii:wwnnnnnn #1; #2;#3#4 #5#6#7#8 +\cs_new:Npn \__fp_div_mantissa_iv:wwnnnnnnn #1; #2;#3#4#5 #6#7#8#9 { + \c_five * #1 - \exp_after:wN \__fp_div_mantissa_ix:Nww - \int_use:N \__int_eval:w -20 + 2*#2 - #1*#5#6 + - \exp_after:wN \__fp_div_mantissa_viii:NNw - \int_use:N \__int_eval:w 199980 + 2*#3 - #1*#7 + - \exp_after:wN \__fp_div_mantissa_viii:NNw - \int_use:N \__int_eval:w 200000 + 2*#4 - #1*#8 ; ; + \exp_after:wN \__fp_div_mantissa_vi:Nw + \int_use:N \__int_eval:w -20 + 2*#2#3 - #1*#6#7 + + \exp_after:wN \__fp_div_mantissa_v:NN + \int_use:N \__int_eval:w 199980 + 2*#4 - #1*#8 + + \exp_after:wN \__fp_div_mantissa_v:NN + \int_use:N \__int_eval:w 200000 + 2*#5 - #1*#9 ; } -\cs_new:Npn \__fp_div_mantissa_viii:NNw #1#2#3; { #1#2 ; + #3 } -\cs_new:Npn \__fp_div_mantissa_ix:Nww #1#2;#3; +\cs_new:Npn \__fp_div_mantissa_v:NN #1#2 { #1#2 \__int_eval_end: + } +\cs_new:Npn \__fp_div_mantissa_vi:Nw #1#2; { \if_meaning:w 0 #1 - \exp_after:wN \__fp_div_mantissa_x:w - \int_use:N \__int_eval:w #3 + \if_int_compare:w \__int_eval:w #2 > \c_zero + \c_one \fi: \else: - \if_meaning:w - #1 - - - \else: - + - \fi: - \c_one - \fi: - ; - } -\cs_new:Npn \__fp_div_mantissa_x:w #1; - { - \if_int_compare:w #1 > \c_zero - + \c_one + \if_meaning:w - #1 - \else: + \fi: \c_one \fi: ; } \cs_new:Npn \__fp_div_mantissa_pack:NNN 1 #1 #2 { + #1 #2 ; } -\cs_new:Npn \__fp_div_mantissa_iii_after:w 10 #1 +\cs_new:Npn \__fp_div_mantissa_test_o:w 10 #1 { \if_meaning:w 0 #1 - \exp_after:wN \__fp_div_mantissa_small:wwwNNNNwN + \exp_after:wN \__fp_div_mantissa_small_o:wwwNNNNwN \else: - \exp_after:wN \__fp_div_mantissa_large:wwwNNNNwN + \exp_after:wN \__fp_div_mantissa_large_o:wwwNNNNwN \fi: #1 } -\cs_new:Npn \__fp_div_mantissa_small:wwwNNNNwN +\cs_new:Npn \__fp_div_mantissa_small_o:wwwNNNNwN 0 #1; #2; #3; #4#5#6#7#8; #9 { \exp_after:wN \__fp_basics_pack_high:NNNNNw @@ -2748,20 +2722,21 @@ + \__fp_round:NNN #9 #7 #8 \exp_after:wN ; } -\cs_new:Npn \__fp_div_mantissa_large:wwwNNNNwN +\cs_new:Npn \__fp_div_mantissa_large_o:wwwNNNNwN #1; #2; #3; #4#5#6#7#8; #9 { + \c_one - \exp_after:wN \__fp_div_mantissa_large_pack:NNNNNNNNw - \int_use:N \__int_eval:w 1 #1 #2 %<- 1+9d - \exp_after:wN \__fp_add_mantissa_carry_pack_ii:NNNNw - \int_use:N \__int_eval:w 1 #3 #4 #5 #6 - + \__fp_round:NNNN #9 #6 #7 #8 - \exp_after:wN ; + \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw + \int_use:N \__int_eval:w 1 #1 #2 + \exp_after:wN \__fp_basics_pack_weird_low:NNNNw + \int_use:N \__int_eval:w 1 #3 #4 #5 #6 + + \exp_after:wN \__fp_round:NNN + \exp_after:wN #9 + \exp_after:wN #6 + \__int_value:w \__fp_round_digit:Nw #7 #8 ; + \exp_after:wN ; } -\cs_new:Npn \__fp_div_mantissa_large_pack:NNNNNNNNw - 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} } -\cs_new:Npn \__fp_neg:w \s__fp \__fp_chk:w #1 #2 +\cs_new:Npn \__fp_neg_o:w \s__fp \__fp_chk:w #1 #2 { \exp_after:wN \__fp_exp_after_o:w \exp_after:wN \s__fp @@ -2769,8 +2744,14 @@ \exp_after:wN #1 \int_use:N \__int_eval:w \c_two - #2 \__int_eval_end: } -\cs_new:Npn \__fp_abs:w \s__fp \__fp_chk:w #1 #2 - { \__fp_exp_after_o:w \s__fp \__fp_chk:w #1 0 } +\cs_new:Npn \__fp_abs_o:w \s__fp \__fp_chk:w #1 #2 + { + \exp_after:wN \__fp_exp_after_o:w + \exp_after:wN \s__fp + \exp_after:wN \__fp_chk:w + \exp_after:wN #1 + \__int_value:w \if_meaning:w 1 #2 1 \else: 0 \fi: \exp_stop_f: + } %% File: l3fp-extended.dtx Copyright (C) 2011-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the @@ -3154,29 +3135,26 @@ \tl_const:Nn \c__fp_ln_ii_fixed_tl { {6931}{4718}{0559}{9453}{0941}{7232} } \tl_const:Nn \c__fp_ln_iii_fixed_tl {{10986}{1228}{8668}{1096}{9139}{5245} } \tl_const:Nn \c__fp_ln_iv_fixed_tl {{13862}{9436}{1119}{8906}{1883}{4464} } - % \tl_const:Nn \c__fp_ln_v_fixed_tl {{16094}{3791}{2434}{1003}{7460}{0759} } \tl_const:Nn \c__fp_ln_vi_fixed_tl {{17917}{5946}{9228}{0550}{0081}{2477} } \tl_const:Nn \c__fp_ln_vii_fixed_tl {{19459}{1014}{9055}{3133}{0510}{5353} } \tl_const:Nn \c__fp_ln_viii_fixed_tl{{20794}{4154}{1679}{8359}{2825}{1696} } \tl_const:Nn \c__fp_ln_ix_fixed_tl {{21972}{2457}{7336}{2193}{8279}{0490} } \tl_const:Nn \c__fp_ln_x_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991} } - %\tl_const:Nn \c__fp_ln_ten_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991} } -\cs_new:Npn \__fp_ln:w \s__fp \__fp_chk:w #1 #2 +\cs_new:Npn \__fp_ln_o:w \s__fp \__fp_chk:w #1 #2 { - \if_meaning:w 0 #1 - \__fp_case_use:nw - { \__fp_division_by_zero:Nnw \c_minus_inf_fp { ln } } - \fi: \if_meaning:w 2 #2 - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw \c_nan_fp { ln } } + \__fp_case_use:nw { \__fp_invalid_operation_o:nw { ln } } \fi: - \if_meaning:w 1 #1 \else: + \if_case:w #1 \exp_stop_f: + \__fp_case_use:nw + { \__fp_division_by_zero_o:Nnw \c_minus_inf_fp { ln } } + \or: + \else: \__fp_case_return_same_o:w \fi: - \__fp_ln_npos:w \s__fp \__fp_chk:w #1#2 + \__fp_ln_npos_o:w \s__fp \__fp_chk:w #1#2 } -\cs_new:Npn \__fp_ln_npos:w \s__fp \__fp_chk:w 10#1#2#3; +\cs_new:Npn \__fp_ln_npos_o:w \s__fp \__fp_chk:w 10#1#2#3; { %^^A todo: ln(1) should be "exact zero", not "underflow" \exp_after:wN \__fp_sanitize:Nw \__int_value:w % for the overall sign @@ -3215,8 +3193,8 @@ \exp_after:wN \__fp_ln_div_after:Nw \cs:w c__fp_ln_ \tex_romannumeral:D #1 _fixed_tl \exp_after:wN \cs_end: \__int_value:w - \exp_after:wN \__fp_ln_x_iv:nnnnnnnn - \tex_romannumeral:D -`0 + \exp_after:wN \__fp_ln_x_iv:wnnnnnnnn + \int_use:N \__int_eval:w \exp_after:wN \__fp_ln_x_iii_var:NNNNNw \int_use:N \__int_eval:w 9999 9999 + #1*#2#3 + \exp_after:wN \__fp_ln_x_iii:NNNNNw @@ -3224,46 +3202,41 @@ {20000} {0000} {0000} {0000} } %^^A todo: reoptimize (a generalization attempt failed). \cs_new:Npn \__fp_ln_x_iii:NNNNNw #1 #2#3#4#5 #6; { #1; {#2#3#4#5} {#6} } -\cs_new:Npn \__fp_ln_x_iii_var:NNNNNw #1 #2#3#4#5 #6; { {#1#2#3#4#5} {#6} } -\cs_new:Npn \__fp_ln_x_iv:nnnnnnnn #1#2#3#4 #5#6#7#8 +\cs_new:Npn \__fp_ln_x_iii_var:NNNNNw #1 #2#3#4#5 #6; { - \exp_after:wN \__fp_ln_div_i:w - \int_use:N \__int_eval:w #1 + \c_one ; - #5 #6 ; {#7} {#8} - {#1} {#2} {#3} {#4} + #1#2#3#4#5 + \c_one ; + {#1#2#3#4#5} {#6} + } +\cs_new:Npn \__fp_ln_x_iv:wnnnnnnnn #1; #2#3#4#5 #6#7#8#9 + { + \exp_after:wN \__fp_div_mantissa_pack:NNN + \int_use:N \__int_eval:w + \__fp_ln_div_i:w #1 ; + #6 #7 ; {#8} {#9} + {#2} {#3} {#4} {#5} + { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 } + { \exp_after:wN \__fp_ln_div_vi:wwn \__int_value:w #1 } } \cs_new:Npn \__fp_ln_div_i:w #1; { - \exp_after:wN \__fp_ln_div_ii:www - \__int_value:w #1 \exp_after:wN ; - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w 999999 + 2 0000 0000 / #1 ; % Q1 + \exp_after:wN \__fp_div_mantissa_calc:wwnnnnnnn + \int_use:N \__int_eval:w 999999 + 2 0000 0000 / #1 ; % Q1 } -\cs_set_protected:Npn \__fp_tmp:w #1#2 +\cs_new:Npn \__fp_ln_div_ii:wwn #1; #2;#3 % y; B1;B2 <- for k=1 { - \cs_new:Npn #1 ##1; ##2; ##3; % y; Q1; B1B2; <- for k=1 - { - \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w ##2 - \exp_after:wN #2 - \__int_value:w ##1 \exp_after:wN ; - \__int_value:w - \exp_after:wN \__fp_div_mantissa_calc:Nwwnnnnnn - \int_use:N \__int_eval:w 999999 + ##3 / ##1 ; % Q2 - ##3 ; - } + \exp_after:wN \__fp_div_mantissa_pack:NNN + \int_use:N \__int_eval:w + \exp_after:wN \__fp_div_mantissa_calc:wwnnnnnnn + \int_use:N \__int_eval:w 999999 + #2 #3 / #1 ; % Q2 + #2 #3 ; } -\__fp_tmp:w \__fp_ln_div_ii:www \__fp_ln_div_iii:www -\__fp_tmp:w \__fp_ln_div_iii:www \__fp_ln_div_iv:www -\__fp_tmp:w \__fp_ln_div_iv:www \__fp_ln_div_v:www -\__fp_tmp:w \__fp_ln_div_v:www \__fp_ln_div_vi:www -\cs_new:Npn \__fp_ln_div_vi:www #1; #2; #3;#4#5 #6#7#8#9 %y;Q5;F1F2;F3F4x1x2x3x4 +\cs_new:Npn \__fp_ln_div_vi:wwn #1; #2;#3#4#5 #6#7#8#9 %y;F1;F2F3F4x1x2x3x4 { \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w #2 - \exp_after:wN \__fp_div_mantissa_pack:NNN - \int_use:N \__int_eval:w 1000000 + #3 / #1 ; % Q6 + \int_use:N \__int_eval:w 1000000 + #2 #3 / #1 ; % Q6 } \cs_new:Npn \__fp_ln_div_after:Nw #1#2; { @@ -3388,7 +3361,7 @@ {0000}{#4}{#5}{#6}{#7}{#8}; \__fp_fixed_to_float:wN #1 } -\cs_new:Npn \__fp_exp:w \s__fp \__fp_chk:w #1#2 +\cs_new:Npn \__fp_exp_o:w \s__fp \__fp_chk:w #1#2 { \if_case:w #1 \exp_stop_f: \__fp_case_return_o:Nw \c_one_fp @@ -3423,7 +3396,7 @@ \__int_value:w #1 \__int_eval:w \if_int_compare:w #4 < - \c_eight \c_one - \exp_after:wN \__fp_add_big_i:wNww + \exp_after:wN \__fp_add_big_i_o:wNww \int_use:N \__int_eval:w \c_one - #4 ; 0 {1000}{0000}{0000}{0000} ; #5; \tex_romannumeral:D @@ -3686,10 +3659,10 @@ \cs_new:Npn \__fp_pow_exponent:wnN #1; #2 { \if_int_compare:w #2 > \c_zero - \exp_after:wN \__fp_pow_exponent:Nwnnnnnn % n\log 10 - (-\log x) + \exp_after:wN \__fp_pow_exponent:Nwnnnnnn % n\ln(10) - (-\ln(x)) \exp_after:wN + \else: - \exp_after:wN \__fp_pow_exponent:Nwnnnnnn % -( |n|\log 10 + (-\log x) ) + \exp_after:wN \__fp_pow_exponent:Nwnnnnnn % -( |n|\ln(10) + (-\ln(x)) ) \exp_after:wN - \fi: #2; #1; @@ -3759,7 +3732,7 @@ \exp_after:wN \__fp_pow_neg_neg:w \or: \if_int_compare:w \__int_eval:w #1 / \c_two = \c_one - \__fp_invalid_operation:Nnww \c_nan_fp { ^ } #3; #4; + \__fp_invalid_operation_o:Nww ^ #3; #4; \tex_romannumeral:D -`0 \exp_after:wN \exp_after:wN \exp_after:wN \__fp_use_none_until_s:w @@ -3859,7 +3832,7 @@ \exp_not:c { __fp_/_o:ww } \exp_not:N \c_one_fp } -\cs_new:Npn \__fp_sin:w \s__fp \__fp_chk:w #1#2 +\cs_new:Npn \__fp_sin_o:w \s__fp \__fp_chk:w #1#2 { \if_case:w #1 \exp_stop_f: \__fp_case_return_same_o:w @@ -3870,13 +3843,12 @@ \exp_after:wN #2 \exp_after:wN \c_zero \or: - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw \c_nan_fp { sin } } + \__fp_case_use:nw { \__fp_invalid_operation_o:nw { sin } } \else: \__fp_case_return_same_o:w \fi: \s__fp \__fp_chk:w #1#2 } -\cs_new:Npn \__fp_cos:w \s__fp \__fp_chk:w #1#2 +\cs_new:Npn \__fp_cos_o:w \s__fp \__fp_chk:w #1#2 { \if_case:w #1 \exp_stop_f: \__fp_case_return_o:Nw \c_one_fp @@ -3890,13 +3862,12 @@ \c_two } \or: - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw \c_nan_fp { cos } } + \__fp_case_use:nw { \__fp_invalid_operation_o:nw { cos } } \else: \__fp_case_return_same_o:w \fi: \s__fp \__fp_chk:w #1#2 } -\cs_new:Npn \__fp_tan:w \s__fp \__fp_chk:w #1#2 +\cs_new:Npn \__fp_tan_o:w \s__fp \__fp_chk:w #1#2 { \if_case:w #1 \exp_stop_f: \__fp_case_return_same_o:w @@ -3907,13 +3878,12 @@ \exp_after:wN #2 \exp_after:wN \c_one \or: - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw \c_nan_fp { tan } } + \__fp_case_use:nw { \__fp_invalid_operation_o:nw { tan } } \else: \__fp_case_return_same_o:w \fi: \s__fp \__fp_chk:w #1#2 } -\cs_new:Npn \__fp_cot:w \s__fp \__fp_chk:w #1#2 +\cs_new:Npn \__fp_cot_o:w \s__fp \__fp_chk:w #1#2 { \if_case:w #1 \exp_stop_f: \exp_after:wN \__fp_one_over:w @@ -3924,8 +3894,7 @@ \exp_after:wN #2 \exp_after:wN \c_three \or: - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw \c_nan_fp { cot } } + \__fp_case_use:nw { \__fp_invalid_operation_o:nw { cot } } \else: \__fp_case_return_same_o:w \fi: \s__fp \__fp_chk:w #1#2 @@ -4171,52 +4140,60 @@ \cs_new:Npn \__fp_trim_zeros_loop:w #1 0; #2 { #2 #1 ; #2 } \cs_new:Npn \__fp_trim_zeros_dot:w #1 .; { \__fp_trim_zeros_end:w #1 ; } \cs_new:Npn \__fp_trim_zeros_end:w #1 ; #2 \s__stop { #1 } -\tl_const:Nx \c__fp_scientific_inf_tl - { 1e \int_use:N \c__fp_max_exponent_int } \cs_new:Npn \fp_to_scientific:N #1 { \exp_after:wN \__fp_to_scientific:w #1 } \cs_generate_variant:Nn \fp_to_scientific:N { c } -\cs_new:Npn \fp_to_scientific:n #1 +\cs_new_nopar:Npn \fp_to_scientific:n { \exp_after:wN \__fp_to_scientific:w - \tex_romannumeral:D -`0 \__fp_parse:n {#1} - } -\cs_new:Npn \__fp_to_scientific:w \s__fp \__fp_chk:w #1#2#3 ; - { - \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi: - \if_case:w #1 \exp_stop_f: - \__fp_case_return:nw { \exp_after:wN 0 } - \or: \exp_after:wN \__fp_to_scientific_normal:wnnnnn - \or: - \__fp_case_use:nw - { - \__fp_invalid_operation:Nnw - \c__fp_scientific_inf_tl { fp_to_scientific } - } - \or: - \__fp_case_use:nw - { \__fp_invalid_operation:Nnw 0 { fp_to_scientific } } - \fi: - \s__fp \__fp_chk:w #1 #2 #3 ; \prg_do_nothing: + \tex_romannumeral:D -`0 \__fp_parse:n } -\cs_new:Npn \__fp_to_scientific_normal:wnnnnn - \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ; \prg_do_nothing: +\group_begin: +\char_set_catcode_other:N E +\tl_to_lowercase:n { - \if_int_compare:w #2 = \c_one - \exp_after:wN \__fp_to_scientific_normal:wNw - \else: - \exp_after:wN \__fp_to_scientific_normal:wNw - \exp_after:wN e - \int_use:N \__int_eval:w #2 - \c_one - \fi: - ; #3 #4 #5 #6 ; + \group_end: + \cs_new:Npn \__fp_to_scientific:w \s__fp \__fp_chk:w #1#2 + { + \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi: + \if_case:w #1 \exp_stop_f: + \__fp_case_return:nw { 0 } + \or: \exp_after:wN \__fp_to_scientific_normal:wnnnnn + \or: + \__fp_case_use:nw + { + \__fp_invalid_operation:nnw + { + \exp_after:wN 1 + \exp_after:wN E + \int_use:N \c__fp_max_exponent_int + } + { fp_to_scientific } + } + \or: + \__fp_case_use:nw + { + \__fp_invalid_operation:nnw + { 0 } + { fp_to_scientific } + } + \fi: + \s__fp \__fp_chk:w #1 #2 + } + \cs_new:Npn \__fp_to_scientific_normal:wnnnnn + \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ; + { + \if_int_compare:w #2 = \c_one + \exp_after:wN \__fp_to_scientific_normal:wNw + \else: + \exp_after:wN \__fp_to_scientific_normal:wNw + \exp_after:wN E + \int_use:N \__int_eval:w #2 - \c_one + \fi: + ; #3 #4 #5 #6 ; + } } \cs_new:Npn \__fp_to_scientific_normal:wNw #1 ; #2#3; { \__fp_trim_zeros:w #2.#3 ; #1 } -\tl_const:Nn \c__fp_decimal_inf_tl - { - \exp_after:wN \exp_after:wN \exp_after:wN 1 - \prg_replicate:nn \c__fp_max_exponent_int 0 - } \cs_new:Npn \fp_to_decimal:N #1 { \exp_after:wN \__fp_to_decimal:w #1 } \cs_generate_variant:Nn \fp_to_decimal:N { c } \cs_new_nopar:Npn \fp_to_decimal:n @@ -4224,26 +4201,34 @@ \exp_after:wN \__fp_to_decimal:w \tex_romannumeral:D -`0 \__fp_parse:n } -\cs_new:Npn \__fp_to_decimal:w \s__fp \__fp_chk:w #1#2#3 ; +\cs_new:Npn \__fp_to_decimal:w \s__fp \__fp_chk:w #1#2 { \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi: \if_case:w #1 \exp_stop_f: - \__fp_case_return:nw { \exp_after:wN 0 } + \__fp_case_return:nw { 0 } \or: \exp_after:wN \__fp_to_decimal_normal:wnnnnn \or: \__fp_case_use:nw { - \__fp_invalid_operation:Nnw - \c__fp_decimal_inf_tl { fp_to_decimal } + \__fp_invalid_operation:nnw + { + \exp_after:wN \exp_after:wN \exp_after:wN 1 + \prg_replicate:nn \c__fp_max_exponent_int 0 + } + { fp_to_decimal } } \or: \__fp_case_use:nw - { \__fp_invalid_operation:Nnw 0 { fp_to_decimal } } + { + \__fp_invalid_operation:nnw + { 0 } + { fp_to_decimal } + } \fi: - \s__fp \__fp_chk:w #1 #2 #3 ; \prg_do_nothing: + \s__fp \__fp_chk:w #1 #2 } \cs_new:Npn \__fp_to_decimal_normal:wnnnnn - \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ; \prg_do_nothing: + \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ; { \int_compare:nNnTF {#2} > \c_zero { @@ -4290,11 +4275,11 @@ \if_case:w #1 \exp_stop_f: \__fp_case_return:nw { 0 } \or: \exp_after:wN \__fp_to_tl_normal:nnnnn - \or: \__fp_case_return:nw { inf } - \else: \__fp_case_return:nw { nan } + \or: \__fp_case_return:nw { \tl_to_str:n {inf} } + \else: \__fp_case_return:nw { \tl_to_str:n {nan} } \fi: } -\cs_new:Npn \__fp_to_tl_normal:nnnnn #1#2 ; +\cs_new:Npn \__fp_to_tl_normal:nnnnn #1 { \if_int_compare:w #1 > \c_sixteen \exp_after:wN \__fp_to_scientific_normal:wnnnnn @@ -4307,11 +4292,13 @@ \exp_after:wN \__fp_to_decimal_normal:wnnnnn \fi: \fi: - \s__fp \__fp_chk:w 1 0 {#1} #2 ; \prg_do_nothing: + \s__fp \__fp_chk:w 1 0 {#1} } -\cs_new:Npn \fp_to_dim:N #1 { \fp_to_decimal:N #1 pt } +\cs_new:Npx \fp_to_dim:N #1 + { \exp_not:N \fp_to_decimal:N #1 \tl_to_str:n {pt} } \cs_generate_variant:Nn \fp_to_dim:N { c } -\cs_new:Npn \fp_to_dim:n #1 { \fp_to_decimal:n {#1} pt } +\cs_new:Npx \fp_to_dim:n #1 + { \exp_not:N \fp_to_decimal:n {#1} \tl_to_str:n {pt} } \cs_new:Npn \fp_to_int:N #1 { \exp_after:wN \__fp_to_int:w #1 } \cs_generate_variant:Nn \fp_to_int:N { c } \cs_new_nopar:Npn \fp_to_int:n @@ -4322,7 +4309,7 @@ \cs_new:Npn \__fp_to_int:w #1; { \exp_after:wN \__fp_to_decimal:w \tex_romannumeral:D -`0 - \__fp_round:Nwn \__fp_round_to_nearest:NNN #1; { 0 } \prg_do_nothing: + \__fp_round:Nwn \__fp_round_to_nearest:NNN #1; { 0 } } \cs_new:Npn \dim_to_fp:n #1 { @@ -4332,8 +4319,7 @@ \cs_new:Npn \__fp_from_dim_test:N #1 { \if_meaning:w 0 #1 - \exp_after:wN \__fp_use_i_until_s:nw - \exp_after:wN \c_zero_fp + \__fp_case_return:nw \c_zero_fp \else: \if_meaning:w - #1 \exp_after:wN \__fp_from_dim:Nw @@ -4355,13 +4341,15 @@ { \__fp_from_dim_iii:wnnnnwN #1 {#2#300} {0000} ; } \cs_new:Npn \__fp_from_dim_iii:wnnnnwN #1; #2#3#4#5#6; #7 { - \__fp_mul_npos:Nnwnw #7 {#5} #1 ; - {-4} {1525} {8789} {0625} {0000} ; + \__fp_mul_npos_o:Nww #7 + \s__fp \__fp_chk:w 1 #7 {#5} #1 ; + \s__fp \__fp_chk:w 1 0 {-4} {1525} {8789} {0625} {0000} ; } \cs_new_eq:NN \fp_use:N \fp_to_decimal:N \cs_generate_variant:Nn \fp_use:N { c } \cs_new_eq:NN \fp_eval:n \fp_to_decimal:n -\cs_new:Npn \fp_abs:n #1 { \fp_to_decimal:n { abs ( #1 ) } } +\cs_new:Npn \fp_abs:n #1 + { \fp_to_decimal:n { abs \__fp_parse:n {#1} } } %% %% File: l3fp-assign.dtx Copyright (C) 2011-2012 The LaTeX3 project %% @@ -4426,7 +4414,8 @@ \cs_new_protected_nopar:Npn \fp_gadd:Nn { \__fp_add:NNNn \fp_gset:Nn + } \cs_new_protected_nopar:Npn \fp_sub:Nn { \__fp_add:NNNn \fp_set:Nn - } \cs_new_protected_nopar:Npn \fp_gsub:Nn { \__fp_add:NNNn \fp_gset:Nn - } -\cs_new_protected:Npn \__fp_add:NNNn #1#2#3#4 { #1 #3 { #3 #2 (#4) } } +\cs_new_protected:Npn \__fp_add:NNNn #1#2#3#4 + { #1 #3 { #3 #2 \__fp_parse:n {#4} } } \cs_generate_variant:Nn \fp_add:Nn { c } \cs_generate_variant:Nn \fp_gadd:Nn { c } \cs_generate_variant:Nn \fp_sub:Nn { c } @@ -4489,10 +4478,10 @@ { \exp_after:wN \__fp_if_zero:w #1 } \cs_new:Npn \__fp_if_zero:w \s__fp \__fp_chk:w #1#2; { \if_meaning:w #1 0 \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new_protected_nopar:Npn \fp_abs:N { \__fp_abs:NNN \tl_set:Nx \__fp_abs:w } -\cs_new_protected_nopar:Npn \fp_gabs:N { \__fp_abs:NNN \tl_gset:Nx \__fp_abs:w } -\cs_new_protected_nopar:Npn \fp_neg:N { \__fp_abs:NNN \tl_set:Nx \__fp_neg:w } -\cs_new_protected_nopar:Npn \fp_gneg:N { \__fp_abs:NNN \tl_gset:Nx \__fp_neg:w } +\cs_new_protected_nopar:Npn \fp_abs:N { \__fp_abs:NNN \tl_set:Nx \__fp_abs_o:w } +\cs_new_protected_nopar:Npn \fp_gabs:N { \__fp_abs:NNN \tl_gset:Nx \__fp_abs_o:w } +\cs_new_protected_nopar:Npn \fp_neg:N { \__fp_abs:NNN \tl_set:Nx \__fp_neg_o:w } +\cs_new_protected_nopar:Npn \fp_gneg:N { \__fp_abs:NNN \tl_gset:Nx \__fp_neg_o:w } \cs_new_protected:Npn \__fp_abs:NNN #1#2#3 { #1 #3 { \exp_after:wN #2 #3 \prg_do_nothing: } } \cs_generate_variant:Nn \fp_abs:N { c } @@ -4505,7 +4494,8 @@ \cs_new_protected_nopar:Npn \fp_gdiv:Nn { \__fp_mul:NNNn \fp_gset:Nn / } \cs_new_protected_nopar:Npn \fp_pow:Nn { \__fp_mul:NNNn \fp_set:Nn ^ } \cs_new_protected_nopar:Npn \fp_gpow:Nn { \__fp_mul:NNNn \fp_gset:Nn ^ } -\cs_new_protected:Npn \__fp_mul:NNNn #1#2#3#4 { #1 #3 { #3 #2 (#4) } } +\cs_new_protected:Npn \__fp_mul:NNNn #1#2#3#4 + { #1 #3 { #3 #2 \__fp_parse:n {#4} } } \cs_generate_variant:Nn \fp_mul:Nn { c } \cs_generate_variant:Nn \fp_gmul:Nn { c } \cs_generate_variant:Nn \fp_div:Nn { c } @@ -4519,11 +4509,11 @@ \cs_generate_variant:Nn #1 { c } \cs_generate_variant:Nn #2 { c } } -\__fp_tmp:w \fp_exp:Nn \fp_gexp:Nn \__fp_exp:w {exp} \__fp_assign_to:nNNNn -\__fp_tmp:w \fp_ln:Nn \fp_gln:Nn \__fp_ln:w {ln } \__fp_assign_to:nNNNn -\__fp_tmp:w \fp_sin:Nn \fp_gsin:Nn \__fp_sin:w {sin} \__fp_assign_to:nNNNn -\__fp_tmp:w \fp_cos:Nn \fp_gcos:Nn \__fp_cos:w {cos} \__fp_assign_to:nNNNn -\__fp_tmp:w \fp_tan:Nn \fp_gtan:Nn \__fp_tan:w {tan} \__fp_assign_to:nNNNn +\__fp_tmp:w \fp_exp:Nn \fp_gexp:Nn \__fp_exp_o:w {exp} \__fp_assign_to:nNNNn +\__fp_tmp:w \fp_ln:Nn \fp_gln:Nn \__fp_ln_o:w {ln } \__fp_assign_to:nNNNn +\__fp_tmp:w \fp_sin:Nn \fp_gsin:Nn \__fp_sin_o:w {sin} \__fp_assign_to:nNNNn +\__fp_tmp:w \fp_cos:Nn \fp_gcos:Nn \__fp_cos_o:w {cos} \__fp_assign_to:nNNNn +\__fp_tmp:w \fp_tan:Nn \fp_gtan:Nn \__fp_tan_o:w {tan} \__fp_assign_to:nNNNn \cs_new_protected:Npn \__fp_assign_to:nNNNn #1#2#3#4#5 { \exp_after:wN \__fp_assign_to_i:wNNNn @@ -4532,7 +4522,7 @@ \cs_new_protected:Npn \__fp_assign_to_i:wNNNn \s__fp \__fp_chk:w #1#2#3; #4 { \exp_args:Nc \__fp_assign_to_ii:NnNNN - { c__fp_ #4 ( #2 \if_meaning:w 1 #1 #3 \fi: ) _fp } + { c__fp_ #4 [ #1 # 2 \if_meaning:w 1 #1 #3 \fi: ] _fp } { #1#2#3 } } \cs_new_protected:Npn \__fp_assign_to_ii:NnNNN #1#2#3#4#5 @@ -4544,7 +4534,6 @@ \cs_new_protected_nopar:Npn \fp_compare:NNNTF { \fp_compare:nNnTF } \cs_new_protected_nopar:Npn \fp_compare:NNNT { \fp_compare:nNnT } \cs_new_protected_nopar:Npn \fp_compare:NNNF { \fp_compare:nNnF } -\cs_new_protected_nopar:Npn \fp_compare_p:NNN { \fp_compare_p:nNn } \cs_new_protected_nopar:Npn \fp_round_places:Nn { \__fp_round_places:NNn \tl_set:Nx } \cs_new_protected_nopar:Npn \fp_ground_places:Nn diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty index f33a864bff7..531f0a0e7c9 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3int.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3int.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Integers} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty b/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty index 3d1a698da0b..673001477d5 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3keys.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3keys.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Experimental key-value interfaces} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty b/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty index c6050b44f98..9673e80ab1c 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty @@ -45,22 +45,22 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3luatex.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3luatex.dtx 4049 2012-08-03 14:01:40Z bruno $ {L3 Experimental LuaTeX-specific functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \__expl_package_check: \luatex_if_engine:TF { - \cs_new_eq:NN \lua_now:x \luatex_directlua:D + \cs_new_eq:NN \lua_now_x:n \luatex_directlua:D \cs_new_eq:NN \lua_shipout_x:n \luatex_latelua:D } { - \cs_new:Npn \lua_now:x #1 + \cs_new:Npn \lua_now_x:n #1 { \__msg_kernel_expandable_error:nnn - { kernel } { bad-engine } { \lua_now:x } + { kernel } { bad-engine } { \lua_now_x:n } } \cs_new_protected:Npn \lua_shipout_x:n #1 { @@ -68,8 +68,10 @@ { kernel } { bad-engine } { \lua_shipout_x:n } } } +\cs_generate_variant:Nn \lua_now_x:n { x } \cs_new:Npn \lua_now:n #1 - { \lua_now:x { \exp_not:n {#1} } } + { \lua_now_x:n { \exp_not:n {#1} } } +\cs_generate_variant:Nn \lua_now:n { x } \cs_generate_variant:Nn \lua_shipout_x:n { x } \cs_new_protected:Npn \lua_shipout:n #1 { \lua_shipout_x:n { \exp_not:n {#1} } } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty index bfce368f0d0..3845880de85 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3msg.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3msg.dtx 4077 2012-08-10 23:30:52Z bruno $ {L3 Messages} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -230,9 +230,12 @@ \cs_new_protected:cpn { __msg_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2} \cs_new_protected:cpn { msg_ #1 :nnnnnn } ##1##2##3##4##5##6 { - \__msg_use:nnnnnnn {#1} {##1} {##2} - { \tl_to_str:n {##3} } { \tl_to_str:n {##4} } - { \tl_to_str:n {##5} } { \tl_to_str:n {##6} } + \use:x + { + \exp_not:n { \__msg_use:nnnnnnn {#1} {##1} {##2} } + { \tl_to_str:n {##3} } { \tl_to_str:n {##4} } + { \tl_to_str:n {##5} } { \tl_to_str:n {##6} } + } } \cs_new_protected:cpx { msg_ #1 :nnnnn } ##1##2##3##4##5 { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } @@ -242,12 +245,12 @@ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } } \cs_new_protected:cpx { msg_ #1 :nn } ##1##2 { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } } - \cs_new_protected:cpn { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 + \cs_new_protected:cpx { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 { \use:x { - \__msg_use:nnnnnnn - { \exp_not:n {#1} } { \exp_not:n {##1} } { \exp_not:n {##2} } + \exp_not:N \exp_not:n + { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} } {##3} {##4} {##5} {##6} } } @@ -465,11 +468,19 @@ \cs_new_protected:Npn \__msg_kernel_set:nnn #1#2 { \msg_set:nnn { LaTeX } { #1 / #2 } } \group_begin: - \cs_set_protected:Npn \__msg_kernel_class_new:nn #1 - { \__msg_kernel_class_new_aux:nn { kernel_ #1 } } - \cs_set_protected:Npn \__msg_kernel_class_new_aux:nn #1#2 + \cs_set_protected:Npn \__msg_kernel_class_new:nN #1 + { \__msg_kernel_class_new_aux:nN { kernel_ #1 } } + \cs_set_protected:Npn \__msg_kernel_class_new_aux:nN #1#2 { - \cs_new_protected:cpn { __msg_ #1 :nnnnnn } ##1##2 {#2} + \cs_new_protected:cpn { __msg_ #1 :nnnnnn } ##1##2##3##4##5##6 + { + \use:x + { + \exp_not:n { #2 { LaTeX } { ##1 / ##2 } } + { \tl_to_str:n {##3} } { \tl_to_str:n {##4} } + { \tl_to_str:n {##5} } { \tl_to_str:n {##6} } + } + } \cs_new_protected:cpx { __msg_ #1 :nnnnn } ##1##2##3##4##5 { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } \cs_new_protected:cpx { __msg_ #1 :nnnn } ##1##2##3##4 @@ -482,9 +493,8 @@ { \use:x { - \exp_not:c { __msg_ #1 :nnnnnn } - { \exp_not:N \exp_not:n {##1} } - { \exp_not:N \exp_not:n {##2} } + \exp_not:N \exp_not:n + { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} } {##3} {##4} {##5} {##6} } } @@ -495,17 +505,13 @@ \cs_new_protected:cpx { __msg_ #1 :nnx } ##1##2##3 { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } } - \__msg_kernel_class_new:nn { fatal } - { \__msg_fatal_code:nnnnnn { LaTeX } { #1 / #2 } } + \__msg_kernel_class_new:nN { fatal } \__msg_fatal_code:nnnnnn \cs_undefine:N \__msg_kernel_error:nnxx \cs_undefine:N \__msg_kernel_error:nnx \cs_undefine:N \__msg_kernel_error:nn - \__msg_kernel_class_new:nn { error } - { \__msg_error_code:nnnnnn { LaTeX } { #1 / #2 } } - \__msg_kernel_class_new:nn { warning } - { \msg_warning:nnxxxx { LaTeX } { #1 / #2 } } - \__msg_kernel_class_new:nn { info } - { \msg_info:nnxxxx { LaTeX } { #1 / #2 } } + \__msg_kernel_class_new:nN { error } \__msg_error_code:nnnnnn + \__msg_kernel_class_new:nN { warning } \msg_warning:nnxxxx + \__msg_kernel_class_new:nN { info } \msg_info:nnxxxx \group_end: \__msg_kernel_new:nnnn { kernel } { message-already-defined } { Message~'#2'~for~module~'#1'~already~defined. } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty index 6433a8eb325..22fa6688784 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3prg.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3prg.dtx 4061 2012-08-08 15:19:07Z bruno $ {L3 Control structures} %% \ProvidesExplPackage @@ -339,9 +339,6 @@ } } \int_new:N \g__prg_map_int -\cs_new_eq:NN \__prg_break_point: \prg_do_nothing: -\cs_new:Npn \__prg_break: #1 \__prg_break_point: { } -\cs_new:Npn \__prg_break:n #1#2 \__prg_break_point: {#1} \cs_new_eq:NN \prg_case_int:nnn \int_case:nnn \cs_new_eq:NN \prg_case_str:nnn \str_case:nnn \cs_new_eq:NN \prg_case_str:onn \str_case:onn diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty index 5699c49cc37..e65ebc5e2bc 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3prop.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3prop.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Property lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty b/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty index deaf7d4699d..fdb0515e2c1 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3quark.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3quark.dtx 4065 2012-08-08 21:37:44Z bruno $ {L3 Quarks} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty index e5a270b01d7..5b4fe8c3790 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3seq.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3seq.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Sequences and stacks} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty index b64003dfc27..8888a5b9056 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty @@ -46,8 +46,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3skip.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3skip.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Dimensions and skips} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty index 166552a8a71..ddcd94376cf 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3tl.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3tl.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Token lists} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty index bac0b7a8832..668d699fcfe 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty @@ -45,8 +45,8 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names} -\GetIdInfo$Id: l3token.dtx 3986 2012-07-15 19:23:51Z joseph $ +\RequirePackage{l3bootstrap} +\GetIdInfo$Id: l3token.dtx 4069 2012-08-08 23:12:57Z bruno $ {L3 Experimental token manipulation} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty index fdd3f37a919..ea92f5f35d8 100644 --- a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty @@ -46,8 +46,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/07/16] -\@ifpackagelater{expl3}{2012/07/16} +\RequirePackage{expl3}[2012/08/14] +\@ifpackagelater{expl3}{2012/08/14} {} {% \PackageError{l3keys2e}{Support package l3kernel too old.} @@ -59,7 +59,7 @@ \endinput } \RequirePackage{xparse} -\GetIdInfo$Id: l3keys2e.dtx 3990 2012-07-16 07:46:03Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 4091 2012-08-14 08:13:50Z joseph $ {LaTeX2e option processing using LaTeX3 keys} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty index 989c77fde0a..7835dc2427e 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty @@ -48,7 +48,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} -\GetIdInfo$Id: xfrac.dtx 3875 2012-06-30 12:38:05Z joseph $ +\GetIdInfo$Id: xfrac.dtx 3991 2012-07-16 19:00:35Z joseph $ {L3 Experimental split-level fractions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index c5eb78daecf..e20d05295c8 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -50,8 +50,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/07/16] -\@ifpackagelater{expl3}{2012/07/16} +\RequirePackage{expl3}[2012/08/14] +\@ifpackagelater{expl3}{2012/08/14} {} {% \PackageError{xparse}{Support package l3kernel too old.} @@ -62,7 +62,7 @@ }% \endinput } -\GetIdInfo$Id: xparse.dtx 3990 2012-07-16 07:46:03Z joseph $ +\GetIdInfo$Id: xparse.dtx 4091 2012-08-14 08:13:50Z joseph $ {L3 Experimental document command parser} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -213,31 +213,18 @@ { \__xparse_declare_cmd_internal:cnx { environment~ #1 } {#2} { - \group_begin: - \cs_set_protected_nopar:Npx \exp_not:c { environment_ #1 _end_aux: } - { - \exp_not:c { environment_ #1 _end_aux:w } - \exp_not:n - { - \exp_args:No \exp_not:o - { \exp_after:wN \use_none:n \l__xparse_args_tl } - \exp_not:n - { - \if@endpe - \exp_after:wN \group_end: - \exp_after:wN \@endpetrue - \else - \exp_after:wN \group_end: - \fi - } - } - } + \cs_set_protected_nopar:Npx \exp_not:c { environment~ #1 ~end~aux } + { + \exp_not:c { environment~ #1~end~aux~ } + \exp_not:n + { { \tl_tail:N \l__xparse_args_tl } } + } \exp_not:n {#3} } \cs_set_protected_nopar:cpx { environment~ #1 ~end } - { \exp_not:c { environment_ #1 _end_aux: } } + { \exp_not:c { environment~ #1 ~end~aux } } \cs_generate_from_arg_count:cNnn - { environment_ #1 _end_aux:w } \cs_set_protected:Npn + { environment~ #1 ~end~aux~ } \cs_set_protected:Npn \l__xparse_current_arg_int {#4} \cs_set_eq:cc {#1} { environment~ #1 } \cs_set_eq:cc { end #1 } { environment~ #1 ~end } diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty index bda0b918cce..cd0a30597af 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty @@ -50,8 +50,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/07/16] -\@ifpackagelater{expl3}{2012/07/16} +\RequirePackage{expl3}[2012/08/14] +\@ifpackagelater{expl3}{2012/08/14} {} {% \PackageError{xtemplate}{Support package l3kernel too old.} @@ -62,7 +62,7 @@ }% \endinput } -\GetIdInfo$Id: xtemplate.dtx 3990 2012-07-16 07:46:03Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 4091 2012-08-14 08:13:50Z joseph $ {L3 Experimental prototype document functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/texinfo/texinfo.tex b/Master/texmf-dist/tex/texinfo/texinfo.tex index c7354edcaf9..dc4bf6400c4 100644 --- a/Master/texmf-dist/tex/texinfo/texinfo.tex +++ b/Master/texmf-dist/tex/texinfo/texinfo.tex @@ -3146,12 +3146,17 @@ end % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% - \ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize \else - % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi \fi \thisecfont } |