diff options
author | Karl Berry <karl@freefriends.org> | 2016-10-19 20:38:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-10-19 20:38:20 +0000 |
commit | 52b787d36c60fda90673669dd2809c95c1fdfca5 (patch) | |
tree | beb7faf87e1ab5be65f7437e500619b20eba20a1 /Master/texmf-dist/tex | |
parent | 97a401ad817da2dafd1069df9d87a28ed39df69b (diff) |
l3 (19oct16)
git-svn-id: svn://tug.org/texlive/trunk@42306 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | 1332 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 1269 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def | 105 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvips.def | 289 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def | 316 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def | 105 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def | 109 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty | 14 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty | 46 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty | 76 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty | 106 |
13 files changed, 2493 insertions, 1282 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index 2676787a1c3..c15781e05f6 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -82,8 +82,8 @@ %% ----------------------------------------------------------------------- \def\ExplFileName{expl3}% \def\ExplFileDescription{L3 programming layer}% -\def\ExplFileDate{2016/05/18}% -\def\ExplFileVersion{6512}% +\def\ExplFileDate{2016/10/19}% +\def\ExplFileVersion{6730}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -242,7 +242,7 @@ }% }% \endgroup -\GetIdInfo$Id: l3bootstrap.dtx 6412 2016-02-12 21:45:29Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 6596 2016-06-13 21:29:58Z joseph $ {L3 Bootstrap code}% \begingroup \expandafter\ifx\csname directlua\endcsname\relax @@ -388,7 +388,7 @@ { \bool_if:NF \l__kernel_expl_bool { - \cs_set_protected_nopar:Npx \ExplSyntaxOff + \cs_set_protected:Npx \ExplSyntaxOff { \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } } \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } } @@ -402,7 +402,7 @@ \tex_endlinechar:D = \tex_the:D \tex_endlinechar:D \scan_stop: \bool_set_false:N \l__kernel_expl_bool - \cs_set_protected_nopar:Npn \ExplSyntaxOff { } + \cs_set_protected:Npn \ExplSyntaxOff { } } } \char_set_catcode_ignore:n { 9 } % tab @@ -449,7 +449,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3names.dtx 6433 2016-03-11 20:04:27Z joseph $ +\GetIdInfo$Id: l3names.dtx 6722 2016-10-13 10:22:35Z joseph $ {L3 Namespace for primitives} \let \tex_global:D \global \let \tex_let:D \let @@ -1023,7 +1023,7 @@ \__kernel_primitive:NN \XeTeXvariationname \xetex_variationname:D \__kernel_primitive:NN \XeTeXrevision \xetex_XeTeXrevision:D \__kernel_primitive:NN \XeTeXversion \xetex_XeTeXversion:D - \__kernel_primitive:NN \ifprimitive \pdftex_primitive:D + \__kernel_primitive:NN \ifprimitive \pdftex_ifprimitive:D \__kernel_primitive:NN \primitive \pdftex_primitive:D \__kernel_primitive:NN \shellescape \pdftex_shellescape:D \__kernel_primitive:NN \alignmark \luatex_alignmark:D @@ -1049,7 +1049,8 @@ \__kernel_primitive:NN \formatname \luatex_formatname:D \__kernel_primitive:NN \hjcode \luatex_hjcode:D \__kernel_primitive:NN \hpack \luatex_hpack:D - \__kernel_primitive:NN \hyphenationmin \luatex_hypenationmin:D + \__kernel_primitive:NN \hyphenationbounds \luatex_hyphenationbounds:D + \__kernel_primitive:NN \hyphenationmin \luatex_hyphenationmin:D \__kernel_primitive:NN \gleaders \luatex_gleaders:D \__kernel_primitive:NN \initcatcodetable \luatex_initcatcodetable:D \__kernel_primitive:NN \lastnamedcs \luatex_lastnamedcs:D @@ -1057,12 +1058,15 @@ \__kernel_primitive:NN \letcharcode \luatex_letcharcode:D \__kernel_primitive:NN \luaescapestring \luatex_luaescapestring:D \__kernel_primitive:NN \luafunction \luatex_luafunction:D + \__kernel_primitive:NN \luatexbanner \luatex_luatexbanner:D \__kernel_primitive:NN \luatexdatestamp \luatex_luatexdatestamp:D \__kernel_primitive:NN \luatexrevision \luatex_luatexrevision:D \__kernel_primitive:NN \luatexversion \luatex_luatexversion:D \__kernel_primitive:NN \mathdisplayskipmode \luatex_mathdisplayskipmode:D \__kernel_primitive:NN \matheqnogapstep \luatex_matheqnogapstep:D \__kernel_primitive:NN \mathoption \luatex_mathoption:D + \__kernel_primitive:NN \mathnolimitsmode \luatex_mathnolimitsmode:D + \__kernel_primitive:NN \mathrulesfam \luatex_mathrulesfam:D \__kernel_primitive:NN \mathscriptsmode \luatex_mathscriptsmode:D \__kernel_primitive:NN \mathstyle \luatex_mathstyle:D \__kernel_primitive:NN \mathsurroundskip \luatex_mathsurroundskip:D @@ -1084,6 +1088,7 @@ \__kernel_primitive:NN \savecatcodetable \luatex_savecatcodetable:D \__kernel_primitive:NN \scantextokens \luatex_scantextokens:D \__kernel_primitive:NN \setfontid \luatex_setfontid:D + \__kernel_primitive:NN \shapemode \luatex_shapemode:D \__kernel_primitive:NN \suppressifcsnameerror \luatex_suppressifcsnameerror:D \__kernel_primitive:NN \suppresslongerror \luatex_suppresslongerror:D \__kernel_primitive:NN \suppressmathparerror \luatex_suppressmathparerror:D @@ -1100,6 +1105,7 @@ \__kernel_primitive:NN \localleftbox \luatex_localleftbox:D \__kernel_primitive:NN \localrightbox \luatex_localrightbox:D \__kernel_primitive:NN \mathdir \luatex_mathdir:D + \__kernel_primitive:NN \linedir \luatex_linedir:D \__kernel_primitive:NN \pagebottomoffset \luatex_pagebottomoffset:D \__kernel_primitive:NN \pagedir \luatex_pagedir:D \__kernel_primitive:NN \pagerightoffset \luatex_pagerightoffset:D @@ -1190,6 +1196,8 @@ \__kernel_primitive:NN \Umathlimitbelowbgap \utex_limitbelowbgap:D \__kernel_primitive:NN \Umathlimitbelowkern \utex_limitbelowkern:D \__kernel_primitive:NN \Umathlimitbelowvgap \utex_limitbelowvgap:D + \__kernel_primitive:NN \Umathnolimitsubfactor \utex_nolimitsubfactor:D + \__kernel_primitive:NN \Umathnolimitsupfactor \utex_nolimitsupfactor:D \__kernel_primitive:NN \Umathopbinspacing \utex_opbinspacing:D \__kernel_primitive:NN \Umathopclosespacing \utex_opclosespacing:D \__kernel_primitive:NN \Umathopenbinspacing \utex_openbinspacing:D @@ -1441,7 +1449,7 @@ \tex_let:D \tex_middle:D \normalmiddle \tex_let:D \tex_right:D \normalright \tex_fi:D -%% File: l3basics.dtx Copyright (C) 1990-2015 The LaTeX3 project +%% File: l3basics.dtx Copyright (C) 1990-2016 The LaTeX3 project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -1473,7 +1481,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3basics.dtx 6315 2015-11-22 22:49:22Z bruno $ +\GetIdInfo$Id: l3basics.dtx 6696 2016-09-01 16:09:52Z bruno $ {L3 Basic definitions} \tex_let:D \if_true: \tex_iftrue:D \tex_let:D \if_false: \tex_iffalse:D @@ -1534,32 +1542,32 @@ \tex_fi:D \tex_let:D \cs_set_nopar:Npn \tex_def:D \tex_let:D \cs_set_nopar:Npx \tex_edef:D -\etex_protected:D \cs_set_nopar:Npn \cs_set:Npn - { \tex_long:D \cs_set_nopar:Npn } -\etex_protected:D \cs_set_nopar:Npn \cs_set:Npx - { \tex_long:D \cs_set_nopar:Npx } -\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn - { \etex_protected:D \cs_set_nopar:Npn } -\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx - { \etex_protected:D \cs_set_nopar:Npx } -\cs_set_protected_nopar:Npn \cs_set_protected:Npn - { \etex_protected:D \tex_long:D \cs_set_nopar:Npn } -\cs_set_protected_nopar:Npn \cs_set_protected:Npx - { \etex_protected:D \tex_long:D \cs_set_nopar:Npx } +\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npn + { \tex_long:D \tex_def:D } +\etex_protected:D \tex_long:D \tex_def:D \cs_set:Npx + { \tex_long:D \tex_edef:D } +\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npn + { \etex_protected:D \tex_def:D } +\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npx + { \etex_protected:D \tex_edef:D } +\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npn + { \etex_protected:D \tex_long:D \tex_def:D } +\etex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npx + { \etex_protected:D \tex_long:D \tex_edef:D } \tex_let:D \cs_gset_nopar:Npn \tex_gdef:D \tex_let:D \cs_gset_nopar:Npx \tex_xdef:D -\cs_set_protected_nopar:Npn \cs_gset:Npn - { \tex_long:D \cs_gset_nopar:Npn } -\cs_set_protected_nopar:Npn \cs_gset:Npx - { \tex_long:D \cs_gset_nopar:Npx } -\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npn - { \etex_protected:D \cs_gset_nopar:Npn } -\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npx - { \etex_protected:D \cs_gset_nopar:Npx } -\cs_set_protected_nopar:Npn \cs_gset_protected:Npn - { \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_protected:Npn \cs_gset:Npn + { \tex_long:D \tex_gdef:D } +\cs_set_protected:Npn \cs_gset:Npx + { \tex_long:D \tex_xdef:D } +\cs_set_protected:Npn \cs_gset_protected_nopar:Npn + { \etex_protected:D \tex_gdef:D } +\cs_set_protected:Npn \cs_gset_protected_nopar:Npx + { \etex_protected:D \tex_xdef:D } +\cs_set_protected:Npn \cs_gset_protected:Npn + { \etex_protected:D \tex_long:D \tex_gdef:D } +\cs_set_protected:Npn \cs_gset_protected:Npx + { \etex_protected:D \tex_long:D \tex_xdef:D } \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 @@ -1596,30 +1604,30 @@ \cs_set:Npn \use_none:nnnnnnn #1#2#3#4#5#6#7 { } \cs_set:Npn \use_none:nnnnnnnn #1#2#3#4#5#6#7#8 { } \cs_set:Npn \use_none:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { } -\cs_set_nopar:Npn \prg_return_true: +\cs_set:Npn \prg_return_true: { \exp_after:wN \use_i:nn \exp:w } -\cs_set_nopar:Npn \prg_return_false: +\cs_set:Npn \prg_return_false: { \exp_after:wN \use_ii:nn \exp:w} -\cs_set_protected_nopar:Npn \prg_set_conditional:Npnn +\cs_set_protected:Npn \prg_set_conditional:Npnn { \__prg_generate_conditional_parm:nnNpnn { set } { } } -\cs_set_protected_nopar:Npn \prg_new_conditional:Npnn +\cs_set_protected:Npn \prg_new_conditional:Npnn { \__prg_generate_conditional_parm:nnNpnn { new } { } } -\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Npnn +\cs_set_protected:Npn \prg_set_protected_conditional:Npnn { \__prg_generate_conditional_parm:nnNpnn { set } { _protected } } -\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Npnn +\cs_set_protected:Npn \prg_new_protected_conditional:Npnn { \__prg_generate_conditional_parm:nnNpnn { new } { _protected } } \cs_set_protected:Npn \__prg_generate_conditional_parm:nnNpnn #1#2#3#4# { \__cs_split_function:NN #3 \__prg_generate_conditional:nnNnnnnn {#1} {#2} {#4} } -\cs_set_protected_nopar:Npn \prg_set_conditional:Nnn +\cs_set_protected:Npn \prg_set_conditional:Nnn { \__prg_generate_conditional_count:nnNnn { set } { } } -\cs_set_protected_nopar:Npn \prg_new_conditional:Nnn +\cs_set_protected:Npn \prg_new_conditional:Nnn { \__prg_generate_conditional_count:nnNnn { new } { } } -\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Nnn +\cs_set_protected:Npn \prg_set_protected_conditional:Nnn { \__prg_generate_conditional_count:nnNnn { set } { _protected } } -\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Nnn +\cs_set_protected:Npn \prg_new_protected_conditional:Nnn { \__prg_generate_conditional_count:nnNnn { new } { _protected } } \cs_set_protected:Npn \__prg_generate_conditional_count:nnNnn #1#2#3 { @@ -1705,9 +1713,9 @@ \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 TF } #6 { #7 \exp_end: } } -\cs_set_protected_nopar:Npn \prg_set_eq_conditional:NNn +\cs_set_protected: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 +\cs_set_protected: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 { @@ -1774,7 +1782,7 @@ } \tex_chardef:D \c_true_bool = 1 ~ \tex_chardef:D \c_false_bool = 0 ~ -\cs_set_nopar:Npn \cs_to_str:N +\cs_set:Npn \cs_to_str:N { \tex_romannumeral:D \if:w \token_to_str:N \ \__cs_to_str:w \fi: @@ -1875,28 +1883,28 @@ { \cs_if_exist:cTF {#1} { \use:c {#1} #2 } { } } \cs_set:Npn \cs_if_exist_use:c #1 { \cs_if_exist:cTF {#1} { \use:c {#1} } { } } -\cs_set_protected_nopar:Npn \iow_log:x +\cs_set_protected:Npn \iow_log:x { \tex_immediate:D \tex_write:D \c_minus_one } -\cs_set_protected_nopar:Npn \iow_term:x +\cs_set_protected:Npn \iow_term:x { \tex_immediate:D \tex_write:D \c_sixteen } \tex_ifodd:D \l@expl@log@functions@bool - \cs_set_protected_nopar:Npn \__chk_log:x { \iow_log:x } - \cs_set_protected_nopar:Npn \__chk_suspend_log: + \cs_set_protected:Npn \__chk_log:x { \iow_log:x } + \cs_set_protected:Npn \__chk_suspend_log: { - \cs_set_protected_nopar:Npx \__chk_resume_log: + \cs_set_protected:Npx \__chk_resume_log: { - \cs_set_protected_nopar:Npn \__chk_resume_log: + \cs_set_protected:Npn \__chk_resume_log: { \exp_not:o { \__chk_resume_log: } } - \cs_set_protected_nopar:Npn \__chk_log:x + \cs_set_protected:Npn \__chk_log:x { \exp_not:o { \__chk_log:x } } } - \cs_set_protected_nopar:Npn \__chk_log:x { \use_none:n } + \cs_set_protected:Npn \__chk_log:x { \use_none:n } } - \cs_set_protected_nopar:Npn \__chk_resume_log: { } + \cs_set_protected:Npn \__chk_resume_log: { } \else: - \cs_set_protected_nopar:Npn \__chk_log:x { \use_none:n } - \cs_set_protected_nopar:Npn \__chk_suspend_log: { } - \cs_set_protected_nopar:Npn \__chk_resume_log: { } + \cs_set_protected:Npn \__chk_log:x { \use_none:n } + \cs_set_protected:Npn \__chk_suspend_log: { } + \cs_set_protected:Npn \__chk_resume_log: { } \fi: \cs_set_protected:Npn \__msg_kernel_error:nnxx #1#2#3#4 { @@ -1915,7 +1923,7 @@ { \__msg_kernel_error:nnxx {#1} {#2} {#3} { } } \cs_set_protected:Npn \__msg_kernel_error:nn #1#2 { \__msg_kernel_error:nnxx {#1} {#2} { } { } } -\cs_set_nopar:Npn \msg_line_context: +\cs_set:Npn \msg_line_context: { on~line~ \tex_the:D \tex_inputlineno:D } \cs_set_protected:Npn \__chk_if_free_cs:N #1 { @@ -1936,7 +1944,7 @@ \__chk_log:x { Defining~\token_to_str:N #1~ \msg_line_context: } } \fi: -\cs_set_protected_nopar:Npn \__chk_if_free_cs:c +\cs_set_protected:Npn \__chk_if_free_cs:c { \exp_args:Nc \__chk_if_free_cs:N } \tex_ifodd:D \l@expl@check@declarations@bool \cs_set_protected:Npn \__chk_if_exist_var:N #1 @@ -1956,7 +1964,7 @@ { \token_to_str:N #1 } } } -\cs_set_protected_nopar:Npn \__chk_if_exist_cs:c +\cs_set_protected:Npn \__chk_if_exist_cs:c { \exp_args:Nc \__chk_if_exist_cs:N } \cs_set:Npn \__cs_tmp:w #1#2 { @@ -2001,21 +2009,21 @@ \__cs_tmp:w \cs_new_protected:cpn \cs_new_protected:Npn \__cs_tmp:w \cs_new_protected:cpx \cs_new_protected:Npx \cs_new_protected:Npn \cs_set_eq:NN #1 { \tex_let:D #1 =~ } -\cs_new_protected_nopar:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN } -\cs_new_protected_nopar:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN } -\cs_new_protected_nopar:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN } -\cs_new_protected_nopar:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN } -\cs_new_protected_nopar:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN } -\cs_new_protected_nopar:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN } -\cs_new_protected_nopar:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN } +\cs_new_protected:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN } +\cs_new_protected:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN } +\cs_new_protected:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN } +\cs_new_protected:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN } +\cs_new_protected:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN } +\cs_new_protected:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN } +\cs_new_protected:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN } \cs_new_protected:Npn \cs_new_eq:NN #1 { \__chk_if_free_cs:N #1 \tex_global:D \cs_set_eq:NN #1 } -\cs_new_protected_nopar:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN } -\cs_new_protected_nopar:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN } -\cs_new_protected_nopar:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN } +\cs_new_protected:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN } +\cs_new_protected:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN } +\cs_new_protected:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN } \cs_new_protected:Npn \cs_undefine:N #1 { \cs_gset_eq:NN #1 \tex_undefined:D } \cs_new_protected:Npn \cs_undefine:c #1 @@ -2067,7 +2075,7 @@ \c_minus_one \fi: } -\cs_new_nopar:Npn \__cs_count_signature:c +\cs_new:Npn \__cs_count_signature:c { \exp_args:Nc \__cs_count_signature:N } \cs_new_protected:Npn \cs_generate_from_arg_count:NNnn #1#2#3#4 { @@ -2079,13 +2087,13 @@ } {#4} } -\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:cNnn +\cs_new_protected:Npn \cs_generate_from_arg_count:cNnn { \exp_args:Nc \cs_generate_from_arg_count:NNnn } -\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:Ncnn +\cs_new_protected:Npn \cs_generate_from_arg_count:Ncnn { \exp_args:NNc \cs_generate_from_arg_count:NNnn } \cs_set:Npn \__cs_tmp:w #1#2#3 { - \cs_new_protected_nopar:cpx { cs_ #1 : #2 } + \cs_new_protected:cpx { cs_ #1 : #2 } { \exp_not:N \__cs_generate_from_signature:NNn \exp_after:wN \exp_not:N \cs:w cs_ #1 : #3 \cs_end: @@ -2100,6 +2108,12 @@ { \bool_if:NTF #3 { + \str_if_eq_x:nnF { } + { \tl_map_function:nN {#2} \__cs_generate_from_signature:n } + { + \__msg_kernel_error:nnx { kernel } { non-base-function } + { \token_to_str:N #5 } + } \cs_generate_from_arg_count:NNnn #5 #4 { \tl_count:n {#2} } {#6} } @@ -2108,6 +2122,11 @@ { \token_to_str:N #5 } } } +\cs_new:Npn \__cs_generate_from_signature:n #1 + { + \if:w n #1 \else: \if:w N #1 \else: + \if:w T #1 \else: \if:w F #1 \else: #1 \fi: \fi: \fi: \fi: + } \__cs_tmp:w { set } { Nn } { Npn } \__cs_tmp:w { set } { Nx } { Npx } \__cs_tmp:w { set_nopar } { Nn } { Npn } @@ -2134,7 +2153,7 @@ \__cs_tmp:w { new_protected_nopar } { Nx } { Npx } \cs_set:Npn \__cs_tmp:w #1#2 { - \cs_new_protected_nopar:cpx { cs_ #1 : c #2 } + \cs_new_protected:cpx { cs_ #1 : c #2 } { \exp_not:N \exp_args:Nc \exp_after:wN \exp_not:N \cs:w cs_ #1 : N #2 \cs_end: @@ -2169,28 +2188,28 @@ \if_meaning:w #1#2 \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new_nopar:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN } -\cs_new_nopar:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF } -\cs_new_nopar:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT } -\cs_new_nopar:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF } -\cs_new_nopar:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN } -\cs_new_nopar:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF } -\cs_new_nopar:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT } -\cs_new_nopar:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF } -\cs_new_nopar:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN } -\cs_new_nopar:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF } -\cs_new_nopar:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT } -\cs_new_nopar:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF } +\cs_new:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN } +\cs_new:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF } +\cs_new:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT } +\cs_new:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF } +\cs_new:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN } +\cs_new:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF } +\cs_new:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT } +\cs_new:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF } +\cs_new:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN } +\cs_new:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF } +\cs_new:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT } +\cs_new:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF } \cs_new_protected:Npn \__kernel_register_show:N #1 { \__msg_show_variable:NNNnn #1 \cs_if_exist:NTF ? { } { > ~ \token_to_str:N #1 = \tex_the:D #1 } } -\cs_new_protected_nopar:Npn \__kernel_register_show:c +\cs_new_protected:Npn \__kernel_register_show:c { \exp_args:Nc \__kernel_register_show:N } \cs_new_protected:Npn \cs_show:N #1 { \__msg_show_wrap:n { > ~ \token_to_str:N #1 = \cs_meaning:N #1 } } -\cs_new_protected_nopar:Npn \cs_show:c +\cs_new_protected:Npn \cs_show:c { \group_begin: \exp_args:NNc \group_end: \cs_show:N } \cs_new_nopar:Npn \prg_do_nothing: { } \cs_new_eq:NN \__prg_break_point:Nn \use_ii:nn @@ -2205,7 +2224,7 @@ \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} -%% File: l3expan.dtx Copyright (C) 1990-2015 The LaTeX3 project +%% File: l3expan.dtx Copyright (C) 1990-2016 The LaTeX3 project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -2237,7 +2256,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3expan.dtx 5983 2015-09-10 18:57:56Z joseph $ +\GetIdInfo$Id: l3expan.dtx 6684 2016-08-19 15:21:49Z bruno $ {L3 Argument expansion} \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 } } @@ -2386,35 +2405,35 @@ \cs:w #3 \exp_after:wN \cs_end: \exp_after:wN {#4} } -\cs_new_protected_nopar:Npn \exp_args:Nx { \::x \::: } -\cs_new_nopar:Npn \exp_args:Nnc { \::n \::c \::: } -\cs_new_nopar:Npn \exp_args:Nfo { \::f \::o \::: } -\cs_new_nopar:Npn \exp_args:Nff { \::f \::f \::: } -\cs_new_nopar:Npn \exp_args:Nnf { \::n \::f \::: } -\cs_new_nopar:Npn \exp_args:Nno { \::n \::o \::: } -\cs_new_nopar:Npn \exp_args:NnV { \::n \::V \::: } -\cs_new_nopar:Npn \exp_args:Noo { \::o \::o \::: } -\cs_new_nopar:Npn \exp_args:Nof { \::o \::f \::: } -\cs_new_nopar:Npn \exp_args:Noc { \::o \::c \::: } -\cs_new_protected_nopar:Npn \exp_args:NNx { \::N \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Ncx { \::c \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nnx { \::n \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nox { \::o \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nxo { \::x \::o \::: } -\cs_new_protected_nopar:Npn \exp_args:Nxx { \::x \::x \::: } -\cs_new_nopar:Npn \exp_args:NNno { \::N \::n \::o \::: } -\cs_new_nopar:Npn \exp_args:NNoo { \::N \::o \::o \::: } -\cs_new_nopar:Npn \exp_args:Nnnc { \::n \::n \::c \::: } -\cs_new_nopar:Npn \exp_args:Nnno { \::n \::n \::o \::: } -\cs_new_nopar:Npn \exp_args:Nooo { \::o \::o \::o \::: } -\cs_new_protected_nopar:Npn \exp_args:NNNx { \::N \::N \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:NNnx { \::N \::n \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:NNox { \::N \::o \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nnnx { \::n \::n \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nnox { \::n \::o \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Nccx { \::c \::c \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Ncnx { \::c \::n \::x \::: } -\cs_new_protected_nopar:Npn \exp_args:Noox { \::o \::o \::x \::: } +\cs_new_protected:Npn \exp_args:Nx { \::x \::: } +\cs_new:Npn \exp_args:Nnc { \::n \::c \::: } +\cs_new:Npn \exp_args:Nfo { \::f \::o \::: } +\cs_new:Npn \exp_args:Nff { \::f \::f \::: } +\cs_new:Npn \exp_args:Nnf { \::n \::f \::: } +\cs_new:Npn \exp_args:Nno { \::n \::o \::: } +\cs_new:Npn \exp_args:NnV { \::n \::V \::: } +\cs_new:Npn \exp_args:Noo { \::o \::o \::: } +\cs_new:Npn \exp_args:Nof { \::o \::f \::: } +\cs_new:Npn \exp_args:Noc { \::o \::c \::: } +\cs_new_protected:Npn \exp_args:NNx { \::N \::x \::: } +\cs_new_protected:Npn \exp_args:Ncx { \::c \::x \::: } +\cs_new_protected:Npn \exp_args:Nnx { \::n \::x \::: } +\cs_new_protected:Npn \exp_args:Nox { \::o \::x \::: } +\cs_new_protected:Npn \exp_args:Nxo { \::x \::o \::: } +\cs_new_protected:Npn \exp_args:Nxx { \::x \::x \::: } +\cs_new:Npn \exp_args:NNno { \::N \::n \::o \::: } +\cs_new:Npn \exp_args:NNoo { \::N \::o \::o \::: } +\cs_new:Npn \exp_args:Nnnc { \::n \::n \::c \::: } +\cs_new:Npn \exp_args:Nnno { \::n \::n \::o \::: } +\cs_new:Npn \exp_args:Nooo { \::o \::o \::o \::: } +\cs_new_protected:Npn \exp_args:NNNx { \::N \::N \::x \::: } +\cs_new_protected:Npn \exp_args:NNnx { \::N \::n \::x \::: } +\cs_new_protected:Npn \exp_args:NNox { \::N \::o \::x \::: } +\cs_new_protected:Npn \exp_args:Nnnx { \::n \::n \::x \::: } +\cs_new_protected:Npn \exp_args:Nnox { \::n \::o \::x \::: } +\cs_new_protected:Npn \exp_args:Nccx { \::c \::c \::x \::: } +\cs_new_protected:Npn \exp_args:Ncnx { \::c \::n \::x \::: } +\cs_new_protected:Npn \exp_args:Noox { \::o \::o \::x \::: } \cs_new:Npn \__exp_arg_last_unbraced:nn #1#2 { #2#1 } \cs_new:Npn \::f_unbraced \::: #1#2 { @@ -2470,11 +2489,11 @@ } \cs_new:Npn \exp_last_unbraced:NNNo #1#2#3#4 { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 #4 } -\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: } -\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: } -\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: } -\cs_new_nopar:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: } -\cs_new_protected_nopar:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: } +\cs_new:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: } +\cs_new:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: } +\cs_new:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: } +\cs_new:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: } +\cs_new_protected:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: } \cs_new:Npn \exp_last_two_unbraced:Noo #1#2#3 { \exp_after:wN \__exp_last_two_unbraced:noN \exp_after:wN {#3} {#2} #1 } \cs_new:Npn \__exp_last_two_unbraced:noN #1#2#3 @@ -2512,14 +2531,14 @@ { \exp_not:N \exp_after:wN \exp_not:N \if_meaning:w \exp_not:N \exp_not:N #1 #1 - \cs_set_eq:NN \exp_not:N \__cs_tmp:w \cs_new_protected_nopar:Npx + \cs_set_eq:NN \exp_not:N \__cs_tmp:w \cs_new_protected:Npx \exp_not:N \else: \exp_not:N \exp_after:wN \exp_not:N \__cs_generate_variant:ww \exp_not:N \token_to_meaning:N #1 \tl_to_str:n { ma } \exp_not:N \q_mark - \exp_not:N \q_mark \cs_new_protected_nopar:Npx + \exp_not:N \q_mark \cs_new_protected:Npx \tl_to_str:n { pr } - \exp_not:N \q_mark \cs_new_nopar:Npx + \exp_not:N \q_mark \cs_new:Npx \exp_not:N \q_stop \exp_not:N \fi: } @@ -2658,11 +2677,11 @@ { \exp_not:N \__cs_generate_internal_variant:wwnNwnn #1 \exp_not:N \q_mark - { \cs_set_eq:NN \exp_not:N \__cs_tmp:w \cs_new_protected_nopar:Npx } - \cs_new_protected_nopar:cpx + { \cs_set_eq:NN \exp_not:N \__cs_tmp:w \cs_new_protected:Npx } + \cs_new_protected:cpx \token_to_str:N x \exp_not:N \q_mark { } - \cs_new_nopar:cpx + \cs_new:cpx \exp_not:N \q_stop { exp_args:N #1 } { @@ -2717,7 +2736,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3tl.dtx 6465 2016-03-26 16:15:09Z joseph $ +\GetIdInfo$Id: l3tl.dtx 6692 2016-08-19 22:29:47Z bruno $ {L3 Token lists} \cs_new_protected:Npn \tl_new:N #1 { @@ -2889,11 +2908,11 @@ } \tex_fi:D \tl_const:Nx \c__tl_rescan_marker_tl { : \token_to_str:N : } -\cs_new_protected_nopar:Npn \tl_set_rescan:Nnn +\cs_new_protected:Npn \tl_set_rescan:Nnn { \__tl_set_rescan:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_rescan:Nnn +\cs_new_protected:Npn \tl_gset_rescan:Nnn { \__tl_set_rescan:NNnn \tl_gset:Nn } -\cs_new_protected_nopar:Npn \tl_rescan:nn +\cs_new_protected:Npn \tl_rescan:nn { \__tl_set_rescan:NNnn \prg_do_nothing: \use:n } \cs_new_protected:Npn \__tl_set_rescan:NNnn #1#2#3#4 { @@ -2992,13 +3011,13 @@ } } \group_end: -\cs_new_protected_nopar:Npn \tl_replace_once:Nnn +\cs_new_protected:Npn \tl_replace_once:Nnn { \__tl_replace:NnNNNnn \q_mark ? \__tl_replace_wrap:w \tl_set:Nx } -\cs_new_protected_nopar:Npn \tl_greplace_once:Nnn +\cs_new_protected:Npn \tl_greplace_once:Nnn { \__tl_replace:NnNNNnn \q_mark ? \__tl_replace_wrap:w \tl_gset:Nx } -\cs_new_protected_nopar:Npn \tl_replace_all:Nnn +\cs_new_protected:Npn \tl_replace_all:Nnn { \__tl_replace:NnNNNnn \q_mark ? \__tl_replace_next:w \tl_set:Nx } -\cs_new_protected_nopar:Npn \tl_greplace_all:Nnn +\cs_new_protected:Npn \tl_greplace_all:Nnn { \__tl_replace:NnNNNnn \q_mark ? \__tl_replace_next:w \tl_gset:Nx } \cs_generate_variant:Nn \tl_replace_once:Nnn { c } \cs_generate_variant:Nn \tl_greplace_once:Nnn { c } @@ -3146,9 +3165,9 @@ } \tl_new:N \l__tl_internal_a_tl \tl_new:N \l__tl_internal_b_tl -\cs_new_protected_nopar:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT } -\cs_new_protected_nopar:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF } -\cs_new_protected_nopar:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF } +\cs_new_protected:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT } +\cs_new_protected:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF } +\cs_new_protected:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF } \cs_generate_variant:Nn \tl_if_in:NnT { c } \cs_generate_variant:Nn \tl_if_in:NnF { c } \cs_generate_variant:Nn \tl_if_in:NnTF { c } @@ -3218,7 +3237,7 @@ \q_recursion_tail \__prg_break_point:Nn \tl_map_break: { } } -\cs_new_nopar:Npn \tl_map_function:NN +\cs_new:Npn \tl_map_function:NN { \exp_args:No \tl_map_function:nN } \cs_new:Npn \__tl_map_function:Nn #1#2 { @@ -3244,7 +3263,7 @@ \q_recursion_tail \__prg_break_point:Nn \tl_map_break: { } } -\cs_new_protected_nopar:Npn \tl_map_variable:NNn +\cs_new_protected:Npn \tl_map_variable:NNn { \exp_args:No \tl_map_variable:nNn } \cs_new_protected:Npn \__tl_map_variable:Nnn #1#2#3 { @@ -3254,9 +3273,9 @@ \__tl_map_variable:Nnn #1 {#2} } \cs_generate_variant:Nn \tl_map_variable:NNn { c } -\cs_new_nopar:Npn \tl_map_break: +\cs_new:Npn \tl_map_break: { \__prg_map_break:Nn \tl_map_break: { } } -\cs_new_nopar:Npn \tl_map_break:n +\cs_new:Npn \tl_map_break:n { \__prg_map_break:Nn \tl_map_break: } \cs_new:Npn \tl_to_str:N #1 { \etex_detokenize:D \exp_after:wN {#1} } \cs_generate_variant:Nn \tl_to_str:N { c } @@ -3439,7 +3458,7 @@ } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} -\cs_new_nopar:Npn \tl_head:N { \exp_args:No \tl_head:n } +\cs_new:Npn \tl_head:N { \exp_args:No \tl_head:n } \cs_new:Npn \tl_tail:n #1 { \etex_unexpanded:D @@ -3448,7 +3467,7 @@ { \exp_after:wN { \use_none:n #1 } } } \cs_generate_variant:Nn \tl_tail:n { V , v , f } -\cs_new_nopar:Npn \tl_tail:N { \exp_args:No \tl_tail:n } +\cs_new:Npn \tl_tail:N { \exp_args:No \tl_tail:n } \prg_new_conditional:Npnn \tl_if_head_eq_charcode:nN #1#2 { p , T , F , TF } { \if_charcode:w @@ -3584,7 +3603,7 @@ { \__prg_break:n { \exp_not:n {#2} } } { \exp_args:Nf \__tl_item:nn { \int_eval:n { #1 - 1 } } } } -\cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn } +\cs_new:Npn \tl_item:Nn { \exp_args:No \tl_item:nn } \cs_generate_variant:Nn \tl_item:Nn { c } \cs_new_protected:Npn \tl_show:N #1 { @@ -3634,7 +3653,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3str.dtx 6441 2016-03-24 10:11:59Z joseph $ +\GetIdInfo$Id: l3str.dtx 6692 2016-08-19 22:29:47Z bruno $ {L3 Strings} \group_begin: \cs_set_protected:Npn \__str_tmp:n #1 @@ -3827,7 +3846,7 @@ \cs_new:Npn \__str_to_other_end:w \fi: #1 \q_mark #2 * A #3 \q_stop { \fi: #2 } } -\cs_new_nopar:Npn \str_item:Nn { \exp_args:No \str_item:nn } +\cs_new:Npn \str_item:Nn { \exp_args:No \str_item:nn } \cs_generate_variant:Nn \str_item:Nn { c } \cs_new:Npn \str_item:nn #1#2 { @@ -3885,7 +3904,7 @@ \if_case:w #1 \exp_stop_f: \or: \or: \or: \or: \or: \or: \or: \or: } \cs_new:Npn \__str_skip_end:NNNNNNNN #1#2#3#4#5#6#7#8 { \fi: \exp_end: } -\cs_new_nopar:Npn \str_range:Nnn { \exp_args:No \str_range:nnn } +\cs_new:Npn \str_range:Nnn { \exp_args:No \str_range:nnn } \cs_generate_variant:Nn \str_range:Nnn { c } \cs_new:Npn \str_range:nnn #1#2#3 { @@ -3961,7 +3980,7 @@ } \cs_new:Npn \__str_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop { #1#2#3#4#5#6#7#8 } -\cs_new_nopar:Npn \str_count_spaces:N +\cs_new:Npn \str_count_spaces:N { \exp_args:No \str_count_spaces:n } \cs_generate_variant:Nn \str_count_spaces:N { c } \cs_new:Npn \str_count_spaces:n #1 @@ -3981,7 +4000,7 @@ \fi: \c_nine + \__str_count_spaces_loop:w } -\cs_new_nopar:Npn \str_count:N { \exp_args:No \str_count:n } +\cs_new:Npn \str_count:N { \exp_args:No \str_count:n } \cs_generate_variant:Nn \str_count:N { c } \cs_new:Npn \str_count:n #1 { @@ -4019,7 +4038,7 @@ \fi: \c_nine + \__str_count_loop:NNNNNNNNN } -\cs_new_nopar:Npn \str_head:N { \exp_args:No \str_head:n } +\cs_new:Npn \str_head:N { \exp_args:No \str_head:n } \cs_generate_variant:Nn \str_head:N { c } \cs_set:Npn \str_head:n #1 { @@ -4034,7 +4053,7 @@ \exp_after:wN \use_i_delimit_by_q_stop:nw \tl_to_str:n {#1} { } \q_stop } -\cs_new_nopar:Npn \str_tail:N { \exp_args:No \str_tail:n } +\cs_new:Npn \str_tail:N { \exp_args:No \str_tail:n } \cs_generate_variant:Nn \str_tail:N { c } \cs_set:Npn \str_tail:n #1 { @@ -4171,7 +4190,6 @@ \__unicode_map_loop: } } - \cs_set_nopar:Npn \l__unicode_tmp_tl { } \cs_set_protected:Npn \__unicode_parse:w #1#2 \q_stop { \reverse_if:N \if:w \c_hash_str #1 @@ -4260,7 +4278,7 @@ ? \q_recursion_tail \q_recursion_stop } \group_end: -%% File: l3seq.dtx Copyright (C) 1990-2015 The LaTeX3 Project +%% File: l3seq.dtx Copyright (C) 1990-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -4292,7 +4310,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3seq.dtx 5777 2015-08-05 02:32:21Z bruno $ +\GetIdInfo$Id: l3seq.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Sequences and stacks} \cs_new:Npn \__seq_item:n { @@ -4355,9 +4373,9 @@ \cs_generate_variant:Nn \seq_gset_from_clist:NN { Nc } \cs_generate_variant:Nn \seq_gset_from_clist:NN { c , cc } \cs_generate_variant:Nn \seq_gset_from_clist:Nn { c } -\cs_new_protected_nopar:Npn \seq_set_split:Nnn +\cs_new_protected:Npn \seq_set_split:Nnn { \__seq_set_split:NNnn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_split:Nnn +\cs_new_protected:Npn \seq_gset_split:Nnn { \__seq_set_split:NNnn \tl_gset:Nx } \cs_new_protected:Npn \__seq_set_split:NNnn #1#2#3#4 { @@ -4475,9 +4493,9 @@ } \cs_generate_variant:Nn \seq_remove_all:Nn { c } \cs_generate_variant:Nn \seq_gremove_all:Nn { c } -\cs_new_protected_nopar:Npn \seq_reverse:N +\cs_new_protected:Npn \seq_reverse:N { \__seq_reverse:NN \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_greverse:N +\cs_new_protected:Npn \seq_greverse:N { \__seq_reverse:NN \tl_gset:Nx } \cs_new_protected:Npn \__seq_reverse:NN #1 #2 { @@ -4522,7 +4540,7 @@ \prg_return_false: \__prg_break_point: } -\cs_new_nopar:Npn \__seq_if_in: +\cs_new:Npn \__seq_if_in: { \__prg_break:n { \group_end: \prg_return_true: } } \cs_generate_variant:Nn \seq_if_in:NnT { NV , Nv , No , Nx } \cs_generate_variant:Nn \seq_if_in:NnT { c , cV , cv , co , cx } @@ -4559,9 +4577,9 @@ \cs_new:Npn \__seq_get_left:wnw #1 \__seq_item:n #2#3 \q_stop { \exp_not:n {#2} } \cs_generate_variant:Nn \seq_get_left:NN { c } -\cs_new_protected_nopar:Npn \seq_pop_left:NN +\cs_new_protected:Npn \seq_pop_left:NN { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_set:Nn } -\cs_new_protected_nopar:Npn \seq_gpop_left:NN +\cs_new_protected:Npn \seq_gpop_left:NN { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_gset:Nn } \cs_new_protected:Npn \__seq_pop_left:NNN #1#2#3 { \exp_after:wN \__seq_pop_left:wnwNNN #2 \q_stop #1#2#3 } @@ -4588,9 +4606,9 @@ \__seq_get_right_loop:nn } \cs_generate_variant:Nn \seq_get_right:NN { c } -\cs_new_protected_nopar:Npn \seq_pop_right:NN +\cs_new_protected:Npn \seq_pop_right:NN { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gpop_right:NN +\cs_new_protected:Npn \seq_gpop_right:NN { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_gset:Nx } \cs_new_protected:Npn \__seq_pop_right:NNN #1#2#3 { @@ -4670,9 +4688,9 @@ { \exp_args:Nf \__seq_item:nnn { \int_eval:n { #1 - 1 } } } } \cs_generate_variant:Nn \seq_item:Nn { c } -\cs_new_nopar:Npn \seq_map_break: +\cs_new:Npn \seq_map_break: { \__prg_map_break:Nn \seq_map_break: { } } -\cs_new_nopar:Npn \seq_map_break:n +\cs_new:Npn \seq_map_break:n { \__prg_map_break:Nn \seq_map_break: } \cs_new:Npn \seq_map_function:NN #1#2 { @@ -4706,7 +4724,7 @@ \cs_gset_eq:cN { __prg_map_ \int_use:N \g__prg_map_int :w } \__seq_item:n } -\cs_new_protected_nopar:Npn \__seq_pop_item_def: +\cs_new_protected:Npn \__seq_pop_item_def: { \cs_gset_eq:Nc \__seq_item:n { __prg_map_ \int_use:N \g__prg_map_int :w } @@ -4853,7 +4871,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3int.dtx 6441 2016-03-24 10:11:59Z joseph $ +\GetIdInfo$Id: l3int.dtx 6700 2016-09-07 22:16:49Z bruno $ {L3 Integers} \cs_new_eq:NN \__int_value:w \tex_number:D \cs_new_eq:NN \__int_eval:w \etex_numexpr:D @@ -4934,7 +4952,11 @@ \cs_generate_variant:Nn \int_new:N { c } \cs_new_protected:Npn \int_const:Nn #1#2 { - \int_compare:nNnTF {#2} > \c_minus_one + \int_compare:nNnTF {#2} < \c_zero + { + \int_new:N #1 + \int_gset:Nn #1 {#2} + } { \int_compare:nNnTF {#2} > \c__max_constdef_int { @@ -4947,10 +4969,6 @@ \__int_eval:w #2 \__int_eval_end: } } - { - \int_new:N #1 - \int_gset:Nn #1 {#2} - } } \cs_generate_variant:Nn \int_const:Nn { c } \if_int_odd:w 0 @@ -4990,9 +5008,9 @@ { \tex_advance:D #1 by \__int_eval:w #2 \__int_eval_end: } \cs_new_protected:Npn \int_sub:Nn #1#2 { \tex_advance:D #1 by - \__int_eval:w #2 \__int_eval_end: } -\cs_new_protected_nopar:Npn \int_gadd:Nn +\cs_new_protected:Npn \int_gadd:Nn { \tex_global:D \int_add:Nn } -\cs_new_protected_nopar:Npn \int_gsub:Nn +\cs_new_protected:Npn \int_gsub:Nn { \tex_global:D \int_sub:Nn } \cs_generate_variant:Nn \int_add:Nn { c } \cs_generate_variant:Nn \int_gadd:Nn { c } @@ -5002,9 +5020,9 @@ { \tex_advance:D #1 \c_one } \cs_new_protected:Npn \int_decr:N #1 { \tex_advance:D #1 \c_minus_one } -\cs_new_protected_nopar:Npn \int_gincr:N +\cs_new_protected:Npn \int_gincr:N { \tex_global:D \int_incr:N } -\cs_new_protected_nopar:Npn \int_gdecr:N +\cs_new_protected:Npn \int_gdecr:N { \tex_global:D \int_decr:N } \cs_generate_variant:Nn \int_incr:N { c } \cs_generate_variant:Nn \int_decr:N { c } @@ -5012,12 +5030,12 @@ \cs_generate_variant:Nn \int_gdecr:N { c } \cs_new_protected:Npn \int_set:Nn #1#2 { #1 ~ \__int_eval:w #2\__int_eval_end: } -\cs_new_protected_nopar:Npn \int_gset:Nn { \tex_global:D \int_set:Nn } +\cs_new_protected:Npn \int_gset:Nn { \tex_global:D \int_set:Nn } \cs_generate_variant:Nn \int_set:Nn { c } \cs_generate_variant:Nn \int_gset:Nn { c } \cs_new_eq:NN \int_use:N \tex_the:D \cs_new:Npn \int_use:c #1 { \tex_the:D \cs:w #1 \cs_end: } -\cs_new_protected_nopar:Npn \__prg_compare_error: +\cs_new_protected:Npn \__prg_compare_error: { \if_int_compare:w \c_zero \c_zero \fi: = @@ -5224,18 +5242,18 @@ #1 { \int_eval:n { #2 + #3 } } {#3} {#4} #5 } } -\cs_new_protected_nopar:Npn \int_step_inline:nnnn +\cs_new_protected:Npn \int_step_inline:nnnn { \int_gincr:N \g__prg_map_int \exp_args:NNc \__int_step:NNnnnn - \cs_gset_nopar:Npn + \cs_gset:Npn { __prg_map_ \int_use:N \g__prg_map_int :w } } \cs_new_protected:Npn \int_step_variable:nnnNn #1#2#3#4#5 { \int_gincr:N \g__prg_map_int \exp_args:NNc \__int_step:NNnnnn - \cs_gset_nopar:Npx + \cs_gset:Npx { __prg_map_ \int_use:N \g__prg_map_int :w } {#1}{#2}{#3} { @@ -5484,21 +5502,21 @@ \use:c { __int_to_Roman_ #1 :w } \__int_to_Roman_aux:N } -\cs_new_nopar:Npn \__int_to_roman_i:w { i } -\cs_new_nopar:Npn \__int_to_roman_v:w { v } -\cs_new_nopar:Npn \__int_to_roman_x:w { x } -\cs_new_nopar:Npn \__int_to_roman_l:w { l } -\cs_new_nopar:Npn \__int_to_roman_c:w { c } -\cs_new_nopar:Npn \__int_to_roman_d:w { d } -\cs_new_nopar:Npn \__int_to_roman_m:w { m } -\cs_new_nopar:Npn \__int_to_roman_Q:w #1 { } -\cs_new_nopar:Npn \__int_to_Roman_i:w { I } -\cs_new_nopar:Npn \__int_to_Roman_v:w { V } -\cs_new_nopar:Npn \__int_to_Roman_x:w { X } -\cs_new_nopar:Npn \__int_to_Roman_l:w { L } -\cs_new_nopar:Npn \__int_to_Roman_c:w { C } -\cs_new_nopar:Npn \__int_to_Roman_d:w { D } -\cs_new_nopar:Npn \__int_to_Roman_m:w { M } +\cs_new:Npn \__int_to_roman_i:w { i } +\cs_new:Npn \__int_to_roman_v:w { v } +\cs_new:Npn \__int_to_roman_x:w { x } +\cs_new:Npn \__int_to_roman_l:w { l } +\cs_new:Npn \__int_to_roman_c:w { c } +\cs_new:Npn \__int_to_roman_d:w { d } +\cs_new:Npn \__int_to_roman_m:w { m } +\cs_new:Npn \__int_to_roman_Q:w #1 { } +\cs_new:Npn \__int_to_Roman_i:w { I } +\cs_new:Npn \__int_to_Roman_v:w { V } +\cs_new:Npn \__int_to_Roman_x:w { X } +\cs_new:Npn \__int_to_Roman_l:w { L } +\cs_new:Npn \__int_to_Roman_c:w { C } +\cs_new:Npn \__int_to_Roman_d:w { D } +\cs_new:Npn \__int_to_Roman_m:w { M } \cs_new:Npn \__int_to_Roman_Q:w #1 { } \cs_new:Npn \__int_pass_signs:wn #1 { @@ -5615,7 +5633,7 @@ } } \cs_generate_variant:Nn \int_show:N { c } -\cs_new_protected_nopar:Npn \int_show:n +\cs_new_protected:Npn \int_show:n { \__msg_show_wrap:Nn \int_eval:n } \int_const:Nn \c_one { 1 } \int_const:Nn \c_two { 2 } @@ -5639,6 +5657,16 @@ \int_const:Nn \c_one_thousand { 1000 } \int_const:Nn \c_ten_thousand { 10000 } \int_const:Nn \c_max_int { 2 147 483 647 } +\int_const:Nn \c_max_char_int + { + \if_int_odd:w 0 + \cs_if_exist:NT \luatex_luatexversion:D { 1 } + \cs_if_exist:NT \xetex_XeTeXversion:D { 1 } ~ + "10FFFF + \else: + "FF + \fi: + } \int_new:N \l_tmpa_int \int_new:N \l_tmpb_int \int_new:N \g_tmpa_int @@ -5675,7 +5703,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3quark.dtx 5855 2015-08-17 17:22:56Z mittelba $ +\GetIdInfo$Id: l3quark.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Quarks} \cs_new_protected:Npn \quark_new:N #1 { \tl_const:Nn #1 {#1} } \quark_new:N \q_nil @@ -5783,7 +5811,7 @@ \__scan_new:N \s__stop \cs_new:Npn \__use_none_delimit_by_s__stop:w #1 \s__stop { } \__scan_new:N \s__seq -%% File: l3prg.dtx Copyright (C) 2005-2015 The LaTeX3 Project +%% File: l3prg.dtx Copyright (C) 2005-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -5815,7 +5843,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3prg.dtx 6216 2015-11-01 23:32:43Z bruno $ +\GetIdInfo$Id: l3prg.dtx 6679 2016-08-18 20:54:06Z bruno $ {L3 Control structures} \cs_new_eq:NN \if_bool:N \tex_ifodd:D \cs_new_eq:NN \if_predicate:w \tex_ifodd:D @@ -5906,7 +5934,7 @@ \__msg_show_variable:NNNnn #1 \bool_if_exist:NTF ? { } { > ~ \token_to_str:N #1 = \__bool_to_str:n {#1} } } -\cs_new_protected_nopar:Npn \bool_show:n +\cs_new_protected:Npn \bool_show:n { \__msg_show_wrap:Nn \__bool_to_str:n } \cs_new:Npn \__bool_to_str:n #1 { \bool_if:nTF {#1} { true } { false } } @@ -5975,15 +6003,15 @@ :w } } -\cs_new_nopar:cpn { __bool_)_0:w } { \c_false_bool } -\cs_new_nopar:cpn { __bool_)_1:w } { \c_true_bool } -\cs_new_nopar:cpn { __bool_S_0:w } { \group_align_safe_end: \c_false_bool } -\cs_new_nopar:cpn { __bool_S_1:w } { \group_align_safe_end: \c_true_bool } -\cs_new_nopar:cpn { __bool_&_1:w } & { \__bool_get_next:NN \use_i:nn } -\cs_new_nopar:cpn { __bool_|_0:w } | { \__bool_get_next:NN \use_i:nn } -\cs_new_nopar:cpn { __bool_&_0:w } & +\cs_new:cpn { __bool_)_0:w } { \c_false_bool } +\cs_new:cpn { __bool_)_1:w } { \c_true_bool } +\cs_new:cpn { __bool_S_0:w } { \group_align_safe_end: \c_false_bool } +\cs_new:cpn { __bool_S_1:w } { \group_align_safe_end: \c_true_bool } +\cs_new:cpn { __bool_&_1:w } & { \__bool_get_next:NN \use_i:nn } +\cs_new:cpn { __bool_|_0:w } | { \__bool_get_next:NN \use_i:nn } +\cs_new:cpn { __bool_&_0:w } & { \__bool_eval_skip_to_end_auxi:Nw \c_false_bool } -\cs_new_nopar:cpn { __bool_|_1:w } | +\cs_new:cpn { __bool_|_1:w } | { \__bool_eval_skip_to_end_auxi:Nw \c_true_bool } %% ( \cs_new:Npn \__bool_eval_skip_to_end_auxi:Nw #1#2 ) @@ -6102,15 +6130,15 @@ { \if_mode_inner: \prg_return_true: \else: \prg_return_false: \fi: } \prg_new_conditional:Npnn \mode_if_math: { p , T , F , TF } { \if_mode_math: \prg_return_true: \else: \prg_return_false: \fi: } -\cs_new_nopar:Npn \group_align_safe_begin: +\cs_new:Npn \group_align_safe_begin: { \if_int_compare:w \if_false: { \fi: `} = \c_zero \fi: } -\cs_new_nopar:Npn \group_align_safe_end: +\cs_new:Npn \group_align_safe_end: { \if_int_compare:w `{ = \c_zero } \fi: } \int_new:N \g__prg_map_int -\cs_new_protected_nopar:Npn \scan_align_safe_stop: { } +\cs_new_protected:Npn \scan_align_safe_stop: { } %% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach, %% The LaTeX3 project -%% (C) 2012-2015 The LaTeX3 Project +%% (C) 2012-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -6142,7 +6170,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3clist.dtx 5901 2015-09-02 05:59:23Z joseph $ +\GetIdInfo$Id: l3clist.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Comma separated lists} \cs_new_eq:NN \c_empty_clist \c_empty_tl \tl_new:N \l__clist_internal_clist @@ -6196,9 +6224,9 @@ \cs_generate_variant:Nn \clist_set_from_seq:NN { c , cc } \cs_generate_variant:Nn \clist_gset_from_seq:NN { Nc } \cs_generate_variant:Nn \clist_gset_from_seq:NN { c , cc } -\cs_new_protected_nopar:Npn \clist_concat:NNN +\cs_new_protected:Npn \clist_concat:NNN { \__clist_concat:NNNN \tl_set:Nx } -\cs_new_protected_nopar:Npn \clist_gconcat:NNN +\cs_new_protected:Npn \clist_gconcat:NNN { \__clist_concat:NNNN \tl_gset:Nx } \cs_new_protected:Npn \__clist_concat:NNNN #1#2#3#4 { @@ -6248,9 +6276,9 @@ { \tl_gset:Nx #1 { \__clist_trim_spaces:n {#2} } } \cs_generate_variant:Nn \clist_set:Nn { NV , No , Nx , c , cV , co , cx } \cs_generate_variant:Nn \clist_gset:Nn { NV , No , Nx , c , cV , co , cx } -\cs_new_protected_nopar:Npn \clist_put_left:Nn +\cs_new_protected:Npn \clist_put_left:Nn { \__clist_put_left:NNNn \clist_concat:NNN \clist_set:Nn } -\cs_new_protected_nopar:Npn \clist_gput_left:Nn +\cs_new_protected:Npn \clist_gput_left:Nn { \__clist_put_left:NNNn \clist_gconcat:NNN \clist_set:Nn } \cs_new_protected:Npn \__clist_put_left:NNNn #1#2#3#4 { @@ -6261,9 +6289,9 @@ \cs_generate_variant:Nn \clist_put_left:Nn { c , cV , co , cx } \cs_generate_variant:Nn \clist_gput_left:Nn { NV , No , Nx } \cs_generate_variant:Nn \clist_gput_left:Nn { c , cV , co , cx } -\cs_new_protected_nopar:Npn \clist_put_right:Nn +\cs_new_protected:Npn \clist_put_right:Nn { \__clist_put_right:NNNn \clist_concat:NNN \clist_set:Nn } -\cs_new_protected_nopar:Npn \clist_gput_right:Nn +\cs_new_protected:Npn \clist_gput_right:Nn { \__clist_put_right:NNNn \clist_gconcat:NNN \clist_set:Nn } \cs_new_protected:Npn \__clist_put_right:NNNn #1#2#3#4 { @@ -6285,9 +6313,9 @@ \cs_new_protected:Npn \__clist_get:wN #1 , #2 \q_stop #3 { \tl_set:Nn #3 {#1} } \cs_generate_variant:Nn \clist_get:NN { c } -\cs_new_protected_nopar:Npn \clist_pop:NN +\cs_new_protected:Npn \clist_pop:NN { \__clist_pop:NNN \tl_set:Nx } -\cs_new_protected_nopar:Npn \clist_gpop:NN +\cs_new_protected:Npn \clist_gpop:NN { \__clist_pop:NNN \tl_gset:Nx } \cs_new_protected:Npn \__clist_pop:NNN #1#2#3 { @@ -6540,9 +6568,9 @@ \__clist_map_variable:Nnw #1 {#2} } \cs_generate_variant:Nn \clist_map_variable:NNn { c } -\cs_new_nopar:Npn \clist_map_break: +\cs_new:Npn \clist_map_break: { \__prg_map_break:Nn \clist_map_break: { } } -\cs_new_nopar:Npn \clist_map_break:n +\cs_new:Npn \clist_map_break:n { \__prg_map_break:Nn \clist_map_break: } \cs_new:Npn \clist_count:N #1 { @@ -6712,7 +6740,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3token.dtx 6470 2016-04-03 11:29:18Z joseph $ +\GetIdInfo$Id: l3token.dtx 6695 2016-09-01 15:38:50Z bruno $ {L3 Experimental token manipulation} \cs_new_protected:Npn \char_set_catcode:nn #1#2 { @@ -6887,7 +6915,7 @@ \if_int_compare:w #1 < \c_zero 1 \fi: \if_int_compare:w #1 > \c__char_max_int 1 \fi: \exp_stop_f: \__msg_kernel_expandable_error:nn { kernel } - { char-out-of-range } + { char-out-of-range } \else: \__char_generate_aux:nnw {#1} {#2} \fi: @@ -6899,7 +6927,7 @@ \tl_new:N \l__char_tmp_tl \group_begin: \char_set_catcode_active:N \^^L - \cs_set_nopar:Npn ^^L { } + \cs_set:Npn ^^L { } \char_set_catcode_other:n { 0 } \if_int_odd:w 0 \cs_if_exist:NT \luatex_directlua:D { 1 } @@ -7247,13 +7275,13 @@ \cs_new_eq:NN \g_peek_token ? \cs_new_eq:NN \l__peek_search_token ? \tl_new:N \l__peek_search_tl -\cs_new_nopar:Npn \__peek_true:w { } -\cs_new_nopar:Npn \__peek_true_aux:w { } -\cs_new_nopar:Npn \__peek_false:w { } +\cs_new:Npn \__peek_true:w { } +\cs_new:Npn \__peek_true_aux:w { } +\cs_new:Npn \__peek_false:w { } \cs_new:Npn \__peek_tmp:w { } -\cs_new_protected_nopar:Npn \peek_after:Nw +\cs_new_protected:Npn \peek_after:Nw { \tex_futurelet:D \l_peek_token } -\cs_new_protected_nopar:Npn \peek_gafter:Nw +\cs_new_protected:Npn \peek_gafter:Nw { \tex_global:D \tex_futurelet:D \g_peek_token } \cs_new_protected:Npn \__peek_true_remove:w { @@ -7265,12 +7293,12 @@ { \cs_set_eq:NN \l__peek_search_token #2 \tl_set:Nn \l__peek_search_tl {#2} - \cs_set_nopar:Npx \__peek_true:w + \cs_set:Npx \__peek_true:w { \exp_not:N \group_align_safe_end: \exp_not:n {#3} } - \cs_set_nopar:Npx \__peek_false:w + \cs_set:Npx \__peek_false:w { \exp_not:N \group_align_safe_end: \exp_not:n {#4} @@ -7287,8 +7315,8 @@ \cs_set_eq:NN \l__peek_search_token #2 \tl_set:Nn \l__peek_search_tl {#2} \cs_set_eq:NN \__peek_true:w \__peek_true_remove:w - \cs_set_nopar:Npx \__peek_true_aux:w { \exp_not:n {#3} } - \cs_set_nopar:Npx \__peek_false:w + \cs_set:Npx \__peek_true_aux:w { \exp_not:n {#3} } + \cs_set:Npx \__peek_false:w { \exp_not:N \group_align_safe_end: \exp_not:n {#4} @@ -7300,7 +7328,7 @@ { \__peek_token_remove_generic:NNTF #1 #2 {#3} { } } \cs_new_protected:Npn \__peek_token_remove_generic:NNF #1#2#3 { \__peek_token_remove_generic:NNTF #1 #2 { } {#3} } -\cs_new_nopar:Npn \__peek_execute_branches_meaning: +\cs_new:Npn \__peek_execute_branches_meaning: { \if_meaning:w \l_peek_token \l__peek_search_token \exp_after:wN \__peek_true:w @@ -7308,11 +7336,11 @@ \exp_after:wN \__peek_false:w \fi: } -\cs_new_nopar:Npn \__peek_execute_branches_catcode: +\cs_new:Npn \__peek_execute_branches_catcode: { \if_catcode:w \__peek_execute_branches_catcode_aux: } -\cs_new_nopar:Npn \__peek_execute_branches_charcode: +\cs_new:Npn \__peek_execute_branches_charcode: { \if_charcode:w \__peek_execute_branches_catcode_aux: } -\cs_new_nopar:Npn \__peek_execute_branches_catcode_aux: +\cs_new:Npn \__peek_execute_branches_catcode_aux: { \if_catcode:w \exp_not:N \l_peek_token \scan_stop: \exp_after:wN \exp_after:wN @@ -7332,7 +7360,7 @@ \fi: #1 } -\cs_new_nopar:Npn \__peek_execute_branches_catcode_auxiii: +\cs_new:Npn \__peek_execute_branches_catcode_auxiii: { \exp_not:N \l_peek_token \exp_after:wN \exp_not:N \l__peek_search_tl @@ -7341,7 +7369,7 @@ \exp_after:wN \__peek_false:w \fi: } -\cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches: +\cs_new_protected:Npn \__peek_ignore_spaces_execute_branches: { \if_meaning:w \l_peek_token \c_space_token \exp_after:wN \peek_after:Nw @@ -7360,7 +7388,7 @@ } \cs_set:Npn \__peek_def:nnnnn #1#2#3#4#5 { - \cs_new_protected_nopar:cpx { #1 #5 } + \cs_new_protected:cpx { #1 #5 } { \tl_if_empty:nF {#2} { \exp_not:n { \cs_set_eq:NN \__peek_execute_branches: #2 } } @@ -7480,7 +7508,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3prop.dtx 6366 2016-01-05 22:18:59Z joseph $ +\GetIdInfo$Id: l3prop.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Property lists} \__scan_new:N \s__prop \cs_new:Npn \__prop_pair:wn #1 \s__prop #2 @@ -7613,8 +7641,8 @@ \cs_generate_variant:Nn \prop_gpop:NnNT { c } \cs_generate_variant:Nn \prop_gpop:NnNF { c } \cs_generate_variant:Nn \prop_gpop:NnNTF { c } -\cs_new_protected_nopar:Npn \prop_put:Nnn { \__prop_put:NNnn \tl_set:Nx } -\cs_new_protected_nopar:Npn \prop_gput:Nnn { \__prop_put:NNnn \tl_gset:Nx } +\cs_new_protected:Npn \prop_put:Nnn { \__prop_put:NNnn \tl_set:Nx } +\cs_new_protected:Npn \prop_gput:Nnn { \__prop_put:NNnn \tl_gset:Nx } \cs_new_protected:Npn \__prop_put:NNnn #1#2#3#4 { \tl_set:Nn \l__prop_internal_tl @@ -7634,9 +7662,9 @@ { NnV , Nno , Nnx , NV , NVV , No , Noo } \cs_generate_variant:Nn \prop_gput:Nnn { c , cnV , cno , cnx , cV , cVV , co , coo } -\cs_new_protected_nopar:Npn \prop_put_if_new:Nnn +\cs_new_protected:Npn \prop_put_if_new:Nnn { \__prop_put_if_new:NNnn \tl_set:Nx } -\cs_new_protected_nopar:Npn \prop_gput_if_new:Nnn +\cs_new_protected:Npn \prop_gput_if_new:Nnn { \__prop_put_if_new:NNnn \tl_gset:Nx } \cs_new_protected:Npn \__prop_put_if_new:NNnn #1#2#3#4 { @@ -7740,9 +7768,9 @@ } } \cs_generate_variant:Nn \prop_map_inline:Nn { c } -\cs_new_nopar:Npn \prop_map_break: +\cs_new:Npn \prop_map_break: { \__prg_map_break:Nn \prop_map_break: { } } -\cs_new_nopar:Npn \prop_map_break:n +\cs_new:Npn \prop_map_break:n { \__prg_map_break:Nn \prop_map_break: } \cs_new_protected:Npn \prop_show:N #1 { @@ -7783,7 +7811,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3msg.dtx 6464 2016-03-26 13:03:37Z bruno $ +\GetIdInfo$Id: l3msg.dtx 6691 2016-08-19 22:14:26Z bruno $ {L3 Messages} \tl_new:N \l__msg_internal_tl \tl_const:Nn \c__msg_text_prefix_tl { msg~text~>~ } @@ -7869,8 +7897,8 @@ More~errors~will~almost~certainly~follow: \\ the~LaTeX~run~should~be~aborted. } -\cs_new_nopar:Npn \msg_line_number: { \int_use:N \tex_inputlineno:D } -\cs_gset_nopar:Npn \msg_line_context: +\cs_new:Npn \msg_line_number: { \int_use:N \tex_inputlineno:D } +\cs_gset:Npn \msg_line_context: { \c__msg_on_line_text_tl \c_space_tl @@ -7925,7 +7953,7 @@ \__iow_with:Nnn \tex_errorcontextlines:D \c_minus_one { \group_begin: - \cs_set_protected_nopar:Npn & + \cs_set_protected:Npn & { \tex_errmessage:D { @@ -8087,7 +8115,7 @@ \__msg_class_chk_exist:nT {#1} { \tl_set:Nn \l__msg_current_class_tl {#1} - \cs_set_protected_nopar:Npx \__msg_use_code: + \cs_set_protected:Npx \__msg_use_code: { \exp_not:n { @@ -8100,7 +8128,7 @@ } { \__msg_kernel_error:nnxx { kernel } { message-unknown } {#2} {#3} } } -\cs_new_protected_nopar:Npn \__msg_use_code: { } +\cs_new_protected:Npn \__msg_use_code: { } \cs_new_protected:Npn \__msg_use_redirect_name:n #1 { \prop_get:NnNTF \l__msg_redirect_prop { / #1 } \l__msg_class_tl @@ -8154,7 +8182,7 @@ { \prop_put:Nnn \l__msg_redirect_prop { / #1 / #2 } {#3} } } } -\cs_new_protected_nopar:Npn \msg_redirect_class:nn +\cs_new_protected:Npn \msg_redirect_class:nn { \__msg_redirect:nnn { } } \cs_new_protected:Npn \msg_redirect_module:nnn #1 { \__msg_redirect:nnn { / #1 } } @@ -8338,6 +8366,15 @@ of~each~type.~All~the~#1~registers~have~been~used.~ This~run~will~be~aborted~now. } +\__msg_kernel_new:nnnn { kernel } { non-base-function } + { Function~'#1'~is~not~a~base~function } + { + \c__msg_coding_error_text_tl + Functions~defined~through~\iow_char:N\\cs_new:Nn~must~have~ + a~signature~consisting~of~only~normal~arguments~'N'~and~'n'.~ + To~define~variants~use~\iow_char:N\\cs_generate_variant:Nn~ + and~to~define~other~functions~use~\iow_char:N\\cs_new:Npn. + } \__msg_kernel_new:nnnn { kernel } { missing-colon } { Function~'#1'~contains~no~':'. } { @@ -8495,7 +8532,7 @@ {#1} {#2} { } { } { } { } } \bool_new:N \g__msg_log_next_bool -\cs_new_protected_nopar:Npn \__msg_log_next: +\cs_new_protected:Npn \__msg_log_next: { \bool_gset_true:N \g__msg_log_next_bool } \cs_new_protected:Npn \__msg_show_pre:nnnnnn #1#2#3#4#5#6 { @@ -8515,7 +8552,7 @@ { \exp_not:n { \__msg_show_pre:nnnnnn {#1} {#2} } {#3} {#4} {#5} {#6} } } \cs_generate_variant:Nn \__msg_show_pre:nnnnnn { nnnnnV } -\cs_new_protected_nopar:Npn \__msg_show_pre_aux:n +\cs_new_protected:Npn \__msg_show_pre_aux:n { \bool_if:NTF \g__msg_log_next_bool { \iow_log:n } { \iow_term:n } } \cs_new_protected:Npn \__msg_show_variable:NNNnn #1#2#3#4#5 { @@ -8606,7 +8643,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3file.dtx 6458 2016-03-25 21:19:04Z joseph $ +\GetIdInfo$Id: l3file.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 File and I/O operations} \tl_new:N \g_file_current_name_tl \cs_if_exist:NT \@currname @@ -8748,7 +8785,7 @@ \__file_name_sanitize:nn {#1} { \seq_remove_all:Nn \l__file_search_path_seq } } -\cs_new_protected_nopar:Npn \file_list: +\cs_new_protected:Npn \file_list: { \seq_set_eq:NN \l__file_internal_seq \g__file_record_seq \clist_if_exist:NT \@filelist @@ -8814,7 +8851,7 @@ \prg_return_true: } } -\exp_args:NNf \cs_new_protected_nopar:Npn \__ior_new:N +\exp_args:NNf \cs_new_protected:Npn \__ior_new:N { \exp_args:NNc \exp_after:wN \exp_stop_f: { newread } } \cs_new_protected:Npn \__ior_open:Nn #1#2 { @@ -8846,7 +8883,7 @@ } } \cs_generate_variant:Nn \ior_close:N { c } -\cs_new_protected_nopar:Npn \ior_list_streams: +\cs_new_protected:Npn \ior_list_streams: { \__ior_list_streams:Nn \g__ior_streams_prop { ior } } \cs_new_protected:Npn \__ior_list_streams:Nn #1#2 { @@ -8905,7 +8942,7 @@ } \cs_new_protected:Npn \iow_new:N #1 { \cs_new_eq:NN #1 \c_term_iow } \cs_generate_variant:Nn \iow_new:N { c } -\exp_args:NNf \cs_new_protected_nopar:Npn \__iow_new:N +\exp_args:NNf \cs_new_protected:Npn \__iow_new:N { \exp_args:NNc \exp_after:wN \exp_stop_f: { newwrite } } \cs_new_protected:Npn \iow_open:Nn #1#2 { \__file_name_sanitize:nn {#2} { \__iow_open:Nn #1 } } @@ -8940,7 +8977,7 @@ } } \cs_generate_variant:Nn \iow_close:N { c } -\cs_new_protected_nopar:Npn \iow_list_streams: +\cs_new_protected:Npn \iow_list_streams: { \__iow_list_streams:Nn \g__iow_streams_prop { iow } } \cs_new_eq:NN \__iow_list_streams:Nn \__ior_list_streams:Nn \cs_new_protected:Npn \iow_shipout_x:Nn #1#2 @@ -8967,11 +9004,11 @@ { \tex_immediate:D \tex_write:D #1 { \exp_not:n {#2} } } } \cs_generate_variant:Nn \iow_now:Nn { c, Nx, cx } -\cs_set_protected_nopar:Npn \iow_log:x { \iow_now:Nx \c_log_iow } -\cs_new_protected_nopar:Npn \iow_log:n { \iow_now:Nn \c_log_iow } -\cs_set_protected_nopar:Npn \iow_term:x { \iow_now:Nx \c_term_iow } -\cs_new_protected_nopar:Npn \iow_term:n { \iow_now:Nn \c_term_iow } -\cs_new_nopar:Npn \iow_newline: { ^^J } +\cs_set_protected:Npn \iow_log:x { \iow_now:Nx \c_log_iow } +\cs_new_protected:Npn \iow_log:n { \iow_now:Nn \c_log_iow } +\cs_set_protected:Npn \iow_term:x { \iow_now:Nx \c_term_iow } +\cs_new_protected:Npn \iow_term:n { \iow_now:Nn \c_term_iow } +\cs_new:Npn \iow_newline: { ^^J } \cs_new_eq:NN \iow_char:N \cs_to_str:N \int_new:N \l_iow_line_count_int \int_set:Nn \l_iow_line_count_int { 78 } @@ -9014,16 +9051,16 @@ \__msg_kernel_expandable_error:nn { kernel } { indent-outside-wrapping-code } #1 } -\cs_new_protected_nopar:Npn \iow_indent:n { \__iow_indent_error:n } +\cs_new_protected:Npn \iow_indent:n { \__iow_indent_error:n } \cs_new_protected:Npn \iow_wrap:nnnN #1#2#3#4 { \group_begin: \int_set_eq:NN \tex_escapechar:D \c_minus_one - \cs_set_nopar:Npx \{ { \token_to_str:N \{ } - \cs_set_nopar:Npx \# { \token_to_str:N \# } - \cs_set_nopar:Npx \} { \token_to_str:N \} } - \cs_set_nopar:Npx \% { \token_to_str:N \% } - \cs_set_nopar:Npx \~ { \token_to_str:N \~ } + \cs_set:Npx \{ { \token_to_str:N \{ } + \cs_set:Npx \# { \token_to_str:N \# } + \cs_set:Npx \} { \token_to_str:N \} } + \cs_set:Npx \% { \token_to_str:N \% } + \cs_set:Npx \~ { \token_to_str:N \~ } \int_set:Nn \tex_escapechar:D { 92 } \cs_set_eq:NN \\ \c__iow_wrap_newline_marker_tl \cs_set_eq:NN \ \c_catcode_other_space_tl @@ -9052,11 +9089,11 @@ #4 \l__iow_wrap_tl } \cs_new_eq:NN \__iow_wrap_set:Nx \protected@edef -\cs_new_protected_nopar:Npn \__iow_wrap_set_target: +\cs_new_protected:Npn \__iow_wrap_set_target: { - \cs_set_protected_nopar:Npn \__iow_wrap_set_target: + \cs_set_protected:Npn \__iow_wrap_set_target: { - \cs_set_protected_nopar:Npn \__iow_wrap_set_target: { } + \cs_set_protected:Npn \__iow_wrap_set_target: { } \tl_replace_all:Nnn \l__iow_newline_tl { ~ } { \c_space_tl } \int_set:Nn \l__iow_target_count_int { \l_iow_line_count_int - \tl_count:N \l__iow_newline_tl + \c_one } @@ -9069,7 +9106,7 @@ { \__iow_wrap_special:w } { \__iow_wrap_word: } } -\cs_new_protected_nopar:Npn \__iow_wrap_word: +\cs_new_protected:Npn \__iow_wrap_word: { \int_set:Nn \l__iow_current_word_int { \exp_args:No \str_count_ignore_spaces:n \l__iow_current_word_tl } @@ -9079,7 +9116,7 @@ { \__iow_wrap_word_newline: } \__iow_wrap_loop:w } -\cs_new_protected_nopar:Npn \__iow_wrap_word_fits: +\cs_new_protected:Npn \__iow_wrap_word_fits: { \bool_if:NTF \l__iow_line_start_bool { @@ -9095,7 +9132,7 @@ \int_incr:N \l__iow_current_line_int } } -\cs_new_protected_nopar:Npn \__iow_wrap_word_newline: +\cs_new_protected:Npn \__iow_wrap_word_newline: { \__iow_wrap_set_target: \tl_put_right:Nx \l__iow_wrap_tl @@ -9115,7 +9152,7 @@ { \__iow_wrap_special:w } { \__iow_wrap_loop:w #2 ~ #3 ~ } } -\cs_new_protected_nopar:Npn \__iow_wrap_newline: +\cs_new_protected:Npn \__iow_wrap_newline: { \__iow_wrap_set_target: \tl_put_right:Nx \l__iow_wrap_tl @@ -9124,19 +9161,19 @@ \tl_clear:N \l__iow_current_line_tl \bool_set_true:N \l__iow_line_start_bool } -\cs_new_protected_nopar:Npx \__iow_wrap_indent: +\cs_new_protected:Npx \__iow_wrap_indent: { \int_add:Nn \l__iow_current_indentation_int \c_four \tl_put_right:Nx \exp_not:N \l__iow_current_indentation_tl { \c_space_tl \c_space_tl \c_space_tl \c_space_tl } } -\cs_new_protected_nopar:Npn \__iow_wrap_unindent: +\cs_new_protected:Npn \__iow_wrap_unindent: { \int_sub:Nn \l__iow_current_indentation_int \c_four \tl_set:Nx \l__iow_current_indentation_tl { \prg_replicate:nn \l__iow_current_indentation_int { ~ } } } -\cs_new_protected_nopar:Npn \__iow_wrap_end: +\cs_new_protected:Npn \__iow_wrap_end: { \tl_put_right:Nx \l__iow_wrap_tl { \l__iow_current_line_tl } @@ -9202,7 +9239,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3skip.dtx 6366 2016-01-05 22:18:59Z joseph $ +\GetIdInfo$Id: l3skip.dtx 6692 2016-08-19 22:29:47Z bruno $ {L3 Dimensions and skips} \cs_new_eq:NN \if_dim:w \tex_ifdim:D \cs_new_eq:NN \__dim_eval:w \etex_dimexpr:D @@ -9448,7 +9485,7 @@ } \cs_new_eq:NN \dim_show:N \__kernel_register_show:N \cs_generate_variant:Nn \dim_show:N { c } -\cs_new_protected_nopar:Npn \dim_show:n +\cs_new_protected:Npn \dim_show:n { \__msg_show_wrap:Nn \dim_eval:n } \dim_const:Nn \c_zero_dim { 0 pt } \dim_const:Nn \c_max_dim { 16383.99999 pt } @@ -9538,7 +9575,7 @@ \cs_generate_variant:Nn \skip_vertical:N { c } \cs_new_eq:NN \skip_show:N \__kernel_register_show:N \cs_generate_variant:Nn \skip_show:N { c } -\cs_new_protected_nopar:Npn \skip_show:n +\cs_new_protected:Npn \skip_show:n { \__msg_show_wrap:Nn \skip_eval:n } \skip_const:Nn \c_zero_skip { \c_zero_dim } \skip_const:Nn \c_max_skip { \c_max_dim } @@ -9600,7 +9637,7 @@ \cs_generate_variant:Nn \muskip_use:N { c } \cs_new_eq:NN \muskip_show:N \__kernel_register_show:N \cs_generate_variant:Nn \muskip_show:N { c } -\cs_new_protected_nopar:Npn \muskip_show:n +\cs_new_protected:Npn \muskip_show:n { \__msg_show_wrap:Nn \muskip_eval:n } \muskip_const:Nn \c_zero_muskip { 0 mu } \muskip_const:Nn \c_max_muskip { 16383.99999 mu } @@ -9608,7 +9645,7 @@ \muskip_new:N \l_tmpb_muskip \muskip_new:N \g_tmpa_muskip \muskip_new:N \g_tmpb_muskip -%% File: l3keys.dtx Copyright (C) 2006-2015 The LaTeX3 Project +%% File: l3keys.dtx Copyright (C) 2006-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -9640,105 +9677,142 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3keys.dtx 6284 2015-11-17 10:10:56Z bruno $ +\GetIdInfo$Id: l3keys.dtx 6711 2016-09-21 07:04:35Z joseph $ {L3 Key-value interfaces} -\int_new:N \g__keyval_level_int \tl_new:N \l__keyval_key_tl \tl_new:N \l__keyval_value_tl \tl_new:N \l__keyval_sanitise_tl -\tl_new:N \l__keyval_parse_tl +\cs_new_protected:Npn \keyval_parse:NNn #1#2#3 + { + \tl_set:Nn \l__keyval_sanitise_tl {#3} + \__keyval_sanitise_equals: + \__keyval_sanitise_comma: + \exp_after:wN \__keyval_loop:NNw \exp_after:wN #1 \exp_after:wN #2 + \exp_after:wN \q_mark \l__keyval_sanitise_tl , \q_recursion_tail , + } \group_begin: \char_set_catcode_active:n { `\= } \char_set_catcode_active:n { `\, } - \cs_new_protected:Npx \__keyval_parse:n #1 + \cs_new_protected:Npn \__keyval_sanitise_equals: { - \group_begin: - \tl_set:Nn \exp_not:N \l__keyval_sanitise_tl {#1} - \tl_replace_all:Nnn \exp_not:N \l__keyval_sanitise_tl - { \exp_not:N = } { \token_to_str:N = } - \tl_replace_all:Nnn \exp_not:N \l__keyval_sanitise_tl - { \exp_not:N , } { \token_to_str:N , } - \tl_clear:N \exp_not:N \l__keyval_parse_tl - \exp_not:N \exp_after:wN - \exp_not:N \__keyval_parse_elt:w \exp_not:N \exp_after:wN - \exp_not:N \q_nil \exp_not:N \l__keyval_sanitise_tl - \token_to_str:N , \exp_not:N \q_recursion_tail - \token_to_str:N , \exp_not:N \q_recursion_stop - \exp_not:N \exp_after:wN \group_end: - \exp_not:N \l__keyval_parse_tl + \exp_after:wN \__keyval_sanitise_equals_auxi:w \l__keyval_sanitise_tl + \q_mark = \q_nil = + \exp_after:wN \__keyval_sanitise_aux:w \l__keyval_sanitise_tl } -\group_end: -\cs_new_protected:Npn \__keyval_parse_elt:w #1 , - { - \tl_if_blank:oF { \use_none:n #1 } + \cs_new_protected:Npn \__keyval_sanitise_equals_auxi:w #1 = { - \quark_if_recursion_tail_stop:o { \use_none:n #1 } - \__keyval_split_key_value:w #1 \q_nil = = \q_stop + \tl_set:Nn \l__keyval_sanitise_tl {#1} + \__keyval_sanitise_equals_auxii:w } - \__keyval_parse_elt:w \q_nil - } -\cs_new_protected:Npn \__keyval_split_key_value:w #1 = #2 = #3 \q_stop - { - \tl_if_blank:nTF {#3} + \cs_new_protected:Npn \__keyval_sanitise_equals_auxii:w #1 = { - \__keyval_split_key:w #1 \q_stop - \tl_put_right:Nx \l__keyval_parse_tl - { - \exp_not:c - { - __keyval_key_no_value_elt_ - \int_use:N \g__keyval_level_int - :n - } - { \exp_not:o \l__keyval_key_tl } - } + \if_meaning:w \q_nil #1 \scan_stop: + \else: + \tl_set:Nx \l__keyval_sanitise_tl + { + \exp_not:o \l__keyval_sanitise_tl + \token_to_str:N = + \exp_not:n {#1} + } + \exp_after:wN \__keyval_sanitise_equals_auxii:w + \fi: } + \cs_new_protected:Npn \__keyval_sanitise_comma: + { + \exp_after:wN \__keyval_sanitise_comma_auxi:w \l__keyval_sanitise_tl + \q_mark , \q_nil , + \exp_after:wN \__keyval_sanitise_aux:w \l__keyval_sanitise_tl + } + \cs_new_protected:Npn \__keyval_sanitise_comma_auxi:w #1 , { - \__keyval_split:Nn \l__keyval_key_tl {#1} - \tl_if_blank:oTF { \use_none:n #3 } - { \__keyval_split_value:w \q_nil #2 \q_stop } - { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } } + \tl_set:Nn \l__keyval_sanitise_tl {#1} + \__keyval_sanitise_comma_auxii:w + } + \cs_new_protected:Npn \__keyval_sanitise_comma_auxii:w #1 , + { + \if_meaning:w \q_nil #1 \scan_stop: + \else: + \tl_set:Nx \l__keyval_sanitise_tl + { + \exp_not:o \l__keyval_sanitise_tl + \token_to_str:N , + \exp_not:n {#1} + } + \exp_after:wN \__keyval_sanitise_comma_auxii:w + \fi: } +\group_end: +\cs_new_protected:Npn \__keyval_sanitise_aux:w #1 \q_mark + { \tl_set:Nn \l__keyval_sanitise_tl {#1} } +\cs_new_protected:Npn \__keyval_loop:NNw #1#2#3 , + { + \exp_after:wN \if_meaning:w \exp_after:wN \q_recursion_tail + \use_none:n #3 \prg_do_nothing: + \else: + \__keyval_split:NNw #1#2#3 == \q_stop + \exp_after:wN \__keyval_loop:NNw \exp_after:wN #1 \exp_after:wN #2 + \exp_after:wN \q_mark + \fi: } -\cs_new_protected:Npn \__keyval_split_key:w #1 \q_nil \q_stop - { \__keyval_split:Nn \l__keyval_key_tl {#1} } -\cs_new_protected:Npn \__keyval_split:Nn #1#2 +\cs_new_protected:Npn \__keyval_split:NNw #1#2#3 = { - \quark_if_nil:oTF { \use_none:nnn #2 \q_nil \q_nil } - { \tl_set:Nx #1 { \exp_not:o { \use_ii:nnn #2 \q_nil } } } - { \__keyval_split:Nw #1 #2 \q_stop } + \__keyval_def:Nn \l__keyval_key_tl {#3} + \if_meaning:w \l__keyval_key_tl \c_empty_tl + \exp_after:wN \__keyval_split_tidy:w + \else: + \exp_after:wN \__keyval_split_value:NNw \exp_after:wN #1 \exp_after:wN #2 + \exp_after:wN \q_mark + \fi: } -\cs_new_protected:Npn \__keyval_split:Nw #1 \q_nil #2 \q_stop - { \tl_set:Nx #1 { \tl_trim_spaces:n {#2} } } -\cs_new_protected:Npn \__keyval_split_value:w #1 \q_nil \q_stop +\cs_new_protected:Npn \__keyval_split_value:NNw #1#2#3 = #4 \q_stop { - \__keyval_split:Nn \l__keyval_value_tl {#1} - \tl_put_right:Nx \l__keyval_parse_tl - { - \exp_not:c - { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn } - { \exp_not:o \l__keyval_key_tl } - { \exp_not:o \l__keyval_value_tl } - } + \if:w \scan_stop: \tl_to_str:n {#4} \scan_stop: + \cs_set:Npx \__keyval_action: + { \exp_not:N #1 { \exp_not:o \l__keyval_key_tl } } + \else: + \if:w \scan_stop: \etex_detokenize:D \exp_after:wN { \use_none:n #4 } + \scan_stop: + \__keyval_def:Nn \l__keyval_value_tl {#3} + \cs_set:Npx \__keyval_action: + { + \exp_not:N #2 + { \exp_not:o \l__keyval_key_tl } + { \exp_not:o \l__keyval_value_tl } + } + \else: + \cs_set:Npn \__keyval_action: + { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } } + \fi: + \fi: + \__keyval_action: } -\cs_new_protected:Npn \keyval_parse:NNn #1#2#3 +\cs_new_protected:Npn \__keyval_split_tidy:w #1 \q_stop { - \int_gincr:N \g__keyval_level_int - \cs_gset_eq:cN - { __keyval_key_no_value_elt_ \int_use:N \g__keyval_level_int :n } #1 - \cs_gset_eq:cN - { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn } #2 - \__keyval_parse:n {#3} - \int_gdecr:N \g__keyval_level_int + \if:w \scan_stop: \etex_detokenize:D \exp_after:wN { \use_none:n #1 } + \scan_stop: + \else: + \exp_after:wN \__keyval_empty_key: + \fi: } +\cs_new:Npn \__keyval_action: { } +\cs_new_protected:Npn \__keyval_empty_key: + { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } } +\cs_new_protected:Npn \__keyval_def:Nn #1#2 + { \tl_set:Nx #1 { \__tl_trim_spaces:nn {#2} \__keyval_def_aux:n } } +\cs_new:Npn \__keyval_def_aux:n #1 + { \exp_after:wN \__keyval_def_aux:w #1 \q_stop } +\cs_new:Npn \__keyval_def_aux:w #1 \q_stop { \exp_not:n {#1} } \__msg_kernel_new:nnnn { kernel } { misplaced-equals-sign } { Misplaced~equals~sign~in~key-value~input~\msg_line_number: } { LaTeX~is~attempting~to~parse~some~key-value~input~but~found~ two~equals~signs~not~separated~by~a~comma. } -\tl_const:Nn \c__keys_code_root_tl { key~code~>~ } -\tl_const:Nn \c__keys_info_root_tl { key~info~>~ } +\tl_const:Nn \c__keys_code_root_tl { key~code~>~ } +\tl_const:Nn \c__keys_default_root_tl { key~default~>~ } +\tl_const:Nn \c__keys_groups_root_tl { key~groups~>~ } +\tl_const:Nn \c__keys_info_root_tl { key~info~>~ } +\tl_const:Nn \c__keys_validate_root_tl { key~validate~>~ } \tl_const:Nn \c__keys_props_root_tl { key~prop~>~ } \int_new:N \l_keys_choice_int \tl_new:N \l_keys_choice_tl @@ -9760,62 +9834,74 @@ \cs_new_protected:Npn \__keys_define:nnn #1#2#3 { \tl_set:Nx \l__keys_module_tl { \__keys_remove_spaces:n {#2} } - \keyval_parse:NNn \__keys_define_elt:n \__keys_define_elt:nn {#3} + \keyval_parse:NNn \__keys_define:n \__keys_define:nn {#3} \tl_set:Nn \l__keys_module_tl {#1} } \cs_generate_variant:Nn \__keys_define:nnn { o } -\cs_new_protected:Npn \__keys_define_elt:n #1 +\cs_new_protected:Npn \__keys_define:n #1 { \bool_set_true:N \l__keys_no_value_bool - \__keys_define_elt_aux:nn {#1} { } + \__keys_define_aux:nn {#1} { } } -\cs_new_protected:Npn \__keys_define_elt:nn #1#2 +\cs_new_protected:Npn \__keys_define:nn #1#2 { \bool_set_false:N \l__keys_no_value_bool - \__keys_define_elt_aux:nn {#1} {#2} + \__keys_define_aux:nn {#1} {#2} } -\cs_new_protected:Npn \__keys_define_elt_aux:nn #1#2 +\cs_new_protected:Npn \__keys_define_aux:nn #1#2 { \__keys_property_find:n {#1} \cs_if_exist:cTF { \c__keys_props_root_tl \l__keys_property_tl } - { \__keys_define_key:n {#2} } + { \__keys_define_code:n {#2} } { - \str_if_eq_x:nnF { \l__keys_property_tl } { .abort: } - { - \__msg_kernel_error:nnxx { kernel } { property-unknown } + \tl_if_empty:NF \l__keys_property_tl + { + \__msg_kernel_error:nnxx { kernel } { property-unknown } { \l__keys_property_tl } { \l_keys_path_tl } } } } \cs_new_protected:Npn \__keys_property_find:n #1 { - \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / } - \tl_if_in:nnTF {#1} { . } - { \__keys_property_find:w #1 \q_stop } + \tl_set:Nx \l__keys_property_tl { \__keys_remove_spaces:n {#1} } + \exp_after:wN \__keys_property_find:w \l__keys_property_tl . . \q_stop {#1} + } +\cs_new_protected:Npn \__keys_property_find:w #1 . #2 . #3 \q_stop #4 + { + \tl_if_blank:nTF {#3} { - \__msg_kernel_error:nnx { kernel } { key-no-property } {#1} - \tl_set:Nn \l__keys_property_tl { .abort: } + \tl_clear:N \l__keys_property_tl + \__msg_kernel_error:nnn { kernel } { key-no-property } {#4} + } + { + \str_if_eq:nnTF {#3} { . } + { + \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / #1 } + \tl_set:Nn \l__keys_property_tl { . #2 } + } + { + \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / #1 . #2 } + \__keys_property_search:w #3 \q_stop + } } } -\cs_new_protected:Npn \__keys_property_find:w #1 . #2 \q_stop +\cs_new_protected:Npn \__keys_property_search:w #1 . #2 \q_stop { - \tl_set:Nx \l_keys_path_tl + \str_if_eq:nnTF {#2} { . } { - \l_keys_path_tl - \__keys_remove_spaces:n {#1} + \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl } + \tl_set:Nn \l__keys_property_tl { . #1 } } - \tl_if_in:nnTF {#2} { . } { - \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . } - \__keys_property_find:w #2 \q_stop + \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . #1 } + \__keys_property_search:w #2 \q_stop } - { \tl_set:Nn \l__keys_property_tl { . #2 } } } -\cs_new_protected:Npn \__keys_define_key:n #1 +\cs_new_protected:Npn \__keys_define_code:n #1 { \bool_if:NTF \l__keys_no_value_bool { - \exp_after:wN \__keys_define_key:w + \exp_after:wN \__keys_define_code:w \l__keys_property_tl \q_stop { \use:c { \c__keys_props_root_tl \l__keys_property_tl } } { @@ -9826,7 +9912,11 @@ } { \use:c { \c__keys_props_root_tl \l__keys_property_tl } {#1} } } -\cs_new_protected:Npn \__keys_define_key:w #1 : #2 \q_stop +\use:x + { + \cs_new:Npn \exp_not:N \__keys_define_code:w + ##1 \c_colon_str ##2 \exp_not:N \q_stop + } { \tl_if_empty:nTF {#2} } \cs_new_protected:Npn \__keys_ensure_exist:n #1 { @@ -9834,6 +9924,7 @@ { \prop_set_eq:cN { \c__keys_info_root_tl #1 } \c_empty_prop } + \cs_if_exist:cF { \c__keys_code_root_tl #1 } { \__chk_log:x { Defining~key~#1~ \msg_line_context: } @@ -9873,11 +9964,11 @@ \__keys_default_set:n { true } } \cs_generate_variant:Nn \__keys_bool_set_inverse:Nn { c } -\cs_new_protected_nopar:Npn \__keys_choice_make: +\cs_new_protected:Npn \__keys_choice_make: { \__keys_choice_make:N \__keys_choice_find:n } -\cs_new_protected_nopar:Npn \__keys_multichoice_make: +\cs_new_protected:Npn \__keys_multichoice_make: { \__keys_choice_make:N \__keys_multichoice_find:n } -\cs_new_protected_nopar:Npn \__keys_choice_make:N #1 +\cs_new_protected:Npn \__keys_choice_make:N #1 { \prop_if_exist:cTF { \c__keys_info_root_tl \__keys_parent:o \l_keys_path_tl } @@ -9893,7 +9984,7 @@ } { \__keys_choice_make_aux:N #1 } } -\cs_new_protected_nopar:Npn \__keys_choice_make_aux:N #1 +\cs_new_protected:Npn \__keys_choice_make_aux:N #1 { \__keys_cmd_set:nn { \l_keys_path_tl } { #1 {##1} } \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } { choice } @@ -9915,9 +10006,9 @@ \__keys_parent:wn #2 / #3 \q_stop { #4 / #1 } } } -\cs_new_protected_nopar:Npn \__keys_choices_make:nn +\cs_new_protected:Npn \__keys_choices_make:nn { \__keys_choices_make:Nnn \__keys_choice_make: } -\cs_new_protected_nopar:Npn \__keys_multichoices_make:nn +\cs_new_protected:Npn \__keys_multichoices_make:nn { \__keys_choices_make:Nnn \__keys_multichoice_make: } \cs_new_protected:Npn \__keys_choices_make:Nnn #1#2#3 { @@ -9943,15 +10034,16 @@ \cs_generate_variant:Nn \__keys_cmd_set:nn { nx , Vn , Vo } \cs_new_protected:Npn \__keys_default_set:n #1 { - \__keys_ensure_exist:V \l_keys_path_tl \tl_if_empty:nTF {#1} { - \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } - { default } + \cs_set_eq:cN + { \c__keys_default_root_tl \l_keys_path_tl } + \tex_undefined:D } { - \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } - { default } {#1} + \cs_set:cpx + { \c__keys_default_root_tl \l_keys_path_tl } + { \exp_not:n {#1} } } } \cs_new_protected:Npn \__keys_groups_set:n #1 @@ -9970,11 +10062,8 @@ } \cs_new_protected:Npn \__keys_initialise:n #1 { - \__keys_ensure_exist:V \l_keys_path_tl - \exp_after:wN \__keys_initialise:wn \l_keys_path_tl \q_stop {#1} + \cs_if_exist_use:cT { \c__keys_code_root_tl \l_keys_path_tl } { {#1} } } -\cs_new_protected:Npn \__keys_initialise:wn #1 / #2 \q_stop #3 - { \keys_set:nn {#1} { #2 = {#3} } } \cs_new_protected:Npn \__keys_meta_make:n #1 { \__keys_cmd_set:Vo \l_keys_path_tl @@ -9985,31 +10074,62 @@ } \cs_new_protected:Npn \__keys_meta_make:nn #1#2 { \__keys_cmd_set:Vn \l_keys_path_tl { \keys_set:nn {#1} {#2} } } -\cs_new_protected_nopar:Npn \__keys_undefine: +\cs_new_protected:Npn \__keys_undefine: { - \cs_set_eq:cN { \c__keys_code_root_tl \l_keys_path_tl } \tex_undefined:D - \cs_set_eq:cN { \c__keys_info_root_tl \l_keys_path_tl } \tex_undefined:D + \clist_map_inline:nn + { code , default , groups , info , validate } + { + \cs_set_eq:cN + { \tl_use:c { c__keys_ ##1 _root_tl } \l_keys_path_tl } + \tex_undefined:D + } } \cs_new_protected:Npn \__keys_value_requirement:nn #1#2 { - \__keys_ensure_exist:V \l_keys_path_tl - \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } - { required } - \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } - { forbidden } - \str_if_eq:nnTF {#2} { true } - { - \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } - {#1} { true } - } + \str_case:nnF {#2} { - \str_if_eq:nnF {#2} { false } + { true } + { + \cs_set_eq:cc + { \c__keys_validate_root_tl \l_keys_path_tl } + { __keys_validate_ #1 : } + } + { false } { - \__msg_kernel_error:nnx { kernel } { property-boolean-values-only } - { .value_ #1 :n } + \cs_if_eq:ccT + { \c__keys_validate_root_tl \l_keys_path_tl } + { __keys_validate_ #1 : } + { + \cs_set_eq:cN + { \c__keys_validate_root_tl \l_keys_path_tl } + \tex_undefined:D + } } } + { + \__msg_kernel_error:nnx { kernel } { property-boolean-values-only } + { .value_ #1 :n } + } + } +\cs_new_protected:Npn \__keys_validate_forbidden: + { + \bool_if:NF \l__keys_no_value_bool + { + \__msg_kernel_error:nnxx { kernel } { value-forbidden } + { \l_keys_path_tl } { \l_keys_value_tl } + \__keys_validate_cleanup:w + } } +\cs_new_protected:Npn \__keys_validate_required: + { + \bool_if:NT \l__keys_no_value_bool + { + \__msg_kernel_error:nnx { kernel } { value-required } + { \l_keys_path_tl } + \__keys_validate_cleanup:w + } + } +\cs_new_protected:Npn \__keys_validate_cleanup:w #1 \cs_end: #2#3 { } \cs_new_protected:Npn \__keys_variable_set:NnnN #1#2#3#4 { \use:c { #2_if_exist:NF } #1 { \use:c { #2 _new:N } #1 } @@ -10037,7 +10157,7 @@ { \__keys_bool_set_inverse:Nn #1 { g } } \cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_inverse:c } #1 { \__keys_bool_set_inverse:cn {#1} { g } } -\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .choice: } +\cs_new_protected:cpn { \c__keys_props_root_tl .choice: } { \__keys_choice_make: } \cs_new_protected:cpn { \c__keys_props_root_tl .choices:nn } #1 { \__keys_choices_make:nn #1 } @@ -10103,7 +10223,7 @@ { \__keys_meta_make:n {#1} } \cs_new_protected:cpn { \c__keys_props_root_tl .meta:nn } #1 { \__keys_meta_make:nn #1 } -\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .multichoice: } +\cs_new_protected:cpn { \c__keys_props_root_tl .multichoice: } { \__keys_multichoice_make: } \cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:nn } #1 { \__keys_multichoices_make:nn #1 } @@ -10137,23 +10257,23 @@ { \__keys_variable_set:NnnN #1 { tl } { g } x } \cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset_x:c } #1 { \__keys_variable_set:cnnN {#1} { tl } { g } x } -\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .undefine: } +\cs_new_protected:cpn { \c__keys_props_root_tl .undefine: } { \__keys_undefine: } \cs_new_protected:cpn { \c__keys_props_root_tl .value_forbidden:n } #1 { \__keys_value_requirement:nn { forbidden } {#1} } \cs_new_protected:cpn { \c__keys_props_root_tl .value_required:n } #1 { \__keys_value_requirement:nn { required } {#1} } -\cs_new_protected_nopar:Npn \keys_set:nn +\cs_new_protected:Npn \keys_set:nn { \__keys_set:onn { \l__keys_module_tl } } \cs_new_protected:Npn \__keys_set:nnn #1#2#3 { \tl_set:Nx \l__keys_module_tl { \__keys_remove_spaces:n {#2} } - \keyval_parse:NNn \__keys_set_elt:n \__keys_set_elt:nn {#3} + \keyval_parse:NNn \__keys_set:n \__keys_set:nn {#3} \tl_set:Nn \l__keys_module_tl {#1} } \cs_generate_variant:Nn \keys_set:nn { nV , nv , no } \cs_generate_variant:Nn \__keys_set:nnn { o } -\cs_new_protected_nopar:Npn \keys_set_known:nnN +\cs_new_protected:Npn \keys_set_known:nnN { \__keys_set_known:onnN \l__keys_unused_clist } \cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no } \cs_new_protected:Npn \__keys_set_known:nnnN #1#2#3#4 @@ -10171,7 +10291,7 @@ \bool_set_false:N \l__keys_only_known_bool } \cs_generate_variant:Nn \keys_set_known:nn { nV , nv , no } -\cs_new_protected_nopar:Npn \keys_set_filter:nnnN +\cs_new_protected:Npn \keys_set_filter:nnnN { \__keys_set_filter:onnnN \l__keys_unused_clist } \cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno } \cs_new_protected:Npn \__keys_set_filter:nnnnN #1#2#3#4#5 @@ -10200,29 +10320,28 @@ \bool_set_false:N \l__keys_selective_bool } \cs_generate_variant:Nn \keys_set_groups:nnn { nnV , nnv , nno } -\cs_new_protected:Npn \__keys_set_elt:n #1 +\cs_new_protected:Npn \__keys_set:n #1 { \bool_set_true:N \l__keys_no_value_bool - \__keys_set_elt_aux:onn \l__keys_module_tl {#1} { } + \__keys_set_aux:onn \l__keys_module_tl {#1} { } } -\cs_new_protected:Npn \__keys_set_elt:nn #1#2 +\cs_new_protected:Npn \__keys_set:nn #1#2 { \bool_set_false:N \l__keys_no_value_bool - \__keys_set_elt_aux:onn \l__keys_module_tl {#1} {#2} + \__keys_set_aux:onn \l__keys_module_tl {#1} {#2} } -\cs_new_protected:Npn \__keys_set_elt_aux:nnn #1#2#3 +\cs_new_protected:Npn \__keys_set_aux:nnn #1#2#3 { - \tl_set:Nx \l_keys_path_tl - { \l__keys_module_tl / \__keys_remove_spaces:n {#2} } + \tl_set:Nx \l_keys_path_tl { #1 / \__keys_remove_spaces:n {#2} } \tl_clear:N \l__keys_module_tl \exp_after:wN \__keys_find_key_module:w \l_keys_path_tl / \q_stop \__keys_value_or_default:n {#3} \bool_if:NTF \l__keys_selective_bool - { \__keys_set_elt_selective: } - { \__keys_set_elt_aux: } + { \__keys_set_selective: } + { \__keys_execute: } \tl_set:Nn \l__keys_module_tl {#1} } -\cs_generate_variant:Nn \__keys_set_elt_aux:nnn { o } +\cs_generate_variant:Nn \__keys_set_aux:nnn { o } \cs_new_protected:Npn \__keys_find_key_module:w #1 / #2 \q_stop { \tl_if_blank:nTF {#2} @@ -10236,31 +10355,7 @@ \__keys_find_key_module:w #2 \q_stop } } -\cs_new_protected_nopar:Npn \__keys_set_elt_aux: - { - \bool_if:nTF - { - \__keys_if_value_p:n { required } && - \l__keys_no_value_bool - } - { - \__msg_kernel_error:nnx { kernel } { value-required } - { \l_keys_path_tl } - } - { - \bool_if:nTF - { - \__keys_if_value_p:n { forbidden } && - ! \l__keys_no_value_bool - } - { - \__msg_kernel_error:nnxx { kernel } { value-forbidden } - { \l_keys_path_tl } { \l_keys_value_tl } - } - { \__keys_execute: } - } - } -\cs_new_protected_nopar:Npn \__keys_set_elt_selective: +\cs_new_protected:Npn \__keys_set_selective: { \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl } { @@ -10269,17 +10364,17 @@ { \__keys_check_groups: } { \bool_if:NTF \l__keys_filtered_bool - { \__keys_set_elt_aux: } + { \__keys_execute: } { \__keys_store_unused: } } } { \bool_if:NTF \l__keys_filtered_bool - { \__keys_set_elt_aux: } + { \__keys_execute: } { \__keys_store_unused: } } } -\cs_new_protected_nopar:Npn \__keys_check_groups: +\cs_new_protected:Npn \__keys_check_groups: { \bool_set_false:N \l__keys_tmp_bool \seq_map_inline:Nn \l__keys_selective_seq @@ -10297,11 +10392,11 @@ { \bool_if:NTF \l__keys_filtered_bool { \__keys_store_unused: } - { \__keys_set_elt_aux: } + { \__keys_execute: } } { \bool_if:NTF \l__keys_filtered_bool - { \__keys_set_elt_aux: } + { \__keys_execute: } { \__keys_store_unused: } } } @@ -10309,30 +10404,36 @@ { \bool_if:NTF \l__keys_no_value_bool { - \prop_get:cnNF { \c__keys_info_root_tl \l_keys_path_tl } - { default } \l_keys_value_tl + \cs_if_exist:cTF { \c__keys_default_root_tl \l_keys_path_tl } + { + \tl_set_eq:Nc + \l_keys_value_tl + { \c__keys_default_root_tl \l_keys_path_tl } + } { \tl_clear:N \l_keys_value_tl } } { \tl_set:Nn \l_keys_value_tl {#1} } } -\prg_new_conditional:Npnn \__keys_if_value:n #1 { p } +\cs_new_protected:Npn \__keys_execute: { - \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl } + \cs_if_exist:cTF { \c__keys_code_root_tl \l_keys_path_tl } { - \prop_if_in:cnTF { \c__keys_info_root_tl \l_keys_path_tl } {#1} - { \prg_return_true: } - { \prg_return_false: } + \cs_if_exist_use:c { \c__keys_validate_root_tl \l_keys_path_tl } + \cs:w \c__keys_code_root_tl \l_keys_path_tl \exp_after:wN \cs_end: + \exp_after:wN { \l_keys_value_tl } } - { \prg_return_false: } + { \__keys_execute_unknown: } } -\cs_new_protected_nopar:Npn \__keys_execute: - { \__keys_execute:nn { \l_keys_path_tl } { \__keys_execute_unknown: } } -\cs_new_protected_nopar:Npn \__keys_execute_unknown: +\cs_new_protected:Npn \__keys_execute_unknown: { \bool_if:NTF \l__keys_only_known_bool { \__keys_store_unused: } { - \__keys_execute:nn { \l__keys_module_tl / unknown } + \cs_if_exist:cTF { \c__keys_code_root_tl \l__keys_module_tl / unknown } + { + \cs:w \c__keys_code_root_tl \l__keys_module_tl / unknown \exp_after:wN + \cs_end: \exp_after:wN { \l_keys_value_tl } + } { \__msg_kernel_error:nnxx { kernel } { key-unknown } { \l_keys_path_tl } { \l__keys_module_tl } @@ -10348,7 +10449,7 @@ } {#2} } -\cs_new_protected_nopar:Npn \__keys_store_unused: +\cs_new_protected:Npn \__keys_store_unused: { \clist_put_right:Nx \l__keys_unused_clist { @@ -10418,12 +10519,6 @@ \__msg_kernel_new:nnnn { kernel } { boolean-values-only } { Key~'#1'~accepts~boolean~values~only. } { The~key~'#1'~only~accepts~the~values~'true'~and~'false'. } -\__msg_kernel_new:nnnn { kernel } { choice-unknown } - { Choice~'#2'~unknown~for~key~'#1'. } - { - The~key~'#1'~takes~a~limited~number~of~values.\\ - The~input~given,~'#2',~is~not~on~the~list~accepted. - } \__msg_kernel_new:nnnn { kernel } { key-choice-unknown } { Key~'#1'~accepts~only~a~fixed~set~of~choices. } { @@ -10490,9 +10585,9 @@ { has~the~properties: } { is~undefined. } } -\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_forbidden: } +\cs_new_protected:cpn { \c__keys_props_root_tl .value_forbidden: } { \__keys_value_requirement:nn { forbidden } { true } } -\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_required: } +\cs_new_protected:cpn { \c__keys_props_root_tl .value_required: } { \__keys_value_requirement:nn { required } { true } } %% File: l3fp.dtx Copyright (C) 2011-2016 The LaTeX3 Project %% @@ -10527,7 +10622,7 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3fp.dtx 6465 2016-03-26 16:15:09Z joseph $ +\GetIdInfo$Id: l3fp.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Floating points} %% File: l3fp-aux.dtx Copyright(C) 2011-2014,2016 The LaTeX3 Project %% @@ -10841,7 +10936,7 @@ conversion~functions. } %% -%% File: l3fp-traps.dtx Copyright (C) 2011-2014 The LaTeX3 Project +%% File: l3fp-traps.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -10907,11 +11002,11 @@ } } } -\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_error: +\cs_new_protected: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: +\cs_new_protected:Npn \__fp_trap_invalid_operation_set_flag: { \__fp_trap_invalid_operation_set:N \use_none:nnnnn } -\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_none: +\cs_new_protected:Npn \__fp_trap_invalid_operation_set_none: { \__fp_trap_invalid_operation_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_invalid_operation_set:N #1 { @@ -10941,11 +11036,11 @@ \exp_after:wN \c_nan_fp } } -\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_error: +\cs_new_protected: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: +\cs_new_protected:Npn \__fp_trap_division_by_zero_set_flag: { \__fp_trap_division_by_zero_set:N \use_none:nnnnn } -\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_none: +\cs_new_protected:Npn \__fp_trap_division_by_zero_set_none: { \__fp_trap_division_by_zero_set:N \use_none:nnnnnnn } \cs_new_protected:Npn \__fp_trap_division_by_zero_set:N #1 { @@ -10967,19 +11062,19 @@ \exp_after:wN ##1 } } -\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_error: +\cs_new_protected:Npn \__fp_trap_overflow_set_error: { \__fp_trap_overflow_set:N \prg_do_nothing: } -\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_flag: +\cs_new_protected:Npn \__fp_trap_overflow_set_flag: { \__fp_trap_overflow_set:N \use_none:nnnnn } -\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_none: +\cs_new_protected:Npn \__fp_trap_overflow_set_none: { \__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: +\cs_new_protected:Npn \__fp_trap_underflow_set_error: { \__fp_trap_underflow_set:N \prg_do_nothing: } -\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_flag: +\cs_new_protected:Npn \__fp_trap_underflow_set_flag: { \__fp_trap_underflow_set:N \use_none:nnnnn } -\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_none: +\cs_new_protected:Npn \__fp_trap_underflow_set_none: { \__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 } } @@ -11009,7 +11104,7 @@ \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 +\cs_new:Npn \__fp_invalid_operation_o:nw { \__fp_invalid_operation:nnw { \exp_after:wN \c_nan_fp } } \cs_generate_variant:Nn \__fp_invalid_operation_o:nw { f } \cs_new:Npn \__fp_error:nnnn #1 @@ -11396,7 +11491,7 @@ \__fp_tmp:w {iii} \__fp_parse_digits_ii:N { 000 ; 3 } \__fp_tmp:w {ii} \__fp_parse_digits_i:N { 00 ; 2 } \__fp_tmp:w {i} \__fp_parse_digits_:N { 0 ; 1 } -\cs_new_nopar:Npn \__fp_parse_digits_:N { ; ; 0 } +\cs_new:Npn \__fp_parse_digits_:N { ; ; 0 } \cs_new:Npn \__fp_parse_one:Nw #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 @@ -12007,7 +12102,7 @@ \group_end: \cs_set_protected:Npn \__fp_tmp:w #1 #2 { - \cs_new_nopar:cpn { __fp_parse_word_#1:N } + \cs_new:cpn { __fp_parse_word_#1:N } { \exp_after:wN #2 \exp:w \exp_end_continue_f:w \__fp_parse_infix:NN } } \__fp_tmp:w { inf } \c_inf_fp @@ -12018,7 +12113,7 @@ \__fp_tmp:w { false } \c_zero_fp \cs_set_protected:Npn \__fp_tmp:w #1 #2 { - \cs_new_nopar:cpn { __fp_parse_word_#1:N } + \cs_new:cpn { __fp_parse_word_#1:N } { \__fp_exp_after_f:nw { \__fp_parse_infix:NN } \s__fp \__fp_chk:w 10 #2 ; @@ -12037,7 +12132,7 @@ \__fp_tmp:w {sp} { {-4} {1525} {8789} {0625} {0000} } \tl_map_inline:nn { {em} {ex} } { - \cs_new_nopar:cpn { __fp_parse_word_#1:N } + \cs_new:cpn { __fp_parse_word_#1:N } { \exp_after:wN \__fp_from_dim_test:ww \exp_after:wN 0 \exp_after:wN , @@ -12063,25 +12158,25 @@ \exp:w \__fp_parse_operand:Nw \c_sixteen \__fp_parse_expand:w } -\cs_new_nopar:Npn \__fp_parse_word_acot:N +\cs_new:Npn \__fp_parse_word_acot:N { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_i:nn } -\cs_new_nopar:Npn \__fp_parse_word_acotd:N +\cs_new:Npn \__fp_parse_word_acotd:N { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_ii:nn } -\cs_new_nopar:Npn \__fp_parse_word_atan:N +\cs_new:Npn \__fp_parse_word_atan:N { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_i:nn } -\cs_new_nopar:Npn \__fp_parse_word_atand:N +\cs_new:Npn \__fp_parse_word_atand:N { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_ii:nn } -\cs_new_nopar:Npn \__fp_parse_word_max:N +\cs_new:Npn \__fp_parse_word_max:N { \__fp_parse_function:NNN \__fp_minmax_o:Nw 2 } -\cs_new_nopar:Npn \__fp_parse_word_min:N +\cs_new:Npn \__fp_parse_word_min:N { \__fp_parse_function:NNN \__fp_minmax_o:Nw 0 } \cs_new:Npn \__fp_parse_word_abs:N { \__fp_parse_unary_function:nNN { set_sign } 0 } -\cs_new_nopar:Npn \__fp_parse_word_exp:N +\cs_new:Npn \__fp_parse_word_exp:N { \__fp_parse_unary_function:nNN {exp} ? } -\cs_new_nopar:Npn \__fp_parse_word_ln:N +\cs_new:Npn \__fp_parse_word_ln:N { \__fp_parse_unary_function:nNN {ln} ? } -\cs_new_nopar:Npn \__fp_parse_word_sqrt:N +\cs_new:Npn \__fp_parse_word_sqrt:N { \__fp_parse_unary_function:nNN {sqrt} ? } \tl_map_inline:nn { @@ -12089,16 +12184,16 @@ {cos} {cot} {csc} {sec} {sin} {tan} } { - \cs_new_nopar:cpn { __fp_parse_word_#1:N } + \cs_new:cpn { __fp_parse_word_#1:N } { \__fp_parse_unary_function:nNN {#1} \use_i:nn } - \cs_new_nopar:cpn { __fp_parse_word_#1d:N } + \cs_new:cpn { __fp_parse_word_#1d:N } { \__fp_parse_unary_function:nNN {#1} \use_ii:nn } } -\cs_new_nopar:Npn \__fp_parse_word_trunc:N +\cs_new:Npn \__fp_parse_word_trunc:N { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_zero:NNN } -\cs_new_nopar:Npn \__fp_parse_word_floor:N +\cs_new:Npn \__fp_parse_word_floor:N { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_ninf:NNN } -\cs_new_nopar:Npn \__fp_parse_word_ceil:N +\cs_new:Npn \__fp_parse_word_ceil:N { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_pinf:NNN } \cs_new:Npn \__fp_parse_word_round:N #1#2 { @@ -12251,7 +12346,7 @@ } \group_end: \group_begin: - \cs_set_nopar:Npn \+ { } + \cs_set:Npn \+ { } \char_set_catcode_other:N \& \char_set_catcode_letter:N \^ \char_set_catcode_letter:N \/ @@ -12520,7 +12615,7 @@ } \cs_new_protected:Npn \__fp_new_function:NNnnn #1#2#3#4#5 { - \cs_new_nopar:Npn #1 + \cs_new:Npn #1 { \exp_after:wN \__fp_function_apply:nw \exp_after:wN { @@ -12584,7 +12679,7 @@ \__msg_kernel_new:nnn { kernel } { fp-robust-cmd } { Robust~command~#1 invalid~in~fp~expression! } } -%% File: l3fp-logic.dtx Copyright (C) 2011-2014 The LaTeX3 Project +%% File: l3fp-logic.dtx Copyright (C) 2011-2014,2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -12811,7 +12906,7 @@ \fi: \__fp_exp_after_o:w } - \cs_new_nopar:Npn \__fp_|_o:ww { \__fp_&_o:ww \else: } + \cs_new: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 @@ -12923,7 +13018,7 @@ } \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 +\cs_new:cpx { __fp_-_o:ww } \s__fp { \exp_not:c { __fp_+_o:ww } \exp_not:n { \s__fp \__fp_neg_sign:N } @@ -13210,7 +13305,7 @@ \__int_value:w \__fp_round_digit:Nw #3 #6 ; \exp_after:wN ; } -\cs_new_nopar:cpn { __fp_*_o:ww } +\cs_new:cpn { __fp_*_o:ww } { \__fp_mul_cases_o:NnNnww * @@ -13320,7 +13415,7 @@ \exp_after:wN #7 \__int_value:w \__fp_round_digit:Nw } -\cs_new_nopar:cpn { __fp_/_o:ww } +\cs_new:cpn { __fp_/_o:ww } { \__fp_mul_cases_o:NnNnww / @@ -13773,8 +13868,8 @@ \cs_new:Npn \__fp_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; } \cs_new:Npn \__fp_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} } \cs_new:Npn \__fp_fixed_div_int_after:Nw #1 #2; { #1 {#2} } -\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + } -\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - } +\cs_new:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + } +\cs_new:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - } \cs_new:Npn \__fp_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8 { \exp_after:wN \__fp_fixed_add_after:NNNNNwn @@ -15043,7 +15138,7 @@ {#1}#2{0000}{0000}; { \__fp_trigd_small:ww 2, } } -\cs_new_nopar:Npx \__fp_trig_inverse_two_pi: +\cs_new:Npx \__fp_trig_inverse_two_pi: { \exp_not:n { \exp_after:wN \use_none:n \token_to_str:N } \cs:w , , ! @@ -15267,7 +15362,7 @@ \exp_after:wN + \fi: } -\cs_new_nopar:Npn \__fp_trig_large_auxix:Nw +\cs_new:Npn \__fp_trig_large_auxix:Nw { \exp_after:wN \__fp_use_i_until_s:nw \exp_after:wN \__fp_trig_large_auxxi:w @@ -15389,12 +15484,12 @@ } #1 } -\cs_new_nopar:Npn \__fp_atan_o:Nw +\cs_new:Npn \__fp_atan_o:Nw { \__fp_atan_dispatch_o:NNnNw \__fp_acotii_o:Nww \__fp_atanii_o:Nww { atan } } -\cs_new_nopar:Npn \__fp_acot_o:Nw +\cs_new:Npn \__fp_acot_o:Nw { \__fp_atan_dispatch_o:NNnNw \__fp_atanii_o:Nww \__fp_acotii_o:Nww { acot } @@ -15411,7 +15506,7 @@ { kernel } { fp-num-args } { #3() } { 1 } { 2 } \exp_after:wN \c_nan_fp \exp:w \fi: - \exp_after:wN \c_zero + \exp_after:wN \exp_end: } \cs_new:Npn \__fp_atanii_o:Nww #1 \s__fp \__fp_chk:w #2#3#4; \s__fp \__fp_chk:w #5 @@ -15705,7 +15800,7 @@ \cs_new:Npn \fp_to_scientific:N #1 { \exp_after:wN \__fp_to_scientific_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_scientific:N { c } -\cs_new_nopar:Npn \fp_to_scientific:n +\cs_new:Npn \fp_to_scientific:n { \exp_after:wN \__fp_to_scientific_dispatch:w \exp:w \exp_end_continue_f:w \__fp_parse:n @@ -15754,7 +15849,7 @@ \cs_new:Npn \fp_to_decimal:N #1 { \exp_after:wN \__fp_to_decimal_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_decimal:N { c } -\cs_new_nopar:Npn \fp_to_decimal:n +\cs_new:Npn \fp_to_decimal:n { \exp_after:wN \__fp_to_decimal_dispatch:w \exp:w \exp_end_continue_f:w \__fp_parse:n @@ -15822,7 +15917,7 @@ \cs_new:Npn \__fp_to_decimal_huge:wnnnn #1; #2#3#4#5 { #2#3#4#5 #1 } \cs_new:Npn \fp_to_tl:N #1 { \exp_after:wN \__fp_to_tl_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_tl:N { c } -\cs_new_nopar:Npn \fp_to_tl:n +\cs_new:Npn \fp_to_tl:n { \exp_after:wN \__fp_to_tl_dispatch:w \exp:w \exp_end_continue_f:w \__fp_parse:n @@ -15859,7 +15954,7 @@ { \fp_to_decimal:n {#1} pt } \cs_new:Npn \fp_to_int:N #1 { \exp_after:wN \__fp_to_int_dispatch:w #1 } \cs_generate_variant:Nn \fp_to_int:N { c } -\cs_new_nopar:Npn \fp_to_int:n +\cs_new:Npn \fp_to_int:n { \exp_after:wN \__fp_to_int_dispatch:w \exp:w \exp_end_continue_f:w \__fp_parse:n @@ -15939,7 +16034,7 @@ \exp_not:N \__fp_array_to_clist_loop:Nw } %% -%% File: l3fp-assign.dtx Copyright (C) 2011-2015 The LaTeX3 project +%% File: l3fp-assign.dtx Copyright (C) 2011-2016 The LaTeX3 project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -15998,10 +16093,10 @@ { \fp_if_exist:NTF #1 { \fp_gzero:N #1 } { \fp_new:N #1 } } \cs_generate_variant:Nn \fp_zero_new:N { c } \cs_generate_variant:Nn \fp_gzero_new:N { c } -\cs_new_protected_nopar:Npn \fp_add:Nn { \__fp_add:NNNn \fp_set:Nn + } -\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:Nn { \__fp_add:NNNn \fp_set:Nn + } +\cs_new_protected:Npn \fp_gadd:Nn { \__fp_add:NNNn \fp_gset:Nn + } +\cs_new_protected:Npn \fp_sub:Nn { \__fp_add:NNNn \fp_set:Nn - } +\cs_new_protected: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 \__fp_parse:n {#4} } } \cs_generate_variant:Nn \fp_add:Nn { c } @@ -16013,7 +16108,7 @@ \__msg_show_variable:NNNnn #1 \fp_if_exist:NTF ? { } { > ~ \token_to_str:N #1 = \fp_to_tl:N #1 } } -\cs_new_protected_nopar:Npn \fp_show:n +\cs_new_protected:Npn \fp_show:n { \__msg_show_wrap:Nn \fp_to_tl:n } \cs_generate_variant:Nn \fp_show:N { c } \fp_const:Nn \c_e_fp { 2.718 2818 2845 9045 } @@ -16024,7 +16119,7 @@ \fp_new:N \l_tmpb_fp \fp_new:N \g_tmpa_fp \fp_new:N \g_tmpb_fp -%% File: l3box.dtx Copyright (C) 2005-2015 The LaTeX3 Project +%% File: l3box.dtx Copyright (C) 2005-2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -16056,7 +16151,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3box.dtx 5822 2015-08-09 16:41:04Z joseph $ +\GetIdInfo$Id: l3box.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Experimental boxes} \cs_new_protected:Npn \box_new:N #1 { @@ -16154,7 +16249,7 @@ \cs_new_protected:Npn \box_show:N #1 { \box_show:Nnn #1 \c_max_int \c_max_int } \cs_generate_variant:Nn \box_show:N { c } -\cs_new_protected_nopar:Npn \box_show:Nnn +\cs_new_protected:Npn \box_show:Nnn { \__box_show:NNnn \c_one } \cs_generate_variant:Nn \box_show:Nnn { c } \cs_new_protected:Npn \box_log:N #1 @@ -16295,7 +16390,7 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3coffins.dtx 6508 2016-05-17 17:00:42Z joseph $ +\GetIdInfo$Id: l3coffins.dtx 6685 2016-08-19 16:26:52Z bruno $ {L3 Coffin code layer} \box_new:N \l__coffin_internal_box \dim_new:N \l__coffin_internal_dim @@ -16426,7 +16521,7 @@ \__coffin_if_exist:NT #1 { \hbox_set:Nw #1 \color_group_begin: \color_ensure_current: - \cs_set_protected_nopar:Npn \hcoffin_set_end: + \cs_set_protected:Npn \hcoffin_set_end: { \color_group_end: \hbox_set_end: @@ -16436,7 +16531,7 @@ } } } -\cs_new_protected_nopar:Npn \hcoffin_set_end: { } +\cs_new_protected:Npn \hcoffin_set_end: { } \cs_generate_variant:Nn \hcoffin_set:Nw { c } \cs_new_protected:Npn \vcoffin_set:Nnw #1#2 { @@ -16469,7 +16564,7 @@ } } } -\cs_new_protected_nopar:Npn \vcoffin_set_end: { } +\cs_new_protected:Npn \vcoffin_set_end: { } \cs_generate_variant:Nn \vcoffin_set:Nnw { c } \cs_new_protected:Npn \coffin_set_eq:NN #1#2 { @@ -17099,7 +17194,7 @@ > ~ wd~=~#4 \\ Poles~of~coffin~#1 : } -%% File: l3color.dtx Copyright(C) 2011,2012,2014 The LaTeX3 Project +%% File: l3color.dtx Copyright(C) 2011,2012,2014,2016 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -17132,26 +17227,26 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3color.dtx 5354 2014-08-23 01:35:39Z bruno $ +\GetIdInfo$Id: l3color.dtx 6596 2016-06-13 21:29:58Z joseph $ {L3 Experimental color support} \cs_new_eq:NN \color_group_begin: \group_begin: -\cs_new_protected_nopar:Npn \color_group_end: +\cs_new_protected:Npn \color_group_end: { \tex_par:D \group_end: } -\cs_new_protected_nopar:Npn \color_ensure_current: { } +\cs_new_protected:Npn \color_ensure_current: { } \AtBeginDocument { \cs_if_exist:NTF \__driver_color_ensure_current: { - \cs_set_protected_nopar:Npn \color_ensure_current: + \cs_set_protected:Npn \color_ensure_current: { \__driver_color_ensure_current: } } { \cs_if_exist:NT \set@color { - \cs_set_protected_nopar:Npn \color_ensure_current: + \cs_set_protected:Npn \color_ensure_current: { \set@color } } } @@ -17333,13 +17428,13 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3candidates.dtx 6484 2016-05-13 19:08:30Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 6688 2016-08-19 19:21:48Z bruno $ {L3 Experimental additions to l3kernel} -\cs_new_protected_nopar:Npn \cs_log:N +\cs_new_protected:Npn \cs_log:N { \__msg_log_next: \cs_show:N } -\cs_new_protected_nopar:Npn \cs_log:c +\cs_new_protected:Npn \cs_log:c { \__msg_log_next: \cs_show:c } -\cs_new_protected_nopar:Npn \__kernel_register_log:N +\cs_new_protected:Npn \__kernel_register_log:N { \__msg_log_next: \__kernel_register_show:N } \cs_generate_variant:Nn \__kernel_register_log:N { c } \fp_new:N \l__box_angle_fp @@ -17729,9 +17824,9 @@ \box_set_eq:NN #1 \l__box_internal_box } \cs_generate_variant:Nn \box_viewport:Nnnnn { c } -\cs_new_protected_nopar:Npn \clist_log:N +\cs_new_protected:Npn \clist_log:N { \__msg_log_next: \clist_show:N } -\cs_new_protected_nopar:Npn \clist_log:n +\cs_new_protected:Npn \clist_log:n { \__msg_log_next: \clist_show:n } \cs_generate_variant:Nn \clist_log:N { c } \fp_new:N \l__coffin_sin_fp @@ -17852,7 +17947,7 @@ \dim_set:Nn \l__coffin_top_corner_dim { \dim_max:nn { \l__coffin_top_corner_dim } {#2} } } -\cs_new_protected_nopar:Npn \__coffin_find_bounding_shift: +\cs_new_protected:Npn \__coffin_find_bounding_shift: { \dim_set:Nn \l__coffin_bounding_shift_dim { \c_max_dim } \prop_map_inline:Nn \l__coffin_bounding_prop @@ -17963,7 +18058,7 @@ {#5} {#6} } } -\cs_new_protected_nopar:Npn \coffin_log_structure:N +\cs_new_protected:Npn \coffin_log_structure:N { \__msg_log_next: \coffin_show_structure:N } \cs_generate_variant:Nn \coffin_log_structure:N { c } \cs_new_protected:Npn \file_if_exist_input:n #1 @@ -17992,15 +18087,15 @@ \__file_input:V \l__file_internal_name_tl } } -\cs_new_nopar:Npn \ior_map_break: +\cs_new:Npn \ior_map_break: { \__prg_map_break:Nn \ior_map_break: { } } -\cs_new_nopar:Npn \ior_map_break:n +\cs_new:Npn \ior_map_break:n { \__prg_map_break:Nn \ior_map_break: } -\cs_new_protected_nopar:Npn \ior_map_inline:Nn +\cs_new_protected:Npn \ior_map_inline:Nn { \__ior_map_inline:NNn \ior_get:NN } -\cs_new_protected_nopar:Npn \ior_str_map_inline:Nn +\cs_new_protected:Npn \ior_str_map_inline:Nn { \__ior_map_inline:NNn \ior_get_str:NN } -\cs_new_protected_nopar:Npn \__ior_map_inline:NNn +\cs_new_protected:Npn \__ior_map_inline:NNn { \int_gincr:N \g__prg_map_int \exp_args:Nc \__ior_map_inline:NNNn @@ -18023,21 +18118,21 @@ } } \tl_new:N \l__ior_internal_tl -\cs_new_protected_nopar:Npn \ior_log_streams: +\cs_new_protected:Npn \ior_log_streams: { \__msg_log_next: \ior_list_streams: } -\cs_new_protected_nopar:Npn \iow_log_streams: +\cs_new_protected:Npn \iow_log_streams: { \__msg_log_next: \iow_list_streams: } -\cs_new_protected_nopar:Npn \fp_log:N +\cs_new_protected:Npn \fp_log:N { \__msg_log_next: \fp_show:N } -\cs_new_protected_nopar:Npn \fp_log:n +\cs_new_protected:Npn \fp_log:n { \__msg_log_next: \fp_show:n } \cs_generate_variant:Nn \fp_log:N { c } -\cs_new_protected_nopar:Npn \int_log:N +\cs_new_protected:Npn \int_log:N { \__msg_log_next: \int_show:N } \cs_generate_variant:Nn \int_log:N { c } -\cs_new_protected_nopar:Npn \int_log:n +\cs_new_protected:Npn \int_log:n { \__msg_log_next: \int_show:n } -\cs_new_protected_nopar:Npn \keys_log:nn +\cs_new_protected:Npn \keys_log:nn { \__msg_log_next: \keys_show:nn } \cs_new:Npn \msg_expandable_error:nnnnnn #1#2#3#4#5#6 { @@ -18096,11 +18191,21 @@ { \prg_return_true: } { \bool_if:nTF {#2} { \prg_return_true: } { \prg_return_false: } } } -\cs_new_protected_nopar:Npn \bool_log:N +\cs_new_protected:Npn \bool_log:N { \__msg_log_next: \bool_show:N } -\cs_new_protected_nopar:Npn \bool_log:n +\cs_new_protected:Npn \bool_log:n { \__msg_log_next: \bool_show:n } \cs_generate_variant:Nn \bool_log:N { c } +\cs_new:Npn \prop_count:N #1 + { + \int_eval:n + { + \c_zero + \prop_map_function:NN #1 \__prop_count:nn + } + } +\cs_new:Npn \__prop_count:nn #1#2 { + \c_one } +\cs_generate_variant:Nn \prop_count:N { c } \cs_new:Npn \prop_map_tokens:Nn #1#2 { \exp_last_unbraced:Nno \__prop_map_tokens:nwwn {#2} #1 @@ -18116,7 +18221,7 @@ \__prop_map_tokens:nwwn {#1} } \cs_generate_variant:Nn \prop_map_tokens:Nn { c } -\cs_new_protected_nopar:Npn \prop_log:N +\cs_new_protected:Npn \prop_log:N { \__msg_log_next: \prop_show:N } \cs_generate_variant:Nn \prop_log:N { c } \cs_new:Npn \seq_mapthread_function:NNN #1#2#3 @@ -18142,9 +18247,9 @@ } \cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc } \cs_generate_variant:Nn \seq_mapthread_function:NNN { c , cc } -\cs_new_protected_nopar:Npn \seq_set_filter:NNn +\cs_new_protected:Npn \seq_set_filter:NNn { \__seq_set_filter:NNNn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_filter:NNn +\cs_new_protected:Npn \seq_gset_filter:NNn { \__seq_set_filter:NNNn \tl_gset:Nx } \cs_new_protected:Npn \__seq_set_filter:NNNn #1#2#3#4 { @@ -18152,9 +18257,9 @@ #1 #2 { #3 } \__seq_pop_item_def: } -\cs_new_protected_nopar:Npn \seq_set_map:NNn +\cs_new_protected:Npn \seq_set_map:NNn { \__seq_set_map:NNNn \tl_set:Nx } -\cs_new_protected_nopar:Npn \seq_gset_map:NNn +\cs_new_protected:Npn \seq_gset_map:NNn { \__seq_set_map:NNNn \tl_gset:Nx } \cs_new_protected:Npn \__seq_set_map:NNNn #1#2#3#4 { @@ -18162,7 +18267,7 @@ #1 #2 { #3 } \__seq_pop_item_def: } -\cs_new_protected_nopar:Npn \seq_log:N +\cs_new_protected:Npn \seq_log:N { \__msg_log_next: \seq_show:N } \cs_generate_variant:Nn \seq_log:N { c } \cs_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4 @@ -18180,15 +18285,15 @@ } \cs_new_eq:NN \dim_log:N \__kernel_register_log:N \cs_new_eq:NN \dim_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \dim_log:n +\cs_new_protected:Npn \dim_log:n { \__msg_log_next: \dim_show:n } \cs_new_eq:NN \skip_log:N \__kernel_register_log:N \cs_new_eq:NN \skip_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \skip_log:n +\cs_new_protected:Npn \skip_log:n { \__msg_log_next: \skip_show:n } \cs_new_eq:NN \muskip_log:N \__kernel_register_log:N \cs_new_eq:NN \muskip_log:c \__kernel_register_log:c -\cs_new_protected_nopar:Npn \muskip_log:n +\cs_new_protected:Npn \muskip_log:n { \__msg_log_next: \muskip_show:n } \prg_new_conditional:Npnn \tl_if_single_token:n #1 { p , T , F , TF } { @@ -18240,9 +18345,9 @@ \cs_new:Npn \__tl_act_count_space:n #1 { 1 + } \cs_new:Npn \__tl_act_count_group:nn #1 #2 { 2 + \tl_count_tokens:n {#2} + } -\cs_new_protected_nopar:Npn \tl_set_from_file:Nnn +\cs_new_protected:Npn \tl_set_from_file:Nnn { \__tl_set_from_file:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_from_file:Nnn +\cs_new_protected:Npn \tl_gset_from_file:Nnn { \__tl_set_from_file:NNnn \tl_gset:Nn } \cs_generate_variant:Nn \tl_set_from_file:Nnn { c } \cs_generate_variant:Nn \tl_gset_from_file:Nnn { c } @@ -18265,9 +18370,9 @@ { \cs_set_protected:Npn \__tl_from_file_do:w #1 } { \c__tl_rescan_marker_tl } { \tl_set:No \l__tl_internal_a_tl {#1} } -\cs_new_protected_nopar:Npn \tl_set_from_file_x:Nnn +\cs_new_protected:Npn \tl_set_from_file_x:Nnn { \__tl_set_from_file_x:NNnn \tl_set:Nn } -\cs_new_protected_nopar:Npn \tl_gset_from_file_x:Nnn +\cs_new_protected:Npn \tl_gset_from_file_x:Nnn { \__tl_set_from_file_x:NNnn \tl_gset:Nn } \cs_generate_variant:Nn \tl_set_from_file_x:Nnn { c } \cs_generate_variant:Nn \tl_gset_from_file_x:Nnn { c } @@ -18285,12 +18390,12 @@ } } \cs_generate_variant:Nn \tl_if_head_eq_catcode:nNTF { o } -\cs_new_nopar:Npn \tl_lower_case:n { \__tl_change_case:nnn { lower } { } } -\cs_new_nopar:Npn \tl_upper_case:n { \__tl_change_case:nnn { upper } { } } -\cs_new_nopar:Npn \tl_mixed_case:n { \__tl_mixed_case:nn { } } -\cs_new_nopar:Npn \tl_lower_case:nn { \__tl_change_case:nnn { lower } } -\cs_new_nopar:Npn \tl_upper_case:nn { \__tl_change_case:nnn { upper } } -\cs_new_nopar:Npn \tl_mixed_case:nn { \__tl_mixed_case:nn } +\cs_new:Npn \tl_lower_case:n { \__tl_change_case:nnn { lower } { } } +\cs_new:Npn \tl_upper_case:n { \__tl_change_case:nnn { upper } { } } +\cs_new:Npn \tl_mixed_case:n { \__tl_mixed_case:nn { } } +\cs_new:Npn \tl_lower_case:nn { \__tl_change_case:nnn { lower } } +\cs_new:Npn \tl_upper_case:nn { \__tl_change_case:nnn { upper } } +\cs_new:Npn \tl_mixed_case:nn { \__tl_mixed_case:nn } \cs_new:Npn \__tl_change_case:nnn #1#2#3 { \etex_unexpanded:D \exp_after:wN @@ -18523,6 +18628,7 @@ } \cs_new:Npn \__tl_change_case_cs:N #1 { + \str_if_eq:nnTF {#1} { \protect } { \__tl_change_case_protect:wNN } \exp_after:wN \__tl_change_case_cs:NN \exp_after:wN #1 \l_tl_case_change_exclude_tl \q_recursion_tail \q_recursion_stop @@ -18546,6 +18652,8 @@ \__tl_change_case_output:nwn { #1 {#3} } #2 } +\cs_new:Npn \__tl_change_case_protect:wNN #1 \q_recursion_stop #2 #3 + { \__tl_change_case_output:nwn { \protect #3 } #2 } \cs_new:Npn \__tl_change_case_if_expandable:NTF #1 { \token_if_expandable:NTF #1 @@ -19260,15 +19368,15 @@ ` - } -\cs_new_protected_nopar:Npn \tl_log:N +\cs_new_protected:Npn \tl_log:N { \__msg_log_next: \tl_show:N } \cs_generate_variant:Nn \tl_log:N { c } -\cs_new_protected_nopar:Npn \tl_log:n +\cs_new_protected:Npn \tl_log:n { \__msg_log_next: \tl_show:n } \group_begin: \cs_set_protected:Npn \__peek_tmp:w #1 \q_stop { - \cs_new_protected_nopar:Npn \__peek_execute_branches_N_type: + \cs_new_protected:Npn \__peek_execute_branches_N_type: { \if_int_odd:w \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi: @@ -19297,11 +19405,11 @@ { \__peek_true:w } { \tl_if_empty:nTF {#2} { \__peek_true:w } { \__peek_false:w } } } -\cs_new_protected_nopar:Npn \peek_N_type:TF +\cs_new_protected:Npn \peek_N_type:TF { \__peek_token_generic:NNTF \__peek_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:T +\cs_new_protected:Npn \peek_N_type:T { \__peek_token_generic:NNT \__peek_execute_branches_N_type: \scan_stop: } -\cs_new_protected_nopar:Npn \peek_N_type:F +\cs_new_protected:Npn \peek_N_type:F { \__peek_token_generic:NNF \__peek_execute_branches_N_type: \scan_stop: } %% File: l3luatex.dtx Copyright (C) 2010-2016 The LaTeX3 Project %% @@ -19335,7 +19443,7 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\GetIdInfo$Id: l3luatex.dtx 6465 2016-03-26 16:15:09Z joseph $ +\GetIdInfo$Id: l3luatex.dtx 6679 2016-08-18 20:54:06Z bruno $ {L3 Experimental LuaTeX-specific functions} \cs_new:Npn \lua_now_x:n #1 { \luatex_directlua:D {#1} } \cs_new:Npn \lua_now:n #1 { \lua_now_x:n { \exp_not:n {#1} } } diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex index 42126c988c8..b57887da668 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex @@ -47,8 +47,8 @@ %% ----------------------------------------------------------------------- \def\ExplFileName{expl3}% \def\ExplFileDescription{L3 programming layer}% -\def\ExplFileDate{2016/05/18}% -\def\ExplFileVersion{6512}% +\def\ExplFileDate{2016/10/19}% +\def\ExplFileVersion{6730}% \let\ExplLoaderFileVersion\ExplFileVersion \begingroup \def\tempa{LaTeX2e}% diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 97c34cfc936..7dfc9b66c66 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -47,8 +47,8 @@ %% ----------------------------------------------------------------------- \def\ExplFileName{expl3}% \def\ExplFileDescription{L3 programming layer}% -\def\ExplFileDate{2016/05/18}% -\def\ExplFileVersion{6512}% +\def\ExplFileDate{2016/10/19}% +\def\ExplFileVersion{6730}% \let\ExplLoaderFileVersion\ExplFileVersion \ProvidesPackage{\ExplFileName} [% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index aa9ac162b60..0dc4351b3e7 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -50,7 +50,7 @@ \let \fileversionOld \ExplFileVersion \let \filedescriptionOld \ExplFileDescription \RequirePackage{expl3,xparse,calc} -\GetIdInfo$Id: l3doc.dtx 6474 2016-04-11 18:09:21Z qinglee $ +\GetIdInfo$Id: l3doc.dtx 6701 2016-09-08 13:56:52Z qinglee $ {L3 Experimental documentation class} \ProvidesExplClass {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -58,80 +58,11 @@ \let \ExplFileDate \filedateOld \let \ExplFileVersion \fileversionOld \let \ExplFileDescription \filedescriptionOld -\cs_generate_variant:Nn \tl_count:n { f } -\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx } -\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o } -\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o } -\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o } -\cs_generate_variant:Nn \tl_if_in:NnTF { No } -\cs_generate_variant:Nn \tl_if_in:NnT { No } -\cs_generate_variant:Nn \tl_if_in:NnF { No } -\cs_generate_variant:Nn \tl_remove_all:Nn { Nx } -\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno } -\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo } -\cs_generate_variant:Nn \prop_get:NnNTF { Nx } -\cs_generate_variant:Nn \prop_put:Nnn { Nx } -\cs_generate_variant:Nn \prop_gput:Nnn { NVx } -\cs_new_protected:Npn \__codedoc_replace_at_at:N #1 - { - \tl_if_empty:NF \g__codedoc_module_name_tl - { - \exp_args:NNo \__codedoc_replace_at_at_aux:Nn - #1 \g__codedoc_module_name_tl - } - } -\cs_new_protected:Npn \__codedoc_replace_at_at_aux:Nn #1#2 - { - \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } - \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } - \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 } - \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 } - } -\cs_new_protected:Npn \__codedoc_verb_get_seq:nN #1#2 - { - \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} } - \tl_remove_all:Nx \l__codedoc_tmpa_tl - { \iow_char:N \^^M \iow_char:N \% } - \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } } - \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I } - \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M } - \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl - \exp_args:NNx \seq_set_from_clist:Nn #2 - { \tl_to_str:N \l__codedoc_tmpa_tl } - } -\cs_new:Npn \__codedoc_signature_base_form:n #1 - { \__codedoc_signature_base_form_aux:n #1 \c_empty_tl } -\cs_new:Npn \__codedoc_signature_base_form_aux:n #1 - { - \str_case:nnTF {#1} - { - { N } { N } - { c } { N } - { n } { n } - { o } { n } - { f } { n } - { x } { n } - { V } { n } - { v } { n } - } - { \__codedoc_signature_base_form_aux:n } - {#1} - } -\cs_new:Npn \__codedoc_predicate_from_base:N #1 - { - \__cs_get_function_name:N #1 _p: - \__cs_get_function_signature:N #1 - } -\cs_new_protected:Npn \CodedocUseCs #1 { \use:c { \tl_to_str:n {#1} } } -\cs_new:Npn \CodedocUnexpandedTokens #1 # - { \use:c { CodedocUnexpandedTokens ~ } \__codedoc_exp_not:n } -\cs_new_protected:cpn { CodedocUnexpandedTokens ~ } #1#2 {#2} -\cs_new:Npn \__codedoc_exp_not:n #1 { \exp_not:n { \__codedoc_exp_not:n {#1} } } \clist_new:N \g_docinput_clist \seq_new:N \g_doc_functions_seq \seq_new:N \g_doc_macros_seq \coffin_new:N \l__codedoc_output_coffin -\coffin_new:N \l__codedoc_names_coffin +\coffin_new:N \l__codedoc_functions_coffin \coffin_new:N \l__codedoc_descr_coffin \coffin_new:N \l__codedoc_syntax_coffin \box_new:N \g__codedoc_syntax_box @@ -146,35 +77,44 @@ \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_noTF_bool \bool_new:N \l__codedoc_macro_EXP_bool \bool_new:N \l__codedoc_macro_rEXP_bool \bool_new:N \l__codedoc_macro_var_bool +\tl_new:N \l__codedoc_override_module_tl +\tl_set:Nn \l__codedoc_override_module_tl { \q_no_value } +\tl_new:N \l__codedoc_macro_documented_tl \bool_new:N \g__codedoc_lmodern_bool \bool_new:N \g__codedoc_checkfunc_bool \bool_new:N \g__codedoc_checktest_bool \tl_new:N \l__codedoc_tmpa_tl \tl_new:N \l__codedoc_tmpb_tl \int_new:N \l__codedoc_tmpa_int -\prop_new:N \l__codedoc_functions_block_prop -\seq_new:N \l__codedoc_function_input_seq -\seq_new:N \l__codedoc_macro_input_seq +\int_new:N \l__codedoc_tmpa_seq +\tl_new:N \l__codedoc_names_block_tl +\seq_new:N \g__codedoc_variants_seq +\bool_new:N \l__codedoc_names_verb_bool +\seq_new:N \l__codedoc_names_seq +\seq_new:N \g__codedoc_nested_names_seq \tl_const:Nx \c__codedoc_backslash_tl { \iow_char:N \\ } \exp_last_unbraced:NNo \cs_new_eq:NN \c__codedoc_backslash_token { \c__codedoc_backslash_tl } -\tl_new:N \g__codedoc_function_name_prefix_tl \tl_new:N \l__codedoc_index_macro_tl \tl_new:N \l__codedoc_index_key_tl \tl_new:N \l__codedoc_index_module_tl +\bool_new:N \l__codedoc_index_internal_bool \tl_new:N \g__codedoc_module_name_tl \tl_const:Nn \c__codedoc_iow_rule_tl { ======================================== } \tl_const:Nn \c__codedoc_iow_mid_rule_tl { -------------------------------------- } -\box_new:N \l__codedoc_macro_index_box \box_new:N \l__codedoc_macro_box +\box_new:N \l__codedoc_macro_index_box \int_new:N \l__codedoc_macro_int \tl_new:N \l__codedoc_cmd_tl \tl_new:N \l__codedoc_cmd_index_tl +\tl_new:N \l__codedoc_cmd_module_tl +\bool_new:N \l__codedoc_cmd_noindex_bool \bool_new:N \l__codedoc_cmd_replace_bool \bool_new:N \l__codedoc_in_implementation_bool \bool_new:N \g__codedoc_typeset_documentation_bool @@ -183,9 +123,213 @@ \bool_set_true:N \g__codedoc_typeset_implementation_bool \tl_new:N \g__codedoc_base_name_tl \prop_new:N \l__codedoc_variants_prop +\clist_new:N \l__codedoc_function_label_clist \bool_new:N \l__codedoc_no_label_bool +\tl_new:N \l__codedoc_date_added_tl +\tl_new:N \l__codedoc_date_updated_tl +\tl_new:N \l__codedoc_macro_argument_tl \cs_new_eq:NN \__codedoc_tmpa:w ? \cs_new_eq:NN \__codedoc_tmpb:w ? +\cs_generate_variant:Nn \seq_set_split:Nnn { NoV } +\cs_generate_variant:Nn \str_case:nn { fn } +\cs_generate_variant:Nn \tl_count:n { f } +\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx , Nno } +\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o } +\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o } +\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o } +\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V } +\cs_generate_variant:Nn \tl_if_in:nnTF { no } +\cs_generate_variant:Nn \tl_if_in:NnTF { No } +\cs_generate_variant:Nn \tl_if_in:NnT { No } +\cs_generate_variant:Nn \tl_if_in:NnF { No } +\cs_generate_variant:Nn \tl_remove_all:Nn { Nx } +\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno } +\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo } +\cs_generate_variant:Nn \tl_to_str:n { f , o } +\cs_generate_variant:Nn \prop_get:NnNTF { Nx } +\cs_generate_variant:Nn \prop_put:Nnn { Nx } +\cs_generate_variant:Nn \prop_gput:Nnn { NVx } +\prg_new_protected_conditional:Npnn \__codedoc_if_almost_str:n #1 { TF , T , F } + { + \int_compare:nNnTF + { \tl_count:n {#1} } + < { \tl_count:f { \tl_to_str:f {#1} } } + { \prg_return_false: } + { \prg_return_true: } + } +\cs_generate_variant:Nn \__codedoc_if_almost_str:nT { V } +\cs_new_protected:Npn \__codedoc_replace_at_at:N #1 + { + \tl_if_empty:NF \g__codedoc_module_name_tl + { + \exp_args:NNo \__codedoc_replace_at_at_aux:Nn + #1 \g__codedoc_module_name_tl + } + } +\cs_new_protected:Npn \__codedoc_replace_at_at_aux:Nn #1#2 + { + \tl_replace_all:Non #1 { \token_to_str:N @ } { @ } + \tl_replace_all:Non #1 { \token_to_str:N _ } { _ } + \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 } + \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 } + } +\cs_new:Npn \__codedoc_signature_base_form:n #1 + { \__codedoc_signature_base_form_aux:n #1 \q_stop } +\cs_new:Npn \__codedoc_signature_base_form_aux:n #1 + { + \str_case:nnTF {#1} + { + { N } { N } + { c } { N } + { n } { n } + { o } { n } + { f } { n } + { x } { n } + { V } { n } + { v } { n } + } + { \__codedoc_signature_base_form_aux:n } + { \__codedoc_signature_base_form_aux:w #1 } + } +\cs_new:Npn \__codedoc_signature_base_form_aux:w #1 \q_stop + { \exp_not:n {#1} } +\cs_new:Npn \__codedoc_predicate_from_base:n #1 + { + \__codedoc_get_function_name:n {#1} + \tl_to_str:n { _p: } + \__codedoc_get_function_signature:n {#1} + } +\cs_new:Npn \__codedoc_get_function_name:n #1 + { \__codedoc_split_function_do:nn {#1} { \use_i:nnn } } +\cs_new:Npn \__codedoc_get_function_signature:n #1 + { \__codedoc_split_function_do:nn {#1} { \use_ii:nnn } } +\cs_set_protected:Npn \__codedoc_tmpa:w #1 + { + \cs_new:Npn \__codedoc_split_function_do:nn ##1 + { + \exp_after:wN \__codedoc_split_function_auxi:w + \tl_to_str:n {##1} \q_mark \c_true_bool + #1 \q_mark \c_false_bool + \q_stop + } + \cs_new:Npn \__codedoc_split_function_auxi:w + ##1 #1 ##2 \q_mark ##3##4 \q_stop ##5 + { \__codedoc_split_function_auxii:w {##5} ##1 \q_mark \q_stop {##2} ##3 } + \cs_new:Npn \__codedoc_split_function_auxii:w + ##1##2 \q_mark ##3 \q_stop + { ##1 {##2} } + } +\exp_args:No \__codedoc_tmpa:w { \token_to_str:N : } +\cs_generate_variant:Nn \__codedoc_split_function_do:nn { o } +\cs_new_protected:Npn \__codedoc_key_get_base:nN #1#2 + { + \__codedoc_if_almost_str:nTF {#1} + { + \__codedoc_key_get_base_TF:nN {#1} \l__codedoc_tmpa_tl + \tl_set:Nx #2 + { \__codedoc_split_function_do:on \l__codedoc_tmpa_tl { \__codedoc_base_form_aux:nnN } } + } + { \tl_set:Nn #2 {#1} } + } +\cs_new:Npx \__codedoc_key_get_base_TF:nN #1#2 + { + \tl_set:Nx #2 { \exp_not:N \tl_to_str:n {#1} \scan_stop: } + \tl_if_in:NnTF #2 { \tl_to_str:n { F } \scan_stop: } + { + \tl_if_in:NnF #2 { \tl_to_str:n { TF } \scan_stop: } + { + \tl_replace_once:Nnn #2 + { \tl_to_str:n { F } \scan_stop: } + { \tl_to_str:n { TF } \scan_stop: } + } + } + { + \tl_replace_once:Nnn #2 + { \tl_to_str:n { T } \scan_stop: } + { \tl_to_str:n { TF } \scan_stop: } + } + \tl_remove_once:Nn #2 { \scan_stop: } + } +\cs_new:Npn \__codedoc_base_form_aux:nnN #1#2#3 + { + \exp_not:n {#1} + \bool_if:NT #3 + { + \token_to_str:N : + \str_if_eq:nnTF { #1 ~ } { \exp_args } + { \exp_not:n {#2} } + { \__codedoc_signature_base_form:n {#2} } + } + } +\cs_new_protected:Npn \__codedoc_base_form_signature_do:nnn #1#2#3 + { + \__codedoc_split_function_do:nn {#1} + { \__codedoc_base_form_aux:nnnnnN {#1} {#2} {#3} } + } +\cs_new_protected:Npn \__codedoc_base_form_aux:nnnnnN #1#2#3#4#5#6 + { + \bool_if:NTF #6 + { + \tl_if_head_eq_charcode:nNTF {#4} : + { #2 {#1} } + { + \use:x + { + \exp_not:n {#3} + { \__codedoc_base_form_aux:nnN {#4} {#5} #6 } + } + {#4} {#5} + } + } + { #2 {#1} } + } +\prg_new_conditional:Npnn \__codedoc_date_compare:nNn #1#2#3 { TF , T , F , p } + { \__codedoc_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop } +\cs_new:Npn \__codedoc_date_compare_aux:w + #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop + { + \__codedoc_date_compare_aux:nnnNnnn + { \tl_if_empty:nTF {#1} { 0 } {#1} } + { \tl_if_empty:nTF {#2} { 0 } {#2} } + { \tl_if_empty:nTF {#3} { 0 } {#3} } + #5 + { \tl_if_empty:nTF {#6} { 0 } {#6} } + { \tl_if_empty:nTF {#7} { 0 } {#7} } + { \tl_if_empty:nTF {#8} { 0 } {#8} } + } +\cs_new:Npn \__codedoc_date_compare_aux:nnnNnnn #1#2#3#4#5#6#7 + { + \int_compare:nNnTF {#1} = {#5} + { + \int_compare:nNnTF {#2} = {#6} + { + \int_compare:nNnTF {#3} #4 {#7} + { \prg_return_true: } { \prg_return_false: } + } + { + \int_compare:nNnTF {#2} #4 {#6} + { \prg_return_true: } { \prg_return_false: } + } + } + { + \int_compare:nNnTF {#1} #4 {#5} + { \prg_return_true: } { \prg_return_false: } + } + \use_none:n + \q_stop + } +\cs_new:Npn \__codedoc_gprop_name:n #1 { g__codedoc ~ \tl_to_str:n {#1} } +\cs_new:Npn \__codedoc_lseq_name:n #1 { l__codedoc ~ \tl_to_str:n {#1} } +\msg_new:nnnn { l3doc } { no-signature-TF } + { Function/macro~'#1'~cannot~be~turned~into~a~conditional. } + { + A~function~or~macro~environment~with~option~pTF,~TF~or~noTF~ + received~the~argument~'#1'.~This~function's~name~has~no~ + ':'~hence~it~is~not~clear~where~to~add~'_p'~or~'TF'.~ + Please~follow~expl3~naming~conventions. + } +\msg_new:nnn { l3doc } { deprecated-function } + { The~deprecated~function(s)~'#1'~should~have~been~removed~on~#2. } \DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } } \DeclareOption { full } { @@ -210,7 +354,8 @@ \DeclareOption { lm-default } { \bool_gset_true:N \g__codedoc_lmodern_bool } \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } } -\ExecuteOptions { full, a4paper, nocheck, nochecktest, lm-default } +\ExecuteOptions { full, nocheck, nochecktest, lm-default } +\PassOptionsToClass { a4paper } { article } \msg_new:nnn { l3doc } { input-cfg } { Local~config~file~l3doc.cfg~loaded. } \file_if_exist:nT { l3doc.cfg } @@ -254,7 +399,7 @@ \group_end: } \RequirePackage{hypdoc} -\cs_gset_nopar:Npn \MakePrivateLetters +\cs_gset:Npn \MakePrivateLetters { \char_set_catcode_letter:N \@ \char_set_catcode_letter:N \_ @@ -268,19 +413,30 @@ \fvset{gobble=2} \cs_gset_eq:NN \verbatim \Verbatim \cs_gset_eq:NN \endverbatim \endVerbatim +\cs_set_protected:Npn \ifnot@excluded + { + \exp_args:Nxx \expanded@notin + { \c__codedoc_backslash_tl \tl_to_str:N \macro@namepart , } + { \exp_args:NV \tl_to_str:n \index@excludelist } + } +\cs_new:Npn \pdfstringnewline { : ~ } +\DeclareExpandableDocumentCommand + { \__codedoc_pdfstring_newline:w } { s o m } { \pdfstringnewline #3 } +\pdfstringdefDisableCommands + { \cs_set_eq:NN \\ \__codedoc_pdfstring_newline:w } \setlength \textwidth { 385pt } \addtolength \marginparwidth { 30pt } \addtolength \oddsidemargin { 20pt } \addtolength \evensidemargin { 20pt } \cs_new_eq:NN \__codedoc_oldlist:nn \list -\cs_gset_nopar:Npn \list #1 #2 +\cs_gset:Npn \list #1 #2 { \__codedoc_oldlist:nn {#1} { #2 \dim_zero:N \listparindent } } \setlength \parindent { 2em } \setlength \itemindent { 0pt } \setlength \parskip { 0pt plus 3pt minus 0pt } \tl_gset:Nn \partname {File} \@addtoreset{section}{part} -\cs_gset_nopar:Npn \l@section #1#2 +\cs_gset:Npn \l@section #1#2 { \ifnum \c@tocdepth >\z@ \addpenalty\@secpenalty @@ -296,7 +452,7 @@ \endgroup \fi } -\cs_gset_nopar:Npn \l@subsection +\cs_gset:Npn \l@subsection { \@dottedtocline{2}{2.5em}{2.3em} } % #2 = 1.5em \AtBeginDocument { @@ -318,18 +474,31 @@ \providecommand*\upTeX{up\kern-.2em\hologo{TeX}} \providecommand*\epTeX{$\varepsilon$-\pTeX} \providecommand*\eupTeX{$\varepsilon$-\upTeX} -\DeclareExpandableDocumentCommand \cmd { O{} m } +\DeclareDocumentCommand \cmd { O{} m } { \__codedoc_cmd:no {#1} { \token_to_str:N #2 } } -\DeclareExpandableDocumentCommand \cs { O{} m } +\DeclareDocumentCommand \cs { O{} m } { \__codedoc_cmd:no {#1} { \c__codedoc_backslash_tl #2 } } -\DeclareExpandableDocumentCommand \tn { O{} m } +\DeclareDocumentCommand \tn { O{} m } { \__codedoc_cmd:no - { index = TeX , replace = false , #1 } + { module = TeX , replace = false , #1 } { \c__codedoc_backslash_tl #2 } } -\DeclareExpandableDocumentCommand { \meta } { m } +\DeclareDocumentCommand \meta { m } { \__codedoc_meta:n {#1} } +\DeclareExpandableDocumentCommand + { \__codedoc_pdfstring_cmd:w } { o m } { \token_to_str:N #2 } +\DeclareExpandableDocumentCommand + { \__codedoc_pdfstring_cs:w } { o m } { \textbackslash \tl_to_str:n {#2} } +\cs_new:Npn \__codedoc_pdfstring_meta:w #1 + { < \tl_to_str:n {#1} > } +\pdfstringdefDisableCommands + { + \cs_set_eq:NN \cmd \__codedoc_pdfstring_cmd:w + \cs_set_eq:NN \cs \__codedoc_pdfstring_cs:w + \cs_set_eq:NN \tn \__codedoc_pdfstring_cs:w + \cs_set_eq:NN \meta \__codedoc_pdfstring_meta:w + } \newcommand\Arg[1] { \texttt{\char`\{} \meta{#1} \texttt{\char`\}} } \providecommand\marg[1]{ \Arg{#1} } @@ -404,27 +573,47 @@ { \endenumerate } +\NewDocumentCommand { \CodedocExplain } { } + { \CodedocExplainEXP \ \CodedocExplainREXP \ \CodedocExplainTF } +\NewDocumentCommand { \CodedocExplainEXP } { } + { + \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}% + \__codedoc_typeset_exp:\ indicates~fully~expandable~functions,~which~ + can~be~used~within~an~\texttt{x}-type~argument~(in~plain~ + \TeX{}~terms,~inside~an~\cs{edef}),~as~well~as~within~an~ + \texttt{f}-type~argument. + } +\NewDocumentCommand { \CodedocExplainREXP } { } + { + \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}% + \__codedoc_typeset_rexp:\ indicates~ + restricted~expandable~functions,~which~can~be~used~within~an~ + \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~ + \texttt{f}-type~argument. + } +\NewDocumentCommand { \CodedocExplainTF } { } + { + \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}% + \__codedoc_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~ + whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~ + argument~specifiers~expect~different~ + \enquote{true}/\enquote{false}~branches. + } \keys_define:nn { l3doc/cmd } { index .tl_set:N = \l__codedoc_cmd_index_tl , + module .tl_set:N = \l__codedoc_cmd_module_tl , + no-index .bool_set:N = \l__codedoc_cmd_noindex_bool , replace .bool_set:N = \l__codedoc_cmd_replace_bool , } -\cs_new:Npn \__codedoc_cmd:nn #1#2 - { - \texorpdfstring - { - \CodedocUnexpandedTokens - { \CodedocUseCs { __codedoc_cmd_aux:nn } {#1} {#2} } - } - {#2} - } -\cs_generate_variant:Nn \__codedoc_cmd:nn { no } -\cs_new_protected:Npn \__codedoc_cmd_aux:nn #1#2 +\cs_new_protected:Npn \__codedoc_cmd:nn #1#2 { + \bool_set_false:N \l__codedoc_cmd_noindex_bool \bool_set_true:N \l__codedoc_cmd_replace_bool \tl_set:Nn \l__codedoc_cmd_index_tl { \q_no_value } + \tl_set:Nn \l__codedoc_cmd_module_tl { \q_no_value } \keys_set:nn { l3doc/cmd } {#1} - \tl_set:No \l__codedoc_cmd_tl { \token_to_str:N #2 } + \tl_set:Nn \l__codedoc_cmd_tl {#2} \bool_if:NT \l__codedoc_cmd_replace_bool { \tl_set_rescan:Nnn \l__codedoc_tmpb_tl { } { _ } @@ -435,9 +624,7 @@ \mode_if_math:T { \mbox } { \verbatim@font - \int_compare:nNnF - { \tl_count:N \l__codedoc_cmd_tl } - < { \tl_count:f { \tl_to_str:N \l__codedoc_cmd_tl } } + \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl { \tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl } \tl_replace_all:Non \l__codedoc_cmd_tl @@ -446,25 +633,26 @@ \tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp } \l__codedoc_cmd_tl } - \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl } - \quark_if_no_value:NF \l__codedoc_cmd_index_tl - { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_cmd_index_tl } - \__codedoc_special_index_module:ooon - { \l__codedoc_index_key_tl } - { \l__codedoc_index_macro_tl } - { \l__codedoc_index_module_tl } - { } - } -\cs_new:Npn \__codedoc_meta:n #1 - { - \texorpdfstring + \bool_if:NF \l__codedoc_cmd_noindex_bool { - \CodedocUnexpandedTokens - { \CodedocUseCs { __codedoc_meta_aux:n } {#1} } + \quark_if_no_value:NF \l__codedoc_cmd_index_tl + { \tl_set_eq:NN \l__codedoc_cmd_tl \l__codedoc_cmd_index_tl } + \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl } + \quark_if_no_value:NF \l__codedoc_cmd_module_tl + { + \tl_set:Nx \l__codedoc_index_module_tl + { \tl_to_str:N \l__codedoc_cmd_module_tl } + } + \__codedoc_special_index_module:ooonN + { \l__codedoc_index_key_tl } + { \l__codedoc_index_macro_tl } + { \l__codedoc_index_module_tl } + { } + \l__codedoc_index_internal_bool } - { < #1 > } } -\cs_new_protected:Npn \__codedoc_meta_aux:n #1 +\cs_generate_variant:Nn \__codedoc_cmd:nn { no } +\cs_new_protected:Npn \__codedoc_meta:n #1 { \tl_set:Nn \l__codedoc_tmpa_tl {#1} \tl_map_inline:nn @@ -494,22 +682,161 @@ } \ensuremath \rangle } +\cs_new_protected:Npn \__codedoc_typeset_exp: + { \hyperlink{expstar} {$\star$} } +\cs_new_protected:Npn \__codedoc_typeset_rexp: + { \hyperlink{rexpstar} {\ding{73}} } % hollow star +\cs_new_protected:Npn \__codedoc_typeset_TF: + { + \hyperlink{explTF} + { + \color{black} + \itshape TF + \makebox[0pt][r] + { + \color{red} + \underline { \phantom{\itshape TF} \kern-0.1em } + } + } + } +\cs_new_protected:Npn \__codedoc_typeset_aux:n #1 + { + { \color[gray]{0.7} #1 } + } +\cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2 + { + \tl_set:Nx #2 { \tl_to_str:n {#1} } + \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / } + \tl_remove_all:Nx #2 { \iow_char:N \\ } + \tl_put_left:Nn #2 { doc/function// } + } +\cs_generate_variant:Nn \__codedoc_get_hyper_target:nN { o , x } +\cs_new_protected:Npn \__codedoc_names_get_seq:nN #1#2 + { + \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} } + \bool_if:NTF \l__codedoc_names_verb_bool + { + \seq_clear:N #2 + \seq_put_right:NV #2 \l__codedoc_tmpa_tl + } + { + \tl_remove_all:Nx \l__codedoc_tmpa_tl + { \iow_char:N \^^M \iow_char:N \% } + \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } } + \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I } + \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M } + \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl + \exp_args:NNx \seq_set_from_clist:Nn #2 + { \tl_to_str:N \l__codedoc_tmpa_tl } + } + } +\cs_new_protected:Npn \__codedoc_names_parse: + { + \tl_clear:N \l__codedoc_names_block_tl + \seq_map_function:NN + \l__codedoc_names_seq + \__codedoc_names_parse_one:n + } +\cs_new_protected:Npn \__codedoc_names_parse_one:n #1 + { + \__codedoc_split_function_do:nn {#1} + { \__codedoc_names_parse_one_aux:nnNn } + {#1} + } +\cs_new_protected:Npn \__codedoc_names_parse_one_aux:nnNn #1#2#3#4 + { + \bool_if:NTF #3 + { + \tl_if_head_eq_charcode:nNTF {#2} : + { \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: } } + { + \exp_args:Nx \__codedoc_names_parse_aux:nnn + { \__codedoc_base_form_aux:nnN {#1} {#2} #3 } + {#1} {#2} + } + } + { + \bool_if:NT \l__codedoc_macro_TF_bool + { \msg_error:nnx { l3doc } { no-signature-TF } {#4} } + \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: } + } + } +\cs_new_protected:Npn \__codedoc_names_parse_aux:nnn #1 + { \exp_args:Nc \__codedoc_names_parse_aux:Nnn { \__codedoc_lseq_name:n {#1} } } +\cs_new_protected:Npn \__codedoc_names_parse_aux:Nnn #1#2#3 + { + \tl_if_in:NnF \l__codedoc_names_block_tl {#1} + { + \tl_put_right:Nn \l__codedoc_names_block_tl {#1} + \seq_clear_new:N #1 + \seq_put_right:Nn #1 {#2} + } + \seq_put_right:Nn #1 {#3} + } +\cs_new_protected:Npn \__codedoc_names_typeset: + { + \tl_map_function:NN \l__codedoc_names_block_tl + \__codedoc_names_typeset_auxi:n + } +\cs_new_protected:Npn \__codedoc_names_typeset_auxi:n #1 + { + \seq_pop:NN #1 \l__codedoc_tmpa_tl + \tl_gset_eq:NN \g__codedoc_base_name_tl \l__codedoc_tmpa_tl + \tl_greplace_all:Nno \g__codedoc_base_name_tl + { ~ } { \c_catcode_other_space_tl } + \seq_get:NN #1 \l__codedoc_tmpa_tl + \str_if_eq_x:nnTF { \l__codedoc_tmpa_tl } { \scan_stop: } + { + \seq_gclear:N \g__codedoc_variants_seq + \__codedoc_names_typeset_auxii:x { \g__codedoc_base_name_tl } + } + { + \seq_gset_eq:NN \g__codedoc_variants_seq #1 + \seq_gpop:NN \g__codedoc_variants_seq \l__codedoc_tmpb_tl + \__codedoc_names_typeset_auxii:x + { \g__codedoc_base_name_tl : \l__codedoc_tmpb_tl } + } + } +\cs_new_protected:Npn \__codedoc_names_typeset_auxii:n #1 + { + \bool_if:NT \l__codedoc_macro_pTF_bool + { + \__codedoc_names_typeset_block:xN + { \__codedoc_predicate_from_base:n {#1} } + \c_false_bool + } + \bool_if:NT \l__codedoc_macro_noTF_bool + { \__codedoc_names_typeset_block:nN {#1} \c_false_bool } + \__codedoc_names_typeset_block:nN {#1} \l__codedoc_macro_TF_bool + } +\cs_generate_variant:Nn \__codedoc_names_typeset_auxii:n { x } +\cs_new_protected:Npn \__codedoc_names_typeset_block:nN + { + \int_compare:nNnTF \l__codedoc_nested_macro_int = 0 + { \__codedoc_typeset_function_block:nN } + { \__codedoc_macro_typeset_block:nN } + } +\cs_generate_variant:Nn \__codedoc_names_typeset_block:nN { x } \keys_define:nn { l3doc/function } { + TF .value_forbidden:n = true , TF .code:n = { \bool_set_true:N \l__codedoc_macro_TF_bool } , + EXP .value_forbidden:n = true , EXP .code:n = { \bool_set_true:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool } , + rEXP .value_forbidden:n = true , rEXP .code:n = { \bool_set_false:N \l__codedoc_macro_EXP_bool \bool_set_true:N \l__codedoc_macro_rEXP_bool } , + pTF .value_forbidden:n = true , pTF .code:n = { \bool_set_true:N \l__codedoc_macro_pTF_bool @@ -517,33 +844,57 @@ \bool_set_true:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool } , + noTF .value_forbidden:n = true , + noTF .code:n = + { + \bool_set_true:N \l__codedoc_macro_noTF_bool + \bool_set_true:N \l__codedoc_macro_TF_bool + } , added .tl_set:N = \l__codedoc_date_added_tl , updated .tl_set:N = \l__codedoc_date_updated_tl , + deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } , tested .code:n = { } , - no-label .bool_set:N = \l__codedoc_no_label_bool , + label .code:n = + { + \clist_set:Nn \l__codedoc_function_label_clist {#1} + \bool_set_true:N \l__codedoc_no_label_bool + } , + verb .value_forbidden:n = true , + verb .bool_set:N = \l__codedoc_names_verb_bool , + module .tl_set:N = \l__codedoc_override_module_tl , + } +\cs_new_protected:Npn \__codedoc_deprecated_on:n #1 + { + \__codedoc_date_compare:nNnT {#1} < { \tex_year:D / \tex_month:D / \tex_day:D } + { + \msg_error:nnxx { l3doc } { deprecated-function } + { \tl_to_str:N \l__codedoc_macro_argument_tl } {#1} + } + \bool_set_true:N \l__codedoc_macro_internal_bool } \cs_new_protected:Npn \__codedoc_function:nnw #1#2 { \__codedoc_function_typeset_start: \__codedoc_function_init: + \tl_set:Nn \l__codedoc_macro_argument_tl {#2} \keys_set:nn { l3doc/function } {#1} - \__codedoc_verb_get_seq:nN {#2} \l__codedoc_function_input_seq - \__codedoc_function_parse: + \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq + \__codedoc_names_parse: \__codedoc_function_typeset: + \__codedoc_function_reset: \__codedoc_function_descr_start:w } -\cs_new_protected_nopar:Npn \__codedoc_function_end: +\cs_new_protected:Npn \__codedoc_function_end: { \__codedoc_function_descr_stop: \__codedoc_function_assemble: \__codedoc_function_typeset_stop: } -\cs_new_protected_nopar:Npn \__codedoc_function_typeset_start: +\cs_new_protected:Npn \__codedoc_function_typeset_start: { \par \bigskip \noindent - \phantomsection } -\cs_new_protected_nopar:Npn \__codedoc_function_typeset_stop: +\cs_new_protected:Npn \__codedoc_function_typeset_stop: { \par \allowbreak @@ -555,70 +906,41 @@ \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 + \coffin_clear:N \l__codedoc_functions_coffin \bool_set_false:N \l__codedoc_macro_TF_bool \bool_set_false:N \l__codedoc_macro_pTF_bool + \bool_set_false:N \l__codedoc_macro_noTF_bool \bool_set_false:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool \bool_set_false:N \l__codedoc_no_label_bool + \bool_set_false:N \l__codedoc_names_verb_bool + \clist_clear:N \l__codedoc_function_label_clist + \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value } \char_set_catcode_active:N \< - \cs_set_protected_nopar:Npn < ##1 > { \meta {##1} } + \cs_set_protected:Npn < ##1 > { \meta {##1} } } \group_end: -\cs_new_protected_nopar:Npn \__codedoc_function_parse: +\cs_new_protected:Npn \__codedoc_function_reset: { - \seq_map_function:NN - \l__codedoc_function_input_seq - \__codedoc_function_parse_one:n + \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value } } -\cs_new_protected:Npn \__codedoc_function_parse_one:n #1 - { - \tl_if_head_eq_charcode:nNTF {#1} \c__codedoc_backslash_token - { - \tl_gset_eq:NN \g__codedoc_function_name_prefix_tl \c__codedoc_backslash_tl - \exp_args:No \tl_if_head_eq_charcode:nNTF { \use_none:n #1 } : - { - \prop_put:Nxn \l__codedoc_functions_block_prop - { \use_none:n #1 } { \scan_stop: } - } - { - \exp_args:Nc \__cs_split_function:NN { \use_none:n #1 } - \__codedoc_function_parse_cs_aux:nnN - } - } - { - \tl_gclear:N \g__codedoc_function_name_prefix_tl - \prop_put:Nnn \l__codedoc_functions_block_prop {#1} { \scan_stop: } - } - } -\cs_new_protected:Npn \__codedoc_function_parse_cs_aux:nnN #1#2#3 - { - \prop_get:NnNF - \l__codedoc_functions_block_prop {#1} \l__codedoc_tmpb_tl - { \tl_clear:N \l__codedoc_tmpb_tl } - \prop_put:Nnx \l__codedoc_functions_block_prop {#1} - { - \l__codedoc_tmpb_tl , - \bool_if:NTF #3 { {#2} } { \scan_stop: } - } - } -\cs_new_protected_nopar:Npn \__codedoc_function_typeset: +\cs_new_protected:Npn \__codedoc_function_typeset: { \dim_zero:N \l__codedoc_trial_width_dim - \hcoffin_set:Nn \l__codedoc_names_coffin { \__codedoc_typeset_names: } + \hcoffin_set:Nn \l__codedoc_functions_coffin { \__codedoc_typeset_functions: } \dim_set:Nn \l__codedoc_trial_width_dim - { \box_wd:N \l__codedoc_names_coffin } + { \box_wd:N \l__codedoc_functions_coffin } \bool_set:Nn \l__codedoc_long_name_bool { \dim_compare_p:nNn \l__codedoc_trial_width_dim > \marginparwidth } } -\cs_new_protected_nopar:Npn \__codedoc_function_descr_start:w +\cs_new_protected:Npn \__codedoc_function_descr_start:w { \vcoffin_set:Nnw \l__codedoc_descr_coffin { \textwidth } \noindent \ignorespaces } -\cs_new_protected_nopar:Npn \__codedoc_function_descr_stop: +\cs_new_protected:Npn \__codedoc_function_descr_stop: { \vcoffin_set_end: } -\cs_new_protected_nopar:Npn \__codedoc_function_assemble: +\cs_new_protected:Npn \__codedoc_function_assemble: { \hcoffin_set:Nn \l__codedoc_syntax_coffin { \box_use:N \g__codedoc_syntax_box } @@ -630,7 +952,7 @@ {0pt} {0pt} \coffin_join:NnnNnnnn \l__codedoc_output_coffin {l} {t} - \l__codedoc_names_coffin {r} {t} + \l__codedoc_functions_coffin {r} {t} {-\marginparsep} {0pt} \coffin_join:NnnNnnnn \l__codedoc_output_coffin {l} {b} @@ -651,144 +973,95 @@ {0pt} {-\medskipamount} \coffin_join:NnnNnnnn \l__codedoc_output_coffin {l} {t} - \l__codedoc_names_coffin {r} {t} + \l__codedoc_functions_coffin {r} {t} {-\marginparsep} {0pt} \coffin_typeset:Nnnnn \l__codedoc_output_coffin {\l__codedoc_syntax_coffin-l} {\l__codedoc_syntax_coffin-T} {0pt} {0pt} } } -\cs_new_protected_nopar:Npn \__codedoc_typeset_names: +\cs_new_protected:Npn \__codedoc_typeset_functions: { \small\ttfamily - \begin{tabular} { @{} l @{} r @{} } + \HD@savedestfalse + \HD@target + \Hy@MakeCurrentHref { HD. \int_use:N \c@HD@hypercount } + \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} } \toprule - \__codedoc_typeset_functions: + \__codedoc_function_extra_labels: + \__codedoc_names_typeset: \__codedoc_typeset_dates: \bottomrule \end{tabular} \normalfont\normalsize } -\cs_new_protected_nopar:Npn \__codedoc_typeset_functions: +\cs_new_protected:Npn \__codedoc_typeset_function_block:nN #1#2 { - \prop_map_function:NN \l__codedoc_functions_block_prop - \__codedoc_typeset_functions_auxi:nn - } -\cs_new_protected:Npn \__codedoc_typeset_functions_auxi:nn #1#2 - { - \tl_gset:Nn \g__codedoc_base_name_tl {#1} - \prop_clear:N \l__codedoc_variants_prop - \clist_map_inline:nn {#2} - { - \tl_set:Nx \l__codedoc_tmpa_tl - { \__codedoc_signature_base_form:n {##1} } - \prop_get:NoNTF \l__codedoc_variants_prop - \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl - { \tl_put_right:Nn \l__codedoc_tmpb_tl { , {##1} } } - { \tl_set:Nn \l__codedoc_tmpb_tl { {##1} } } - \prop_put:Noo \l__codedoc_variants_prop - \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl - } - \prop_map_function:NN \l__codedoc_variants_prop - \__codedoc_typeset_functions_auxii:nn - } -\cs_new_protected:Npn \__codedoc_typeset_functions_auxii:nn #1#2 - { - \clist_gset:Nn \g__codedoc_variants_clist {#2} - \clist_gpop:NN \g__codedoc_variants_clist \l__codedoc_tmpb_tl - \exp_args:Nc \__codedoc_typeset_functions_auxiii:N - { - \g__codedoc_base_name_tl - \exp_last_unbraced:Nf \token_if_eq_meaning:NNF - { \tl_head:f { \l__codedoc_tmpb_tl ? } } - \scan_stop: - { : \l__codedoc_tmpb_tl } - } - } -\cs_new_protected:Npn \__codedoc_typeset_functions_auxiii:N #1 - { - \bool_if:NT \l__codedoc_macro_pTF_bool - { - \tl_set:Nx \l__codedoc_pTF_name_tl - { \__codedoc_predicate_from_base:N #1 } - \__codedoc_function_index:x { \l__codedoc_pTF_name_tl } - } \__codedoc_function_index:x - { - \cs_to_str:N #1 - \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} } - } - \bool_if:NT \l__codedoc_macro_pTF_bool - { - \exp_args:Nc \__codedoc_typeset_function_block:NN - { \l__codedoc_pTF_name_tl } \c_false_bool - } - \__codedoc_typeset_function_block:NN #1 \l__codedoc_macro_TF_bool - } -\cs_new_protected:Npn \__codedoc_function_index:x #1 - { - \tl_set:Nx \l__codedoc_tmpa_tl - { \g__codedoc_function_name_prefix_tl #1 } - \seq_gput_right:No \g_doc_functions_seq { \l__codedoc_tmpa_tl } - \__codedoc_special_index:on { \l__codedoc_tmpa_tl } { usage } - } -\cs_new_protected:Npn \__codedoc_typeset_function_block:NN #1#2 - { - \__codedoc_function_label:x - { \g__codedoc_function_name_prefix_tl \cs_to_str:N #1 } - \g__codedoc_function_name_prefix_tl \cs_to_str:N #1 + { #1 \bool_if:NT #2 { \tl_to_str:n {TF} } } + \__codedoc_function_label:xN {#1} #2 + #1 \bool_if:NT #2 { \__codedoc_typeset_TF: } \__codedoc_typeset_expandability: - \clist_if_empty:NF \g__codedoc_variants_clist - { \__codedoc_typeset_variant_list:NN #1#2 } + \seq_if_empty:NF \g__codedoc_variants_seq + { \__codedoc_typeset_variant_list:nN {#1} #2 } \\ } -\cs_new_protected_nopar:Npn \__codedoc_typeset_expandability: +\cs_generate_variant:Nn \__codedoc_typeset_function_block:nN { x } +\cs_new_protected:Npn \__codedoc_function_index:n #1 + { + \seq_gput_right:Nn \g_doc_functions_seq {#1} + \__codedoc_special_index:nn {#1} { usage } + } +\cs_generate_variant:Nn \__codedoc_function_index:n { x } +\cs_new_protected:Npn \__codedoc_typeset_expandability: { & - \bool_if:NT \l__codedoc_macro_EXP_bool - { - \hspace{\tabcolsep} - \hyperlink{expstar} {$\star$} - } - \bool_if:NT \l__codedoc_macro_rEXP_bool - { - \hspace{\tabcolsep} - \hyperlink{rexpstar} {\ding{73}} % hollow star - } + \bool_if:NT \l__codedoc_macro_EXP_bool { \__codedoc_typeset_exp: } + \bool_if:NT \l__codedoc_macro_rEXP_bool { \__codedoc_typeset_rexp: } } -\cs_new_protected:Npn \__codedoc_typeset_variant_list:NN #1#2 +\cs_new_protected:Npn \__codedoc_typeset_variant_list:nN #1#2 { \\ - \__codedoc_typeset_aux:n - { - \g__codedoc_function_name_prefix_tl - \__cs_get_function_name:N #1 - } + \__codedoc_typeset_aux:n { \__codedoc_get_function_name:n {#1} } : - \int_compare:nTF { \clist_count:N \g__codedoc_variants_clist == 1 } - { \clist_use:Nn \g__codedoc_variants_clist { } } + \int_compare:nTF { \seq_count:N \g__codedoc_variants_seq == 1 } + { \seq_use:Nn \g__codedoc_variants_seq { } } { \textrm( - \clist_use:Nn \g__codedoc_variants_clist { \textrm| } + \seq_use:Nn \g__codedoc_variants_seq { \textrm| } \textrm) } \bool_if:NT #2 { \__codedoc_typeset_TF: } \__codedoc_typeset_expandability: } -\cs_new_protected:Npn \__codedoc_function_label:n #1 +\cs_new_protected:Npn \__codedoc_function_extra_labels: + { + \bool_if:NT \l__codedoc_no_label_bool + { + \clist_map_inline:Nn \l__codedoc_function_label_clist + { + \__codedoc_get_hyper_target:oN { \token_to_str:N ##1 } + \l__codedoc_tmpa_tl + \exp_args:No \label { \l__codedoc_tmpa_tl } + } + } + } +\cs_new_protected:Npn \__codedoc_function_label:nN #1#2 { - % \bool_if:NT \g__codedoc_typeset_implementation_bool - % { \bool_if:NF \l__codedoc_no_label_bool { - \__codedoc_get_hyper_target:nN {#1} \l__codedoc_tmpa_tl + \__codedoc_get_hyper_target:xN + { + \exp_not:n {#1} + \bool_if:NT #2 { \tl_to_str:n {TF} } + } + \l__codedoc_tmpa_tl \exp_args:No \label { \l__codedoc_tmpa_tl } } - % } } -\cs_generate_variant:Nn \__codedoc_function_label:n { x } -\cs_new_nopar:Npn \__codedoc_typeset_dates: +\cs_generate_variant:Nn \__codedoc_function_label:nN { x } +\cs_new:Npn \__codedoc_typeset_dates: { \bool_if:nF { @@ -822,7 +1095,7 @@ \arrayrulecolor{white} \begin{tabular} { @{} l @{} } \toprule - \begin{minipage}{\l__codedoc_syntax_dim} + \begin{minipage}[t]{\l__codedoc_syntax_dim} \raggedright \obeyspaces \obeylines @@ -836,16 +1109,22 @@ } \keys_define:nn { l3doc/macro } { + aux .value_forbidden:n = true , aux .code:n = { \bool_set_true:N \l__codedoc_macro_aux_bool } , + internal .value_forbidden:n = true , internal .code:n = { \bool_set_true:N \l__codedoc_macro_internal_bool } , + int .value_forbidden:n = true , int .code:n = { \bool_set_true:N \l__codedoc_macro_internal_bool } , + var .value_forbidden:n = true , var .code:n = { \bool_set_true:N \l__codedoc_macro_var_bool } , + TF .value_forbidden:n = true , TF .code:n = { \bool_set_true:N \l__codedoc_macro_TF_bool } , + pTF .value_forbidden:n = true , pTF .code:n = { \bool_set_true:N \l__codedoc_macro_TF_bool @@ -853,11 +1132,19 @@ \bool_set_true:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool } , + noTF .value_forbidden:n = true , + noTF .code:n = + { + \bool_set_true:N \l__codedoc_macro_TF_bool + \bool_set_true:N \l__codedoc_macro_noTF_bool + } , + EXP .value_forbidden:n = true , EXP .code:n = { \bool_set_true:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool } , + rEXP .value_forbidden:n = true , rEXP .code:n = { \bool_set_false:N \l__codedoc_macro_EXP_bool @@ -869,51 +1156,88 @@ } , added .code:n = {} , % TODO updated .code:n = {} , % TODO + deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } , + verb .bool_set:N = \l__codedoc_names_verb_bool , + module .tl_set:N = \l__codedoc_override_module_tl , + documented-as .tl_set:N = \l__codedoc_macro_documented_tl , } \cs_new_protected:Npn \__codedoc_macro:nnw #1#2 { \__codedoc_macro_init: + \tl_set:Nn \l__codedoc_macro_argument_tl {#2} \keys_set:nn { l3doc/macro } {#1} - \__codedoc_verb_get_seq:nN {#2} \l__codedoc_macro_input_seq - \__codedoc_macro_map:N \__codedoc_macro_single:n - \__codedoc_macro_typeset: + \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq + \__codedoc_names_parse: + \__codedoc_macro_adjust_internal: + \__codedoc_macro_save_names: + \__codedoc_names_typeset: + \__codedoc_macro_dump: + \__codedoc_macro_reset: } -\cs_new_protected_nopar:Npn \__codedoc_macro_init: +\cs_new_protected:Npn \__codedoc_macro_init: { \int_incr:N \l__codedoc_nested_macro_int \bool_set_false:N \l__codedoc_macro_aux_bool \bool_set_false:N \l__codedoc_macro_internal_bool \bool_set_false:N \l__codedoc_macro_TF_bool \bool_set_false:N \l__codedoc_macro_pTF_bool + \bool_set_false:N \l__codedoc_macro_noTF_bool \bool_set_false:N \l__codedoc_macro_EXP_bool \bool_set_false:N \l__codedoc_macro_rEXP_bool \bool_set_false:N \l__codedoc_macro_var_bool \bool_set_false:N \l__codedoc_macro_tested_bool + \bool_set_false:N \l__codedoc_names_verb_bool + \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value } + \tl_clear:N \l__codedoc_macro_documented_tl \cs_set_eq:NN \testfile \__codedoc_print_testfile:n \box_clear:N \l__codedoc_macro_index_box \vbox_set:Nn \l__codedoc_macro_box { - \hbox:n { \strut } + \hbox:n + { + \strut + \int_compare:nNnT \l__codedoc_macro_int = \c_zero + { \HD@target } + } \vskip \int_eval:n { \l__codedoc_macro_int - 1 } \baselineskip } } -\cs_new_protected:Npn \__codedoc_macro_map:N #1 +\cs_new_protected:Npn \__codedoc_macro_reset: { - \bool_if:NT \l__codedoc_macro_pTF_bool + \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value } + } +\cs_new_protected:Npn \__codedoc_macro_adjust_internal: + { + \bool_if:NF \l__codedoc_macro_internal_bool { - \bool_set_false:N \l__codedoc_macro_TF_bool - \seq_map_inline:Nn \l__codedoc_macro_input_seq + \bool_if:NF \l__codedoc_macro_aux_bool { - \tl_set:Nn \l__codedoc_tmpa_tl {##1} - \tl_replace_once:Noo \l__codedoc_tmpa_tl - { \tl_to_str:n { : } } { \tl_to_str:n { _p: } } - \exp_args:No #1 \l__codedoc_tmpa_tl + \bool_set_true:N \l__codedoc_macro_internal_bool + \seq_map_inline:Nn \l__codedoc_names_seq + { + \tl_if_in:noF {##1} { \tl_to_str:n { __ } } + { \bool_set_false:N \l__codedoc_macro_internal_bool } + } } - \bool_set_true:N \l__codedoc_macro_TF_bool } - \seq_map_function:NN \l__codedoc_macro_input_seq #1 } -\cs_new_protected_nopar:Npn \__codedoc_macro_typeset: +\cs_new_protected:Npn \__codedoc_macro_save_names: + { + \tl_map_inline:Nn \l__codedoc_names_block_tl + { + \seq_set_eq:NN \l__codedoc_tmpa_seq ##1 + \seq_pop:NN \l__codedoc_tmpa_seq \l__codedoc_tmpa_tl + \seq_get:NN \l__codedoc_tmpa_seq \l__codedoc_tmpb_tl + \seq_gput_right:Nx \g__codedoc_nested_names_seq + { + \l__codedoc_tmpa_tl + \str_if_eq_x:nnF { \l__codedoc_tmpb_tl } { \scan_stop: } + { : \l__codedoc_tmpb_tl } + \bool_if:NT \l__codedoc_macro_TF_bool { TF } + } + } + } +\cs_new_protected:Npn \__codedoc_macro_dump: { \topsep\MacroTopsep \trivlist @@ -931,56 +1255,76 @@ } \item [ ] } -\cs_new_protected:Npn \__codedoc_macro_single:n #1 +\cs_new_protected:Npn \__codedoc_macro_typeset_block:nN #1#2 { - \tl_set:Nn \saved@macroname {#1} - \__codedoc_macro_typeset_one:n {#1} - \exp_args:Nx \__codedoc_macro_index:n + \__codedoc_macro_single:nNN {#1} \c_true_bool #2 + \seq_if_empty:NF \g__codedoc_variants_seq { - #1 - \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n { TF } } + \__codedoc_macro_typeset_variant_list:xN + { \__codedoc_get_function_name:n {#1} } #2 } } -\cs_new_protected:Npn \__codedoc_macro_index:n #1 +\cs_generate_variant:Nn \__codedoc_macro_typeset_block:nN { x } +\cs_new_protected:Npn \__codedoc_macro_typeset_variant_list:nN #1#2 + { + \seq_map_inline:Nn \g__codedoc_variants_seq + { \__codedoc_macro_single:nNN { #1 : ##1 } \c_false_bool #2 } + } +\cs_generate_variant:Nn \__codedoc_macro_typeset_variant_list:nN { x } +\cs_new_protected:Npn \__codedoc_macro_single:nNN #1#2#3 { - \bool_if:NF \l__codedoc_macro_aux_bool - { \seq_gput_right:Nn \g_doc_macros_seq {#1} } - \hbox_set:Nw \l__codedoc_macro_index_box - % This box only contains targets... it seems inefficient. - \hbox_unpack_clear:N \l__codedoc_macro_index_box - \int_gincr:N \c@CodelineNo - \__codedoc_special_index:nn {#1} { main } - \DoNotIndex {#1} - \int_gdecr:N \c@CodelineNo - \exp_args:NNNo \hbox_set_end: - \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl } + \tl_set:Nn \saved@macroname {#1} + \__codedoc_macro_typeset_one:nN {#1} #3 + \bool_if:NT #3 { \DoNotIndex {#1} } + \exp_args:Nx \__codedoc_macro_index:nN + { #1 \bool_if:NT #3 { \tl_to_str:n { TF } } } + #2 + } +\cs_new_protected:Npn \__codedoc_macro_index:nN #1#2 + { + \DoNotIndex {#1} + \bool_if:NT #2 + { + \bool_if:NF \l__codedoc_macro_aux_bool + { \seq_gput_right:Nn \g_doc_macros_seq {#1} } + \hbox_set:Nw \l__codedoc_macro_index_box + \hbox_unpack_clear:N \l__codedoc_macro_index_box + \int_gincr:N \c@CodelineNo + \__codedoc_special_index:nn {#1} { main } + \int_gdecr:N \c@CodelineNo + \exp_args:NNNo \hbox_set_end: + \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl } + } } -\cs_new_protected:Npn \__codedoc_macro_typeset_one:n #1 +\cs_new_protected:Npn \__codedoc_macro_typeset_one:nN #1#2 { \vbox_set:Nn \l__codedoc_macro_box { \vbox_unpack_clear:N \l__codedoc_macro_box - \hbox { \llap { \__codedoc_print_macroname:n {#1} \ } } + \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \ } } } \int_incr:N \l__codedoc_macro_int } -\cs_new_protected:Npn \__codedoc_print_macroname:n #1 +\cs_new_protected:Npn \__codedoc_print_macroname:nN #1#2 { \strut - \HD@target - - % TODO: INEFFICIENT(!) - \exp_args:NNx \seq_if_in:NnTF \g_doc_functions_seq - { #1 \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} } } + \__codedoc_get_hyper_target:xN { - \__codedoc_get_hyper_target:nN {#1} \l__codedoc_tmpa_tl - \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ] + \exp_not:n {#1} + \bool_if:NT #2 { \tl_to_str:n {TF} } } + \l__codedoc_tmpa_tl + \cs_if_exist:cTF { r@ \l__codedoc_tmpa_tl } + { \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ] } { \use:n } { - \int_compare:nTF { \tl_count:n {#1} <= 28 } + \int_compare:nTF { \str_count:n {#1} <= 28 } { \MacroFont } { \MacroLongFont } - \__codedoc_macroname_prefix:n {#1} \__codedoc_macroname_suffix: + \tl_set:Nn \l__codedoc_tmpa_tl {#1} + \tl_replace_all:Nno \l__codedoc_tmpa_tl + { ~ } { \c_catcode_other_space_tl } + \__codedoc_macroname_prefix:o \l__codedoc_tmpa_tl + \__codedoc_macroname_suffix:N #2 } } \cs_new_protected:Npn \__codedoc_macroname_prefix:n #1 @@ -988,8 +1332,9 @@ \bool_if:NTF \l__codedoc_macro_aux_bool { \__codedoc_typeset_aux:n {#1} } {#1} } -\cs_new_protected_nopar:Npn \__codedoc_macroname_suffix: - { \bool_if:NTF \l__codedoc_macro_TF_bool { \__codedoc_typeset_TF: } { } } +\cs_generate_variant:Nn \__codedoc_macroname_prefix:n { o } +\cs_new_protected:Npn \__codedoc_macroname_suffix:N #1 + { \bool_if:NTF #1 { \__codedoc_typeset_TF: } { } } \providecommand \MacroLongFont { \fontfamily{lmtt}\fontseries{lc}\small @@ -1033,32 +1378,30 @@ { \__codedoc_test_missing:n {#1} } \cs_new_protected:Npn \__codedoc_test_missing:n #1 { - \tl_set:Nx \l__codedoc_tmpb_tl - { \seq_use:Nn \l__codedoc_macro_input_seq { , } } - \prop_if_in:NVTF \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl - { - \prop_get:NVN \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl - \l__codedoc_tmpa_tl - } - { \tl_clear:N \l__codedoc_tmpa_tl } - \clist_set:Nx \l__codedoc_tmpa_clist { \l__codedoc_tmpa_tl , #1 } - \prop_gput:NVV \g__codedoc_missing_tests_prop \l__codedoc_tmpb_tl - \l__codedoc_tmpa_clist + \__codedoc_test_missing_aux:Nxn + \g__codedoc_missing_tests_prop + { \seq_use:Nn \l__codedoc_names_seq { , } } + { { \g_file_current_name_tl \iow_char:N \ (#1) } } + } +\cs_new_protected:Npn \__codedoc_test_missing_aux:Nnn #1#2#3 + { + \prop_get:NnNTF #1 {#2} \l__codedoc_tmpa_tl + { \tl_put_right:Nn \l__codedoc_tmpa_tl { , #3 } } + { \tl_set:Nn \l__codedoc_tmpa_tl {#3} } + \prop_put:Nno #1 {#2} \l__codedoc_tmpa_tl } +\cs_generate_variant:Nn \__codedoc_test_missing_aux:Nnn { Nx } \cs_new_protected:Npn \__codedoc_macro_end: { \endtrivlist \__codedoc_macro_end_check_tested: \int_compare:nNnT \l__codedoc_nested_macro_int = 1 { - \__codedoc_macro_end_style:n - { - \__codedoc_print_end_definition: - \__codedoc_print_documented: - } + \__codedoc_macro_end_style:n { \__codedoc_print_end_definition: } + \seq_gclear:N \g__codedoc_nested_names_seq } } -\cs_new_protected_nopar:Npn \__codedoc_macro_end_check_tested: +\cs_new_protected:Npn \__codedoc_macro_end_check_tested: { \bool_if:nT { @@ -1070,7 +1413,7 @@ { \seq_gput_right:Nx \g__codedoc_not_tested_seq { - \seq_use:Nn \l__codedoc_macro_input_seq { , } + \seq_use:Nn \l__codedoc_names_seq { , } \bool_if:NTF \l__codedoc_macro_pTF_bool {~(pTF)} { \bool_if:NT \l__codedoc_macro_TF_bool {~(TF)} } } @@ -1081,36 +1424,29 @@ \nobreak \noindent { \footnotesize ( \emph{#1} ) \par } } -\cs_new_protected:Npn \__codedoc_macro_end_wrap_items:N #1 +\cs_new_protected:Npn \__codedoc_macro_end_wrap_item:n #1 { - \bool_if:NT \l__codedoc_macro_TF_bool - { \seq_set_map:NNn #1 #1 { ##1 TF } } - \seq_set_map:NNn #1 #1 - { - \exp_not:n - { - \tl_set:Nn \l__codedoc_tmpa_tl {##1} - \tl_replace_all:Non \l__codedoc_tmpa_tl - { \token_to_str:N _ } { \_ } - \texttt { \l__codedoc_tmpa_tl } - } - } + \tl_set:Nn \l__codedoc_tmpa_tl {#1} + \tl_replace_all:Non \l__codedoc_tmpa_tl + { \token_to_str:N _ } { \_ } + \texttt { \l__codedoc_tmpa_tl } } -\cs_new_protected_nopar:Npn \__codedoc_print_end_definition: +\cs_new_protected:Npn \__codedoc_print_end_definition: { - \group_begin: - \__codedoc_macro_end_wrap_items:N \l__codedoc_macro_input_seq + \seq_set_map:NNn \l__codedoc_tmpa_seq + \g__codedoc_nested_names_seq + { \exp_not:n { \__codedoc_macro_end_wrap_item:n {##1} } } End~ definition~ for~ - \int_compare:nTF { \seq_count:N \l__codedoc_macro_input_seq <= 3 } + \int_compare:nTF { \seq_count:N \l__codedoc_tmpa_seq <= 3 } { - \seq_use:Nnnn \l__codedoc_macro_input_seq + \seq_use:Nnnn \l__codedoc_tmpa_seq { \,~and~ } { \,,~ } { \,,~and~ } - \@. } - { \seq_item:Nn \l__codedoc_macro_input_seq {1}\,~and~others. } - \group_end: + { \seq_item:Nn \l__codedoc_tmpa_seq {1}\,~and~others } + \@. + \__codedoc_print_documented: } -\cs_new_protected_nopar:Npn \__codedoc_print_documented: +\cs_new_protected:Npn \__codedoc_print_documented: { \bool_if:nT { @@ -1119,45 +1455,29 @@ } { \int_set:Nn \l__codedoc_tmpa_int - { \seq_count:N \l__codedoc_macro_input_seq } + { \seq_count:N \g__codedoc_nested_names_seq } + \tl_if_empty:NTF \l__codedoc_macro_documented_tl + { + \tl_set:Nx \l__codedoc_macro_documented_tl + { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } } + } + { + \tl_set:Nf \l__codedoc_macro_documented_tl + { + \exp_after:wN \token_to_str:N + \l__codedoc_macro_documented_tl + } + } \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~} \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function} \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~} documented~on~page~ - \exp_args:Nx \__codedoc_get_hyper_target:nN - { \seq_item:Nn \l__codedoc_macro_input_seq { 1 } } + \__codedoc_get_hyper_target:oN + \l__codedoc_macro_documented_tl \l__codedoc_tmpa_tl \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } . } } -\cs_new_protected_nopar:Npn \__codedoc_typeset_TF: - { - \hyperlink{explTF} - { - \color{black} - \itshape TF - \makebox[0pt][r] - { - \color{red} - \underline { \phantom{\itshape TF} \kern-0.1em } - } - } - } -\cs_new_protected:Npn \__codedoc_typeset_aux:n #1 - { - { \color[gray]{0.7} #1 } - } -\cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2 - { - \tl_set:Nx #2 - { - \tl_to_str:n {#1} - \bool_if:NT \l__codedoc_macro_TF_bool { \tl_to_str:n {TF} } - } - \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / } - \tl_remove_all:Nx #2 { \iow_char:N \\ } - \tl_put_left:Nn #2 { doc/function// } - } \newcommand*{\DescribeOption} { \leavevmode @@ -1201,12 +1521,12 @@ \@esphack } \font \manual = manfnt \scan_stop: -\cs_gset_nopar:Npn \dbend { {\manual\char127} } +\cs_gset:Npn \dbend { {\manual\char127} } \newenvironment {danger} { \begin{trivlist}\item[]\noindent \begingroup\hangindent=2pc\hangafter=-2 - \cs_set_nopar:Npn \par{\endgraf\endgroup} + \cs_set:Npn \par{\endgraf\endgroup} \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces } { @@ -1216,7 +1536,7 @@ { \begin{trivlist}\item[]\noindent \begingroup\hangindent=3.5pc\hangafter=-2 - \cs_set_nopar:Npn \par{\endgraf\endgroup} + \cs_set:Npn \par{\endgraf\endgroup} \hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces }{ \par\end{trivlist} @@ -1314,8 +1634,8 @@ \relax\clearpage \docincludeaux \IfFileExists{#1.fdd} - { \cs_set_nopar:Npn \currentfile{#1.fdd} } - { \cs_set_nopar:Npn \currentfile{#1.dtx} } + { \cs_set:Npn \currentfile{#1.fdd} } + { \cs_set:Npn \currentfile{#1.dtx} } \int_compare:nNnTF \@auxout = \@partaux { \@latexerr{\string\include\space cannot~be~nested}\@eha } { \@docinclude #1 } @@ -1327,7 +1647,7 @@ \@tempswatrue \if@partsw \@tempswafalse - \cs_set_nopar:Npx \@tempb{#1} + \cs_set:Npx \@tempb{#1} \@for\@tempa:=\@partlist\do { \ifx\@tempa\@tempb\@tempswatrue\fi @@ -1346,7 +1666,7 @@ \part{\currentfile} { \cs_set_eq:NN \ttfamily\relax - \cs_gset_nopar:Npx \filekey + \cs_gset:Npx \filekey { \filekey, \thepart = { \ttfamily \currentfile } } } \DocInput{\currentfile} @@ -1371,14 +1691,14 @@ } } \tl_gclear:N \filesep -\cs_gset_nopar:Npn \docincludeaux +\cs_gset:Npn \docincludeaux { \tl_set:Nn \thepart { \alphalph { part } } \tl_set:Nn \filesep { \thepart - } \cs_set_eq:NN \filekey \use_none:n \tl_gput_right:Nn \index@prologue { - \cs_gset_nopar:Npn \@oddfoot + \cs_gset:Npn \@oddfoot { \parbox { \textwidth } { @@ -1389,7 +1709,7 @@ \cs_set_eq:NN \@evenfoot \@oddfoot } \cs_gset_eq:NN \docincludeaux \relax - \cs_gset_nopar:Npn \@oddfoot + \cs_gset:Npn \@oddfoot { \cs_if_exist:cTF { ver @ \currentfile } { File~\thepart :~{\ttfamily\currentfile}~ } @@ -1453,7 +1773,7 @@ \tl_new:N \l__codedoc_doc_def_tl \tl_new:N \l__codedoc_doc_undef_tl \tl_new:N \l__codedoc_undoc_def_tl -\cs_new_protected_nopar:Npn \__codedoc_show_functions_defined: +\cs_new_protected:Npn \__codedoc_show_functions_defined: { \bool_if:nT { \g__codedoc_typeset_implementation_bool && \g__codedoc_checkfunc_bool } @@ -1519,7 +1839,7 @@ \tl_clear:N #2 } } -\cs_new_protected_nopar:Npn \__codedoc_show_not_tested: +\cs_new_protected:Npn \__codedoc_show_not_tested: { \bool_if:NT \g__codedoc_checktest_bool { @@ -1606,51 +1926,67 @@ { \use:x { - \__codedoc_special_index_module:nnnn + \__codedoc_special_index_module:nnnnN { \quotechar #1 } { \quotechar \bslash \quotechar #1 } { } { } + \c_false_bool } } \cs_new_protected:Npn \__codedoc_special_index:nn #1#2 { \__codedoc_key_get:n {#1} - \__codedoc_special_index_module:ooon + \quark_if_no_value:NF \l__codedoc_override_module_tl + { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_override_module_tl } + \__codedoc_special_index_module:ooonN { \l__codedoc_index_key_tl } { \l__codedoc_index_macro_tl } { \l__codedoc_index_module_tl } {#2} + \l__codedoc_index_internal_bool } \cs_generate_variant:Nn \__codedoc_special_index:nn { o } \tl_new:N \l__codedoc_index_escaped_macro_tl -\cs_new_protected:Npn \__codedoc_special_index_module:nnnn #1#2#3#4 +\cs_new_protected:Npn \__codedoc_special_index_module:nnnnN #1#2#3#4#5 { \use:x { - \exp_not:n { \__codedoc_special_index_aux:nnnnn {#1} {#2} } - \str_case_x:nnF {#3} + \exp_not:n { \__codedoc_special_index_aux:nnnnnn {#1} {#2} } + \tl_if_empty:nTF {#3} + { { } { } { } } { - { } { { } { } } - { TeX } + \str_if_eq_x:nnTF {#3} { TeX } + { + { TeX~and~LaTeX2e } + { \string\TeX{}~and~\string\LaTeXe{} } + } { - { TeX~and~LaTeX2e~commands } - { \string\TeX{}~and~\string\LaTeXe{}~commands: } + {#3} + { \string\pkg{#3} } } + { \bool_if:NT #5 { ~internal } ~commands: } } - { { #3~commands } { \string\pkg{#3}~commands: } } } {#4} } -\cs_generate_variant:Nn \__codedoc_special_index_module:nnnn { ooo } -\cs_new_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5 +\cs_generate_variant:Nn \__codedoc_special_index_module:nnnnN { ooo } +\cs_new_protected:Npn \__codedoc_special_index_aux:nnnnnn #1#2#3#4#5#6 { - \HD@target \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2} - \index + \str_if_eq:onTF { \@currenvir } { macrocode } + { \codeline@wrindex } { - \tl_if_empty:nF { #3 #4 } - { #3 \actualchar #4 \levelchar } + \str_case:nnF {#6} + { + { main } { \codeline@wrindex } + { usage } { \index } + } + { \HD@target \index } + } + { + \tl_if_empty:nF { #3 #4 #5 } + { #3 #5 \actualchar #4 #5 \levelchar } #1 \actualchar { @@ -1658,20 +1994,13 @@ \l__codedoc_index_escaped_macro_tl } \encapchar - hdclindex{\the\c@HD@hypercount}{#5} + hdclindex{\the\c@HD@hypercount}{#6} } } -\cs_generate_variant:Nn \__codedoc_special_index_aux:nnnnn { o } \cs_new_protected:Npn \__codedoc_special_index_set:Nn #1#2 { \tl_set:Nx #1 { \tl_to_str:n {#2} } - \int_compare:nNnTF { \tl_count:n {#2} } < { \tl_count:N #1 } - { - \tl_set:Nn #1 {#2} - \tl_replace_all:Non #1 - { \c__codedoc_backslash_tl } - { \token_to_str:N \bslash \c_space_tl } - } + \__codedoc_if_almost_str:nTF {#2} { \exp_args:Nx \tl_map_inline:nn { \tl_to_str:N \verbatimchar \token_to_str:N _ } @@ -1693,65 +2022,95 @@ #1 \verbatimchar } } + { + \tl_set:Nn #1 {#2} + \tl_replace_all:Non #1 + { \c__codedoc_backslash_tl } + { \token_to_str:N \bslash \c_space_tl } + } } \cs_new_protected:Npn \__codedoc_key_get:n #1 { - \tl_set:Nn \l__codedoc_index_macro_tl {#1} - \tl_set:Nx \l__codedoc_index_key_tl { \tl_to_str:n {#1} } + \__codedoc_key_get_base:nN {#1} \l__codedoc_index_macro_tl + \tl_set:Nx \l__codedoc_index_key_tl + { \tl_to_str:N \l__codedoc_index_macro_tl } \tl_clear:N \l__codedoc_index_module_tl + \tl_if_in:NoTF \l__codedoc_index_key_tl { \tl_to_str:n { __ } } + { \bool_set_true:N \l__codedoc_index_internal_bool } + { \bool_set_false:N \l__codedoc_index_internal_bool } \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } \c__codedoc_backslash_token { \__codedoc_key_pop: } \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N : } - { \__codedoc_key_expl: } + { \__codedoc_key_func: } { \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N _ } - { \__codedoc_key_expl: } + { \__codedoc_key_var: } { \tl_if_in:NoT \l__codedoc_index_key_tl { \token_to_str:N @ } { \tl_set:Nn \l__codedoc_index_module_tl { TeX } } } } } -\cs_new_protected_nopar:Npn \__codedoc_key_pop: +\cs_new_protected:Npn \__codedoc_key_pop: { \tl_set:Nx \l__codedoc_index_key_tl { \tl_tail:N \l__codedoc_index_key_tl } } -\cs_new_protected_nopar:Npn \__codedoc_key_expl: +\cs_set:Npn \__codedoc_key_trim_module:n #1 + { + \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop + { \exp_not:n {##1} } + \tl_set:Nx \l__codedoc_index_module_tl + { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop } + } +\cs_new_protected:Npn \__codedoc_key_drop_underscores: { - \tl_if_head_eq_charcode:oNTF { \l__codedoc_index_key_tl } . + \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _ + { \__codedoc_key_pop: \__codedoc_key_drop_underscores: } + } +\cs_new_protected:Npn \__codedoc_key_func: + { + \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } . { \__codedoc_key_pop: } + \__codedoc_key_drop_underscores: + \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl + \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N : } + \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ } + } +\cs_new_protected:Npn \__codedoc_key_var: + { + \exp_args:Nx \tl_if_head_eq_charcode:nNTF + { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _ { - \exp_args:Nx \tl_if_head_eq_charcode:nNT - { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _ + \str_case:fn { \str_head:N \l__codedoc_index_key_tl } { - \tl_if_head_eq_charcode:oNTF { \l__codedoc_index_key_tl } _ - { - \__codedoc_key_pop: - \__codedoc_key_pop: - } + { q } { \tl_set:Nn \l__codedoc_index_module_tl { quark } } + { s } { \tl_set:Nn \l__codedoc_index_module_tl { quark } } + } + \__codedoc_key_pop: + \__codedoc_key_pop: + \__codedoc_key_drop_underscores: + \tl_if_empty:NT \l__codedoc_index_module_tl + { + \seq_set_split:NoV \l__codedoc_tmpa_seq + { \token_to_str:N _ } \l__codedoc_index_key_tl + \tl_set:Nx \l__codedoc_index_module_tl { - \__codedoc_key_pop: - \__codedoc_key_pop: - \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _ - { \__codedoc_key_pop: } + \int_case:nnF { \seq_count:N \l__codedoc_tmpa_seq } + { + { 0 } { } + { 1 } { int } + { 2 } { \seq_item:Nn \l__codedoc_tmpa_seq { 2 } } + } + { \seq_item:Nn \l__codedoc_tmpa_seq { 1 } } } } } - \__codedoc_key_get_module: - } -\cs_new_protected_nopar:Npn \__codedoc_key_get_module: - { - \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl - \exp_args:No \__codedoc_key_get_module_aux:n { \token_to_str:N : } - \exp_args:No \__codedoc_key_get_module_aux:n { \token_to_str:N _ } - } -\cs_new_protected:Npn \__codedoc_key_get_module_aux:n #1 - { - \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop { \exp_not:n {##1} } - \tl_set:Nx \l__codedoc_index_module_tl - { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop } + { + \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl + \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ } + } } \GlossaryPrologue { diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def index f2447ac4f51..104fd7fc231 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def @@ -46,16 +46,16 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6511 2016-05-17 20:20:23Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $ {L3 Experimental drivers} \ProvidesExplFile {l3dvidpfmx.def}{\ExplFileDate}{\ExplFileVersion} {L3 Experimental driver: dvipdfmx} \cs_new_protected:Npn \__driver_literal:n #1 { \tex_special:D { pdf:literal~ #1 } } -\cs_new_protected_nopar:Npn \__driver_scope_begin: +\cs_new_protected:Npn \__driver_scope_begin: { \__driver_literal:n { q } } -\cs_new_protected_nopar:Npn \__driver_scope_end: +\cs_new_protected:Npn \__driver_scope_end: { \__driver_literal:n { Q } } \cs_new_protected:Npn \__driver_matrix:n #1 { \__driver_literal:n { #1 \c_space_tl 0~0~cm } } @@ -67,12 +67,12 @@ { \tl_set:Nn \l__driver_current_color_tl { \current@color } } { } } -\cs_new_protected_nopar:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_ensure_current: { \tex_special:D { pdf:bcolor~\l__driver_current_color_tl } \group_insert_after:N \__driver_color_reset: } -\cs_new_protected_nopar:Npn \__driver_color_reset: +\cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { pdf:ecolor } } \cs_new_protected:Npn \__driver_box_use_clip:N #1 { @@ -129,13 +129,13 @@ } \cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } -\cs_new_protected_nopar:Npn \__driver_draw_begin: +\cs_new_protected:Npn \__driver_draw_begin: { \__driver_draw_scope_begin: } -\cs_new_protected_nopar:Npn \__driver_draw_end: +\cs_new_protected:Npn \__driver_draw_end: { \__driver_draw_scope_end: } -\cs_new_protected_nopar:Npn \__driver_draw_scope_begin: +\cs_new_protected:Npn \__driver_draw_scope_begin: { \__driver_draw_literal:n { q } } -\cs_new_protected_nopar:Npn \__driver_draw_scope_end: +\cs_new_protected:Npn \__driver_draw_scope_end: { \__driver_draw_literal:n { Q } } \cs_new_protected:Npn \__driver_draw_moveto:nn #1#2 { @@ -157,29 +157,42 @@ c } } -\bool_new:N \__driver_draw_eor_bool -\cs_new_protected_nopar:Npn \__driver_draw_closepath: +\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ + \dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ + re + } + } +\cs_new_protected:Npn \__driver_draw_evenodd_rule: + { \bool_gset_true:N \g__driver_draw_eor_bool } +\cs_new_protected:Npn \__driver_draw_nonzero_rule: + { \bool_gset_false:N \g__driver_draw_eor_bool } +\bool_new:N \g__driver_draw_eor_bool +\cs_new_protected:Npn \__driver_draw_closepath: { \__driver_draw_literal:n { h } } -\cs_new_protected_nopar:Npn \__driver_draw_stroke: +\cs_new_protected:Npn \__driver_draw_stroke: { \__driver_draw_literal:n { S } } -\cs_new_protected_nopar:Npn \__driver_draw_closestroke: +\cs_new_protected:Npn \__driver_draw_closestroke: { \__driver_draw_literal:n { s } } -\cs_new_protected_nopar:Npn \__driver_draw_fill: +\cs_new_protected:Npn \__driver_draw_fill: { \__driver_draw_literal:x - { f \bool_if:NT \__driver_draw_eor_bool * } + { f \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_fillstroke: +\cs_new_protected:Npn \__driver_draw_fillstroke: { \__driver_draw_literal:x - { B \bool_if:NT \__driver_draw_eor_bool * } + { B \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_clip: +\cs_new_protected:Npn \__driver_draw_clip: { \__driver_draw_literal:x - { W \bool_if:NT \__driver_draw_eor_bool * } + { W \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_discardpath: +\cs_new_protected:Npn \__driver_draw_discardpath: { \__driver_draw_literal:n { n } } \cs_new_protected:Npn \__driver_draw_dash:nn #1#2 { @@ -200,18 +213,34 @@ } \cs_new_protected:Npn \__driver_draw_miterlimit:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ M } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_butt: +\cs_new_protected:Npn \__driver_draw_cap_butt: { \__driver_draw_literal:n { 0 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_round: +\cs_new_protected:Npn \__driver_draw_cap_round: { \__driver_draw_literal:n { 1 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_rectangle: +\cs_new_protected:Npn \__driver_draw_cap_rectangle: { \__driver_draw_literal:n { 2 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_join_miter: +\cs_new_protected:Npn \__driver_draw_join_miter: { \__driver_draw_literal:n { 0 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_round: +\cs_new_protected:Npn \__driver_draw_join_round: { \__driver_draw_literal:n { 1 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_bevel: +\cs_new_protected:Npn \__driver_draw_join_bevel: { \__driver_draw_literal:n { 2 ~ j } } +\cs_new_protected:Npn \__driver_draw_color_cmyk:nnnn #1#2#3#4 + { + \use:x + { + \__driver_draw_color_cmyk_aux:nnnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + { \fp_eval:n {#4} } + } + } +\cs_new_protected:Npn \__driver_draw_color_cmyk_aux:nnnn #1#2#3#4 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } + } \cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn #1#2#3#4 { \__driver_draw_literal:x @@ -230,10 +259,34 @@ K } } +\cs_new_protected:Npn \__driver_draw_color_gray:n #1 + { + \use:x + { \__driver_draw_color_gray_aux:n { \fp_eval:n {#1} } } + } +\cs_new_protected:Npn \__driver_draw_color_gray_aux:n #1 + { + \__driver_draw_literal:n { #1 ~ g ~ #1 ~ G } + } \cs_new_protected:Npn \__driver_draw_color_gray_fill:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ g } } \cs_new_protected:Npn \__driver_draw_color_gray_stroke:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ G } } +\cs_new_protected:Npn \__driver_draw_color_rgb:nnn #1#2#3 + { + \use:x + { + \__driver_draw_color_rgb_aux:nnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + } + } +\cs_new_protected:Npn \__driver_draw_color_rgb_aux:nnn #1#2#3 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } + } \cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn #1#2#3 { \__driver_draw_literal:x diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def index ffd9060b2cc..9b3a84513da 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6511 2016-05-17 20:20:23Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $ {L3 Experimental drivers} \ProvidesExplFile {l3dvips.def}{\ExplFileDate}{\ExplFileVersion} @@ -62,9 +62,9 @@ neg~exch~neg~exch~translate } } -\cs_new_protected_nopar:Npn \__driver_scope_begin: +\cs_new_protected:Npn \__driver_scope_begin: { \tex_special:D { ps:gsave } } -\cs_new_protected_nopar:Npn \__driver_scope_end: +\cs_new_protected:Npn \__driver_scope_end: { \tex_special:D { ps:grestore } } \cs_new:Npn \__driver_absolute_lengths:n #1 { @@ -125,13 +125,292 @@ { \tl_set:Nn \l__driver_current_color_tl { \current@color } } { } } -\cs_new_protected_nopar:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_ensure_current: { \tex_special:D { color~push~\l__driver_current_color_tl } \group_insert_after:N \__driver_color_reset: } -\cs_new_protected_nopar:Npn \__driver_color_reset: +\cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } +\cs_new_protected:Npn \__driver_draw_literal:n #1 + { \tex_special:D { ps:: ~ #1 } } +\cs_generate_variant:Nn \__driver_draw_literal:n { x } +\cs_new_protected:Npn \__driver_draw_begin: + { + \tex_special:D { ps::[begin] } + \tex_special:D { ps::~save } + \tex_special:D { ps::~/l3x~currentpoint~/l3y~exch~def~def } + \tex_special:D { ps::~@beginspecial } + } +\cs_new_protected:Npn \__driver_draw_end: + { + \tex_special:D { ps::~@endspecial } + \tex_special:D { ps::~restore } + \tex_special:D { ps::[end] } + } +\cs_new_protected:Npn \__driver_draw_scope_begin: + { \__driver_draw_literal:n { save } } +\cs_new_protected:Npn \__driver_draw_scope_end: + { \__driver_draw_literal:n { restore } } +\cs_new_protected:Npn \__driver_draw_moveto:nn #1#2 + { + \__driver_draw_literal:x + { \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ moveto } + } +\cs_new_protected:Npn \__driver_draw_lineto:nn #1#2 + { + \__driver_draw_literal:x + { \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ lineto } + } +\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + \dim_to_decimal_in_bp:n {#4} ~ \dim_to_decimal_in_bp:n {#3} ~ + \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ + moveto~dup~0~rlineto~exch~0~exch~rlineto~neg~0~rlineto~clospath + } + } +\cs_new_protected:Npn \__driver_draw_curveto:nnnnnn #1#2#3#4#5#6 + { + \__driver_draw_literal:x + { + \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ + \dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ + \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~ + curveto + } + } +\cs_new_protected:Npn \__driver_draw_evenodd_rule: + { \bool_gset_true:N \g__driver_draw_eor_bool } +\cs_new_protected:Npn \__driver_draw_nonzero_rule: + { \bool_gset_false:N \g__driver_draw_eor_bool } +\bool_new:N \g__driver_draw_eor_bool +\cs_new_protected:Npn \__driver_draw_closepath: + { \__driver_draw_literal:n { closepath } } +\cs_new_protected:Npn \__driver_draw_stroke: + { + \__driver_draw_literal:n { currentdict~/l3sc~known~{gsave~l3sc}~if } + \__driver_draw_literal:n { stroke } + \__driver_draw_literal:n { currentdict~/l3sc~known~{grestore}~if } + \bool_if:NT \g__driver_draw_clip_bool + { + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + clip + } + } + \__driver_draw_literal:n { newpath } + \bool_gset_false:N \g__driver_draw_clip_bool + } +\cs_new_protected:Npn \__driver_draw_closestroke: + { + \__driver_draw_closepath: + \__driver_draw_stroke: + } +\cs_new_protected:Npn \__driver_draw_fill: + { + \__driver_draw_literal:n { currentdict~/l3fc~known~{gsave~l3fc}~if } + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + fill + } + \__driver_draw_literal:n { currentdict~/l3fc~known~{grestore}~if } + \bool_if:NT \g__driver_draw_clip_bool + { + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + clip + } + } + \__driver_draw_literal:n { newpath } + \bool_gset_false:N \g__driver_draw_clip_bool + } +\cs_new_protected:Npn \__driver_draw_fillstroke: + { + \__driver_draw_literal:n { currentdict~/l3fc~known~{gsave~l3fc}~if } + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + fill + } + \__driver_draw_literal:n { currentdict~/l3fc~known~{grestore}~if } + \__driver_draw_literal:n { currentdict~/l3sc~known~{gsave~l3sc}~if } + \__driver_draw_literal:n { stroke } + \__driver_draw_literal:n { currentdict~/l3sc~known~{grestore}~if } + \bool_if:NT \g__driver_draw_clip_bool + { + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + clip + } + } + \__driver_draw_literal:n { newpath } + \bool_gset_false:N \g__driver_draw_clip_bool + } +\cs_new_protected:Npn \__driver_draw_clip: + { \bool_gset_true:N \g__driver_draw_clip_bool } +\bool_new:N \g__driver_draw_clip_bool +\cs_new_protected:Npn \__driver_draw_discardpath: + { + \bool_if:NT \g__driver_draw_clip_bool + { + \__driver_draw_literal:x + { + \bool_if:NT \g__driver_draw_eor_bool { eo } + clip + } + } + \__driver_draw_literal:n { newpath } + \bool_gset_false:N \g__driver_draw_clip_bool + } +\cs_new_protected:Npn \__driver_draw_dash:nn #1#2 + { + \__driver_draw_literal:x + { + [ ~ + \clist_map_function:nN {#1} \__driver_draw_dash:n + ] ~ + \dim_to_decimal_in_bp:n {#2} ~ setdash + } + } +\cs_new:Npn \__driver_draw_dash:n #1 + { \dim_to_decimal_in_bp:n {#1} ~ } +\cs_new_protected:Npn \__driver_draw_linewidth:n #1 + { + \__driver_draw_literal:x + { \dim_to_decimal_in_bp:n {#1} ~ setlinewidth } + } +\cs_new_protected:Npn \__driver_draw_miterlimit:n #1 + { \__driver_draw_literal:x { \fp_eval:n {#1} ~ setmiterlimit } } +\cs_new_protected:Npn \__driver_draw_cap_butt: + { \__driver_draw_literal:n { 0 ~ setlinecap } } +\cs_new_protected:Npn \__driver_draw_cap_round: + { \__driver_draw_literal:n { 1 ~ setlinecap } } +\cs_new_protected:Npn \__driver_draw_cap_rectangle: + { \__driver_draw_literal:n { 2 ~ setlinecap } } +\cs_new_protected:Npn \__driver_draw_join_miter: + { \__driver_draw_literal:n { 0 ~ setlinejoin } } +\cs_new_protected:Npn \__driver_draw_join_round: + { \__driver_draw_literal:n { 1 ~ setlinejoin } } +\cs_new_protected:Npn \__driver_draw_join_bevel: + { \__driver_draw_literal:n { 2 ~ setlinejoin } } +\cs_new_protected:Npn \__driver_draw_color_reset: + { + \__driver_draw_literal:n { currentdic~/l3fc~known~{ /l3fc~ { } ~def }~if } + \__driver_draw_literal:n { currentdic~/l3sc~known~{ /l3sc~ { } ~def }~if } + } +\cs_new_protected:Npn \__driver_draw_color_cmyk:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + setcmykcolor ~ + } + \__driver_draw_color_reset: + } +\cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + /l3fc ~ + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + setcmykcolor + } ~ + def + } + } +\cs_new_protected:Npn \__driver_draw_color_cmyk_stroke:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + /l3sc ~ + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + setcmykcolor + } ~ + def + } + } +\cs_new_protected:Npn \__driver_draw_color_gray:n #1 + { + \__driver_draw_literal:x { fp_eval:n {#1} ~ setgray } + \__driver_draw_color_reset: + } +\cs_new_protected:Npn \__driver_draw_color_gray_fill:n #1 + { \__driver_draw_literal:x { /l3fc ~ { \fp_eval:n {#1} ~ setgray } ~ def } } +\cs_new_protected:Npn \__driver_draw_color_gray_stroke:n #1 + { \__driver_draw_literal:x { /l3sc ~ { \fp_eval:n {#1} ~ setgray } ~ def } } +\cs_new_protected:Npn \__driver_draw_color_rgb:nnn #1#2#3 + { + \__driver_draw_literal:x + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ + setrgbcolor + } + \__driver_draw_color_reset: + } +\cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn #1#2#3 + { + \__driver_draw_literal:x + { + /l3fc ~ + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ + setrgbcolor + } ~ + def + } + } +\cs_new_protected:Npn \__driver_draw_color_rgb_stroke:nnn #1#2#3 + { + \__driver_draw_literal:x + { + /l3sc ~ + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ + setrgbcolor + } ~ + def + } + } +\cs_new_protected:Npn \__driver_draw_transformcm:nnnnnn #1#2#3#4#5#6 + { + \__driver_draw_literal:x + { + [ + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~ + ] ~ + concat + } + } +\cs_new_protected:Npn \__driver_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7 + { + \__driver_scope_begin: + \tex_special:D { ps::[end] } + \__driver_draw_transformcm:nnnnnn {#2} {#3} {#4} {#5} {#6} {#7} + \tex_special:D { ps::~72~Resolution~div~72~VResolution~div~neg~scale } + \tex_special:D { ps::~magscale~{1~DVImag~div~dup~scale}~if } + \tex_special:D { ps::~l3x~neg~l3y~neg~translate } + \group_begin: + \box_set_wd:Nn #1 { 0pt } + \box_set_ht:Nn #1 { 0pt } + \box_set_dp:Nn #1 { 0pt } + \box_use:N #1 + \group_end: + \tex_special:D { ps::[begin] } + \__driver_scope_end: + } %% %% %% End of file `l3dvips.def'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def index c873e1df65b..a82c56b1671 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def @@ -46,16 +46,16 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6511 2016-05-17 20:20:23Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $ {L3 Experimental drivers} \ProvidesExplFile {l3dvisvgm.def}{\ExplFileDate}{\ExplFileVersion} {L3 Experimental driver: dvisvgm} \cs_new_protected:Npn \__driver_literal:n #1 { \tex_special:D { dvisvgm:raw~ #1 { ?nl } } } -\cs_new_protected_nopar:Npn \__driver_scope_begin: +\cs_new_protected:Npn \__driver_scope_begin: { \__driver_literal:n { <g> } } -\cs_new_protected_nopar:Npn \__driver_scope_end: +\cs_new_protected:Npn \__driver_scope_end: { \__driver_literal:n { </g> } } \cs_new_protected:Npn \__driver_scope_begin:n #1 { \__driver_literal:n { <g~ #1 > } } @@ -150,13 +150,319 @@ { \tl_set:Nn \l__driver_current_color_tl { \current@color } } { } } -\cs_new_protected_nopar:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_ensure_current: { \tex_special:D { color~push~\l__driver_current_color_tl } \group_insert_after:N \__driver_color_reset: } -\cs_new_protected_nopar:Npn \__driver_color_reset: +\cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } +\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n +\cs_generate_variant:Nn \__driver_draw_literal:n { x } +\cs_new_protected:Npn \__driver_draw_begin: + { + \__driver_draw_scope_begin: + \__driver_draw_scope:n { transform="translate({?x},{?y})~scale(1,-1)" } + } +\cs_new_protected:Npn \__driver_draw_end: + { \__driver_draw_scope_end: } +\cs_new_protected:Npn \__driver_draw_scope_begin: + { + \int_set_eq:NN + \l__driver_draw_scope_int + \g__driver_draw_scope_int + \group_begin: + \int_gset:Nn \g__driver_draw_scope_int { 0 } + } +\cs_new_protected:Npn \__driver_draw_scope_end: + { + \prg_replicate:nn + { \g__driver_draw_scope_int } + { \__driver_draw_literal:n { </g> } } + \group_end: + \int_gset_eq:NN + \g__driver_draw_scope_int + \l__driver_draw_scope_int + } +\cs_new_protected:Npn \__driver_draw_scope:n #1 + { + \__driver_draw_literal:n { <g~ #1 > } + \int_gincr:N \g__driver_draw_scope_int + } +\cs_generate_variant:Nn \__driver_draw_scope:n { x } +\int_new:N \g__driver_draw_scope_int +\int_new:N \l__driver_draw_scope_int +\cs_new_protected:Npn \__driver_draw_moveto:nn #1#2 + { + \__driver_draw_add_to_path:n + { M ~ \dim_to_decimal:n {#1} ~ \dim_to_decimal:n {#2} } + } +\cs_new_protected:Npn \__driver_draw_lineto:nn #1#2 + { + \__driver_draw_add_to_path:n + { L ~ \dim_to_decimal:n {#1} ~ \dim_to_decimal:n {#2} } + } +\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4 + { + \__driver_draw_add_to_path:n + { + M ~ \dim_to_decimal:n {#1} ~ \dim_to_decimal:n {#2} + h ~ \dim_to_decimal:n {#3} ~ + v ~ \dim_to_decimal:n {#4} ~ + h ~ \dim_to_decimal:n { -#3 } ~ + Z + } + } +\cs_new_protected:Npn \__driver_draw_curveto:nnnnnn #1#2#3#4#5#6 + { + \__driver_draw_add_to_path:n + { + C ~ + \dim_to_decimal:n {#1} ~ \dim_to_decimal:n {#2} ~ + \dim_to_decimal:n {#3} ~ \dim_to_decimal:n {#4} ~ + \dim_to_decimal:n {#5} ~ \dim_to_decimal:n {#6} + } + } +\cs_new_protected:Npn \__driver_draw_add_to_path:n #1 + { + \tl_gset:Nx \g__driver_draw_path_tl + { + \g__driver_draw_path_tl + \tl_if_empty:NF \g__driver_draw_path_tl { \c_space_tl } + #1 + } + } +\tl_new:N \g__driver_draw_path_tl +\cs_new_protected:Npn \__driver_draw_evenodd_rule: + { \__driver_draw_scope:n { fill-rule="evenodd" } } +\cs_new_protected:Npn \__driver_draw_nonzero_rule: + { \__driver_draw_scope:n { fill-rule="nonzero" } } +\cs_new_protected:Npn \__driver_draw_closepath: + { \__driver_draw_add_to_path:n { Z } } +\cs_new_protected:Npn \__driver_draw_path:n #1 + { + \bool_if:NTF \g__driver_draw_clip_bool + { + \int_gincr:N \g__driver_clip_path_int + \__driver_draw_literal:x + { + < clipPath~id = " l3cp \int_use:N \g__driver_clip_path_int " > + { ?nl } + <path~d=" \g__driver_draw_path_tl "/> { ?nl } + < /clipPath > { ? nl } + < + use~xlink:href = + "\c_hash_str l3path \int_use:N \g__driver_path_int " ~ + #1 + /> + } + \__driver_draw_scope:x + { + clip-path = + "url( \c_hash_str l3cp \int_use:N \g__driver_clip_path_int)" + } + } + { + \__driver_draw_literal:x + { <path ~ d=" \g__driver_draw_path_tl " ~ #1 /> } + } + \tl_gclear:N \g__driver_draw_path_tl + \bool_gset_false:N \g__driver_draw_clip_bool + } +\int_new:N \g__driver_path_int +\cs_new_protected:Npn \__driver_draw_stroke: + { \__driver_draw_path:n { style="fill:none" } } +\cs_new_protected:Npn \__driver_draw_closestroke: + { + \__driver_draw_closepath: + \__driver_draw_stroke: + } +\cs_new_protected:Npn \__driver_draw_fill: + { \__driver_draw_path:n { style="stroke:none" } } +\cs_new_protected:Npn \__driver_draw_fillstroke: + { \__driver_draw_path:n { } } +\cs_new_protected:Npn \__driver_draw_clip: + { \bool_gset_true:N \g__driver_draw_clip_bool } +\bool_new:N \g__driver_draw_clip_bool +\cs_new_protected:Npn \__driver_draw_discardpath: + { + \bool_if:NT \g__driver_draw_clip_bool + { + \int_gincr:N \g__driver_clip_path_int + \__driver_draw_literal:x + { + < clipPath~id = " l3cp \int_use:N \g__driver_clip_path_int " > + { ?nl } + <path~d=" \g__driver_draw_path_tl "/> { ?nl } + < /clipPath > + } + \__driver_draw_scope:x + { + clip-path = + "url( \c_hash_str l3cp \int_use:N \g__driver_clip_path_int)" + } + } + \tl_gclear:N \g__driver_draw_path_tl + \bool_gset_false:N \g__driver_draw_clip_bool + } +\cs_new_protected:Npn \__driver_draw_dash:nn #1#2 + { + \use:x + { + \__driver_draw_dash_aux:nn + { \clist_map_function:nn {#1} \__driver_draw_dash:n } + { \dim_to_decimal:n {#2} } + } + } +\cs_new:Npn \__driver_draw_dash:n #1 + { , \dim_to_decimal_in_bp:n {#1} } +\cs_new_protected:Npn \__driver_draw_dash_aux:nn #1#2 + { + \__driver_draw_scope:x + { + stroke-dasharray = + " + \tl_if_empty:oTF { \use_none:n #1 } + { none } + { \use_none:n #1 } + " ~ + stroke-offset=" #2 " + } + } +\cs_new_protected:Npn \__driver_draw_linewidth:n #1 + { \__driver_draw_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } } +\cs_new_protected:Npn \__driver_draw_miterlimit:n #1 + { \__driver_draw_scope:x { stroke-miterlimit=" \fp_eval:n {#1} " } } +\cs_new_protected:Npn \__driver_draw_cap_butt: + { \__driver_draw_scope:n { stroke-linecap="butt" } } +\cs_new_protected:Npn \__driver_draw_cap_round: + { \__driver_draw_scope:n { stroke-linecap="round" } } +\cs_new_protected:Npn \__driver_draw_cap_rectangle: + { \__driver_draw_scope:n { stroke-linecap="square" } } +\cs_new_protected:Npn \__driver_draw_join_miter: + { \__driver_draw_scope:n { stroke-linejoin="miter" } } +\cs_new_protected:Npn \__driver_draw_join_round: + { \__driver_draw_scope:n { stroke-linejoin="round" } } +\cs_new_protected:Npn \__driver_draw_join_bevel: + { \__driver_draw_scope:n { stroke-linejoin="bevel" } } +\cs_new_protected:Npn \__driver_draw_color_cmyk_aux:NNnnnnn #1#2#3#4#5#6 + { + \use:x + { + \__driver_draw_color_rgb_auxii:nnn + { \fp_eval:n { -100 * ( (#3) * ( 1 - (#6) ) - 1 ) } } + { \fp_eval:n { -100 * ( (#4) * ( 1 - (#6) ) + #6 - 1 ) } } + { \fp_eval:n { -100 * ( (#5) * ( 1 - (#6) ) + #6 - 1 ) } } + } + #1 #2 + } +\cs_new_protected:Npn \__driver_draw_color_cmyk:nnnn + { \__driver_draw_color_cmyk_aux:NNnnnnn \c_true_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn + { \__driver_draw_color_cmyk_aux:NNnnnnn \c_false_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_cmyk_stroke:nnnn + { \__driver_draw_color_cmyk_aux:NNnnnnn \c_true_bool \c_false_bool } +\cs_new_protected:Npn \__driver_draw_color_gray_aux:NNn #1#2#3 + { + \use:x + { + \__driver_draw_color_gray_aux:nNN + { \fp_eval:n { 100 * (#3)} } + } + #1 #2 + } +\cs_new_protected:Npn \__driver_draw_color_gray_aux:nNN #1 + { \__driver_draw_color_rgb_auxii:nnnNN {#1} {#1} {#1} } +\cs_generate_variant:Nn \__driver_draw_color_gray_aux:nNN { x } +\cs_new_protected:Npn \__driver_draw_color_gray:n + { \__driver_draw_color_gray_aux:NNn \c_true_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_gray_fill:n + { \__driver_draw_color_gray_aux:NNn \c_false_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_gray_stroke:n + { \__driver_draw_color_gray_aux:NNn \c_true_bool \c_false_bool } +\cs_new_protected:Npn \__driver_draw_color_rgb_auxi:NNnnn #1#2#3#4#5 + { + \use:x + { + \__driver_draw_color_rgb_auxii:nnnNN + { \fp_eval:n { 100 * (#3) } } + { \fp_eval:n { 100 * (#4) } } + { \fp_eval:n { 100 * (#5) } } + } + #1 #2 + } +\cs_new_protected:Npn \__driver_draw_color_rgb_auxii:nnnNN #1#2#3#4#5 + { + \__driver_draw_scope:x + { + \bool_if:NT #4 + { + fill = + " + rgb + ( + #1 \c_percent_str , + #2 \c_percent_str , + #3 \c_percent_str + ) + " + \bool_if:NT #5 { ~ } + } + \bool_if:NT #5 + { + stroke = + " + rgb + ( + #1 \c_percent_str , + #2 \c_percent_str , + #3 \c_percent_str + ) + " + } + } + } +\cs_new_protected:Npn \__driver_draw_color_rgb:nnn + { \__driver_draw_color_rgb_auxi:NNnnn \c_true_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn + { \__driver_draw_color_rgb_auxi:NNnnn \c_false_bool \c_true_bool } +\cs_new_protected:Npn \__driver_draw_color_rgb_stroke:nnn + { \__driver_draw_color_rgb_auxi:NNnnn \c_true_bool \c_false_bool } +\cs_new_protected:Npn \__driver_draw_transformcm:nnnnnn #1#2#3#4#5#6 + { + \__driver_draw_scope:x + { + transform = + " + matrix + ( + \fp_eval:n {#1} , \fp_eval:n {#2} , + \fp_eval:n {#3} , \fp_eval:n {#4} , + \dim_to_decimal:n {#5} , \dim_to_decimal:n {#6} + ) + " + } + } +\cs_new_protected:Npn \__driver_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7 + { + \__driver_scope_begin: + \__driver_draw_transformcm:nnnnnn {#2} {#3} {#4} {#5} {#6} {#7} + \__driver_literal:n + { + < g~ + stroke="none"~ + transform="scale(-1,1)~translate({?x},{?y})~scale(-1,-1)" + > + } + \group_begin: + \box_set_wd:Nn #1 { 0pt } + \box_set_ht:Nn #1 { 0pt } + \box_set_dp:Nn #1 { 0pt } + \box_use:N #1 + \group_end: + \__driver_literal:n { </g> } + \__driver_scope_end: + } %% %% %% End of file `l3dvisvgm.def'. diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def index d90c9c2bdc5..50173240a0a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def @@ -46,7 +46,7 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6511 2016-05-17 20:20:23Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $ {L3 Experimental drivers} \ProvidesExplFile {l3pdfmode.def}{\ExplFileDate}{\ExplFileVersion} @@ -58,13 +58,13 @@ { \pdftex_pdfliteral:D } {#1} } -\cs_new_protected_nopar:Npx \__driver_scope_begin: +\cs_new_protected:Npx \__driver_scope_begin: { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D save \scan_stop: } { \pdftex_pdfsave:D } } -\cs_new_protected_nopar:Npx \__driver_scope_end: +\cs_new_protected:Npx \__driver_scope_end: { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D restore \scan_stop: } @@ -86,7 +86,7 @@ { } } \int_new:N \l__driver_color_stack_int -\cs_new_protected_nopar:Npx \__driver_color_ensure_current: +\cs_new_protected:Npx \__driver_color_ensure_current: { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } @@ -95,7 +95,7 @@ { \exp_not:N \l__driver_current_color_tl } \group_insert_after:N \exp_not:N \__driver_color_reset: } -\cs_new_protected_nopar:Npx \__driver_color_reset: +\cs_new_protected:Npx \__driver_color_reset: { \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } @@ -157,13 +157,13 @@ } \cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } -\cs_new_protected_nopar:Npn \__driver_draw_begin: +\cs_new_protected:Npn \__driver_draw_begin: { \__driver_draw_scope_begin: } -\cs_new_protected_nopar:Npn \__driver_draw_end: +\cs_new_protected:Npn \__driver_draw_end: { \__driver_draw_scope_end: } -\cs_new_protected_nopar:Npn \__driver_draw_scope_begin: +\cs_new_protected:Npn \__driver_draw_scope_begin: { \__driver_draw_literal:n { q } } -\cs_new_protected_nopar:Npn \__driver_draw_scope_end: +\cs_new_protected:Npn \__driver_draw_scope_end: { \__driver_draw_literal:n { Q } } \cs_new_protected:Npn \__driver_draw_moveto:nn #1#2 { @@ -185,29 +185,42 @@ c } } -\bool_new:N \__driver_draw_eor_bool -\cs_new_protected_nopar:Npn \__driver_draw_closepath: +\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ + \dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ + re + } + } +\cs_new_protected:Npn \__driver_draw_evenodd_rule: + { \bool_gset_true:N \g__driver_draw_eor_bool } +\cs_new_protected:Npn \__driver_draw_nonzero_rule: + { \bool_gset_false:N \g__driver_draw_eor_bool } +\bool_new:N \g__driver_draw_eor_bool +\cs_new_protected:Npn \__driver_draw_closepath: { \__driver_draw_literal:n { h } } -\cs_new_protected_nopar:Npn \__driver_draw_stroke: +\cs_new_protected:Npn \__driver_draw_stroke: { \__driver_draw_literal:n { S } } -\cs_new_protected_nopar:Npn \__driver_draw_closestroke: +\cs_new_protected:Npn \__driver_draw_closestroke: { \__driver_draw_literal:n { s } } -\cs_new_protected_nopar:Npn \__driver_draw_fill: +\cs_new_protected:Npn \__driver_draw_fill: { \__driver_draw_literal:x - { f \bool_if:NT \__driver_draw_eor_bool * } + { f \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_fillstroke: +\cs_new_protected:Npn \__driver_draw_fillstroke: { \__driver_draw_literal:x - { B \bool_if:NT \__driver_draw_eor_bool * } + { B \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_clip: +\cs_new_protected:Npn \__driver_draw_clip: { \__driver_draw_literal:x - { W \bool_if:NT \__driver_draw_eor_bool * } + { W \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_discardpath: +\cs_new_protected:Npn \__driver_draw_discardpath: { \__driver_draw_literal:n { n } } \cs_new_protected:Npn \__driver_draw_dash:nn #1#2 { @@ -228,18 +241,34 @@ } \cs_new_protected:Npn \__driver_draw_miterlimit:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ M } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_butt: +\cs_new_protected:Npn \__driver_draw_cap_butt: { \__driver_draw_literal:n { 0 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_round: +\cs_new_protected:Npn \__driver_draw_cap_round: { \__driver_draw_literal:n { 1 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_rectangle: +\cs_new_protected:Npn \__driver_draw_cap_rectangle: { \__driver_draw_literal:n { 2 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_join_miter: +\cs_new_protected:Npn \__driver_draw_join_miter: { \__driver_draw_literal:n { 0 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_round: +\cs_new_protected:Npn \__driver_draw_join_round: { \__driver_draw_literal:n { 1 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_bevel: +\cs_new_protected:Npn \__driver_draw_join_bevel: { \__driver_draw_literal:n { 2 ~ j } } +\cs_new_protected:Npn \__driver_draw_color_cmyk:nnnn #1#2#3#4 + { + \use:x + { + \__driver_draw_color_cmyk_aux:nnnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + { \fp_eval:n {#4} } + } + } +\cs_new_protected:Npn \__driver_draw_color_cmyk_aux:nnnn #1#2#3#4 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } + } \cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn #1#2#3#4 { \__driver_draw_literal:x @@ -258,10 +287,34 @@ K } } +\cs_new_protected:Npn \__driver_draw_color_gray:n #1 + { + \use:x + { \__driver_draw_color_gray_aux:n { \fp_eval:n {#1} } } + } +\cs_new_protected:Npn \__driver_draw_color_gray_aux:n #1 + { + \__driver_draw_literal:n { #1 ~ g ~ #1 ~ G } + } \cs_new_protected:Npn \__driver_draw_color_gray_fill:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ g } } \cs_new_protected:Npn \__driver_draw_color_gray_stroke:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ G } } +\cs_new_protected:Npn \__driver_draw_color_rgb:nnn #1#2#3 + { + \use:x + { + \__driver_draw_color_rgb_aux:nnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + } + } +\cs_new_protected:Npn \__driver_draw_color_rgb_aux:nnn #1#2#3 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } + } \cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn #1#2#3 { \__driver_draw_literal:x diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def index f21566f34b6..c3cae34968c 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def @@ -46,16 +46,16 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6511 2016-05-17 20:20:23Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $ {L3 Experimental drivers} \ProvidesExplFile {l3xdvidpfmx.def}{\ExplFileDate}{\ExplFileVersion} {L3 Experimental driver: xdvipdfmx} \cs_new_protected:Npn \__driver_literal:n #1 { \tex_special:D { pdf:literal~ #1 } } -\cs_new_protected_nopar:Npn \__driver_scope_begin: +\cs_new_protected:Npn \__driver_scope_begin: { \__driver_literal:n { q } } -\cs_new_protected_nopar:Npn \__driver_scope_end: +\cs_new_protected:Npn \__driver_scope_end: { \__driver_literal:n { Q } } \cs_new_protected:Npn \__driver_matrix:n #1 { \__driver_literal:n { #1 \c_space_tl 0~0~cm } } @@ -67,23 +67,23 @@ { \tl_set:Nn \l__driver_current_color_tl { \current@color } } { } } -\cs_new_protected_nopar:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_ensure_current: { \tex_special:D { pdf:bcolor~\l__driver_current_color_tl } \group_insert_after:N \__driver_color_reset: } -\cs_new_protected_nopar:Npn \__driver_color_reset: +\cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { pdf:ecolor } } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_set_protected_nopar:Npn \__driver_color_ensure_current: + \cs_set_protected:Npn \__driver_color_ensure_current: { \tex_special:D { color~push~\l__driver_current_color_tl } \group_insert_after:N \__driver_color_reset: } - \cs_set_protected_nopar:Npn \__driver_color_reset: + \cs_set_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } } { } @@ -143,13 +143,13 @@ } \cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } -\cs_new_protected_nopar:Npn \__driver_draw_begin: +\cs_new_protected:Npn \__driver_draw_begin: { \__driver_draw_scope_begin: } -\cs_new_protected_nopar:Npn \__driver_draw_end: +\cs_new_protected:Npn \__driver_draw_end: { \__driver_draw_scope_end: } -\cs_new_protected_nopar:Npn \__driver_draw_scope_begin: +\cs_new_protected:Npn \__driver_draw_scope_begin: { \__driver_draw_literal:n { q } } -\cs_new_protected_nopar:Npn \__driver_draw_scope_end: +\cs_new_protected:Npn \__driver_draw_scope_end: { \__driver_draw_literal:n { Q } } \cs_new_protected:Npn \__driver_draw_moveto:nn #1#2 { @@ -171,29 +171,42 @@ c } } -\bool_new:N \__driver_draw_eor_bool -\cs_new_protected_nopar:Npn \__driver_draw_closepath: +\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4 + { + \__driver_draw_literal:x + { + \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ + \dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ + re + } + } +\cs_new_protected:Npn \__driver_draw_evenodd_rule: + { \bool_gset_true:N \g__driver_draw_eor_bool } +\cs_new_protected:Npn \__driver_draw_nonzero_rule: + { \bool_gset_false:N \g__driver_draw_eor_bool } +\bool_new:N \g__driver_draw_eor_bool +\cs_new_protected:Npn \__driver_draw_closepath: { \__driver_draw_literal:n { h } } -\cs_new_protected_nopar:Npn \__driver_draw_stroke: +\cs_new_protected:Npn \__driver_draw_stroke: { \__driver_draw_literal:n { S } } -\cs_new_protected_nopar:Npn \__driver_draw_closestroke: +\cs_new_protected:Npn \__driver_draw_closestroke: { \__driver_draw_literal:n { s } } -\cs_new_protected_nopar:Npn \__driver_draw_fill: +\cs_new_protected:Npn \__driver_draw_fill: { \__driver_draw_literal:x - { f \bool_if:NT \__driver_draw_eor_bool * } + { f \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_fillstroke: +\cs_new_protected:Npn \__driver_draw_fillstroke: { \__driver_draw_literal:x - { B \bool_if:NT \__driver_draw_eor_bool * } + { B \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_clip: +\cs_new_protected:Npn \__driver_draw_clip: { \__driver_draw_literal:x - { W \bool_if:NT \__driver_draw_eor_bool * } + { W \bool_if:NT \g__driver_draw_eor_bool * } } -\cs_new_protected_nopar:Npn \__driver_draw_discardpath: +\cs_new_protected:Npn \__driver_draw_discardpath: { \__driver_draw_literal:n { n } } \cs_new_protected:Npn \__driver_draw_dash:nn #1#2 { @@ -214,18 +227,34 @@ } \cs_new_protected:Npn \__driver_draw_miterlimit:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ M } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_butt: +\cs_new_protected:Npn \__driver_draw_cap_butt: { \__driver_draw_literal:n { 0 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_round: +\cs_new_protected:Npn \__driver_draw_cap_round: { \__driver_draw_literal:n { 1 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_cap_rectangle: +\cs_new_protected:Npn \__driver_draw_cap_rectangle: { \__driver_draw_literal:n { 2 ~ J } } -\cs_new_protected_nopar:Npn \__driver_draw_join_miter: +\cs_new_protected:Npn \__driver_draw_join_miter: { \__driver_draw_literal:n { 0 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_round: +\cs_new_protected:Npn \__driver_draw_join_round: { \__driver_draw_literal:n { 1 ~ j } } -\cs_new_protected_nopar:Npn \__driver_draw_join_bevel: +\cs_new_protected:Npn \__driver_draw_join_bevel: { \__driver_draw_literal:n { 2 ~ j } } +\cs_new_protected:Npn \__driver_draw_color_cmyk:nnnn #1#2#3#4 + { + \use:x + { + \__driver_draw_color_cmyk_aux:nnnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + { \fp_eval:n {#4} } + } + } +\cs_new_protected:Npn \__driver_draw_color_cmyk_aux:nnnn #1#2#3#4 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } + } \cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn #1#2#3#4 { \__driver_draw_literal:x @@ -244,10 +273,34 @@ K } } +\cs_new_protected:Npn \__driver_draw_color_gray:n #1 + { + \use:x + { \__driver_draw_color_gray_aux:n { \fp_eval:n {#1} } } + } +\cs_new_protected:Npn \__driver_draw_color_gray_aux:n #1 + { + \__driver_draw_literal:n { #1 ~ g ~ #1 ~ G } + } \cs_new_protected:Npn \__driver_draw_color_gray_fill:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ g } } \cs_new_protected:Npn \__driver_draw_color_gray_stroke:n #1 { \__driver_draw_literal:x { \fp_eval:n {#1} ~ G } } +\cs_new_protected:Npn \__driver_draw_color_rgb:nnn #1#2#3 + { + \use:x + { + \__driver_draw_color_rgb_aux:nnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + } + } +\cs_new_protected:Npn \__driver_draw_color_rgb_aux:nnn #1#2#3 + { + \__driver_draw_literal:n + { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } + } \cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn #1#2#3 { \__driver_draw_literal:x diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty index 782004ad183..f16aa19f843 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}[2016/05/18] -\@ifpackagelater{expl3}{2016/05/18} +\RequirePackage{expl3}[2016/10/19] +\@ifpackagelater{expl3}{2016/10/19} {} {% \PackageError{l3keys2e}{Support package l3kernel too old} @@ -61,8 +61,8 @@ } \def\ExplFileName{l3keys2e} \def\ExplFileDescription{LaTeX2e option processing using LaTeX3 keys} -\def\ExplFileDate{2016/05/18} -\def\ExplFileVersion{6512} +\def\ExplFileDate{2016/10/19} +\def\ExplFileVersion{6730} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \cs_generate_variant:Nn \clist_put_right:Nn { Nv } @@ -135,7 +135,7 @@ } } } -\cs_new_protected_nopar:Npn \__keys_latexe_options_local: +\cs_new_protected:Npn \__keys_latexe_options_local: { \cs_if_eq:NNF \@currext \@clsextension { @@ -149,12 +149,12 @@ \cs_new:Npn \__keys_latexe_remove_equals:n #1 { \__keys_latexe_remove_equals:w #1 = \q_stop } \cs_new:Npn \__keys_latexe_remove_equals:w #1 = #2 \q_stop { \exp_not:n {#1} } -\cs_new_protected_nopar:Npn \ProcessKeysOptions #1 +\cs_new_protected:Npn \ProcessKeysOptions #1 { \bool_set_true:N \l__keys_process_class_bool \__keys_latexe_options:n {#1} } -\cs_new_protected_nopar:Npn \ProcessKeysPackageOptions #1 +\cs_new_protected:Npn \ProcessKeysPackageOptions #1 { \bool_set_false:N \l__keys_process_class_bool \__keys_latexe_options:n {#1} diff --git a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty index 9f41789cb3c..a16df31eead 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty @@ -47,8 +47,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2016/05/18] -\@ifpackagelater{expl3}{2016/05/18} +\RequirePackage{expl3}[2016/10/19] +\@ifpackagelater{expl3}{2016/10/19} {} {% \PackageError{xfrac}{Support package l3kernel too old} @@ -63,8 +63,8 @@ \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} \def\ExplFileName{xfrac} \def\ExplFileDescription{L3 Experimental split-level fractions} -\def\ExplFileDate{2016/05/18} -\def\ExplFileVersion{6512} +\def\ExplFileDate{2016/10/19} +\def\ExplFileVersion{6730} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \keys_define:nn { xfrac } @@ -98,14 +98,14 @@ \tl_new:N \l__xfrac_phantom_tl \tl_new:N \l__xfrac_slash_symbol_tl \tl_new:N \l__xfrac_slash_symbol_font_tl -\cs_new_nopar:Npn \__xfrac_fontscale: { } +\cs_new:Npn \__xfrac_fontscale: { } \cs_new:Npn \__xfrac_math:n #1 { } -\cs_new_nopar:Npn \__xfrac_denominator_font_change: { } +\cs_new:Npn \__xfrac_denominator_font_change: { } \cs_new:Npn \__xfrac_denominator_format:n #1 { } -\cs_new_nopar:Npn \__xfrac_numerator_font_change: { } +\cs_new:Npn \__xfrac_numerator_font_change: { } \cs_new:Npn \__xfrac_numerator_format:n #1 { } -\cs_new_nopar:Npn \__xfrac_relscale: { } -\cs_new_nopar:Npn \__xfrac_slash_symbol_font_change: { } +\cs_new:Npn \__xfrac_relscale: { } +\cs_new:Npn \__xfrac_slash_symbol_font_change: { } \cs_new:Npn \__xfrac_slash_symbol_format:n #1 { } \cs_new:Npn \__xfrac_text_or_math:n #1 { } \DeclareObjectType { xfrac } { 3 } @@ -156,21 +156,21 @@ scale-relative = { false = - \cs_set_nopar:Npn \__xfrac_relscale: + \cs_set:Npn \__xfrac_relscale: { \__dim_eval:w \box_ht:N \l__xfrac_tmp_box + \box_dp:N \l__xfrac_tmp_box \__dim_eval_end: }, true = - \cs_set_nopar:Npn \__xfrac_relscale: + \cs_set:Npn \__xfrac_relscale: { \box_ht:N \l__xfrac_slash_box } }, scaling = { false = \cs_set_eq:NN \__xfrac_fontscale: \prg_do_nothing:, true = - \cs_set_nopar:Npn \__xfrac_fontscale: + \cs_set:Npn \__xfrac_fontscale: { \fontsize { \fp_use:N \l__xfrac_scale_factor_fp \__xfrac_relscale: } @@ -192,26 +192,26 @@ \mode_if_math:TF { \cs_set_eq:NN \__xfrac_text_or_math:n \text - \cs_set_nopar:Npx \__xfrac_denominator_font_change: + \cs_set:Npx \__xfrac_denominator_font_change: { \tex_fam:D \l__xfrac_denominator_font_tl } - \cs_set_nopar:Npx \__xfrac_numerator_font_change: + \cs_set:Npx \__xfrac_numerator_font_change: { \tex_fam:D \l__xfrac_numerator_font_tl } - \cs_set_nopar:Npx \__xfrac_slash_symbol_font_change: + \cs_set:Npx \__xfrac_slash_symbol_font_change: { \tex_fam:D \l__xfrac_slash_symbol_font_tl } } { \cs_set_eq:NN \__xfrac_text_or_math:n \mbox - \cs_set_nopar:Npn \__xfrac_denominator_font_change: + \cs_set:Npn \__xfrac_denominator_font_change: { \fontfamily { \l__xfrac_denominator_font_tl } \selectfont } - \cs_set_nopar:Npn \__xfrac_numerator_font_change: + \cs_set:Npn \__xfrac_numerator_font_change: { \fontfamily { \l__xfrac_numerator_font_tl } \selectfont } - \cs_set_nopar:Npn \__xfrac_slash_symbol_font_change: + \cs_set:Npn \__xfrac_slash_symbol_font_change: { \fontfamily { \l__xfrac_slash_symbol_font_tl } \selectfont @@ -237,7 +237,7 @@ } } } - \cs_set_nopar:Npn \__xfrac_tmp:w + \cs_set:Npn \__xfrac_tmp:w { \raisebox { @@ -254,7 +254,7 @@ \dim_compare:nNnF { \l__xfrac_numerator_bot_sep_dim } = { \c_max_dim } { - \cs_set_nopar:Npn \__xfrac_tmp:w + \cs_set:Npn \__xfrac_tmp:w { \raisebox { \dim_use:N \l__xfrac_numerator_bot_sep_dim } @@ -265,7 +265,7 @@ \dim_compare:nNnTF { \l__xfrac_numerator_bot_sep_dim } = { \c_max_dim } { - \cs_set_nopar:Npn \__xfrac_tmp:w + \cs_set:Npn \__xfrac_tmp:w { \raisebox { @@ -319,11 +319,11 @@ \dim_compare:nNnTF { \l__xfrac_denominator_bot_sep_dim } = { \c_max_dim } { - \cs_set_nopar:Npn \__xfrac_tmp:w + \cs_set:Npn \__xfrac_tmp:w { \raisebox { - \box_dp:N \l__xfrac_slash_box } } } { - \cs_set_nopar:Npn \__xfrac_tmp:w + \cs_set:Npn \__xfrac_tmp:w { \raisebox { \dim_use:N \l__xfrac_denominator_bot_sep_dim } diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index 8a4664f615a..4777b58c255 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}[2016/05/18] -\@ifpackagelater{expl3}{2016/05/18} +\RequirePackage{expl3}[2016/10/19] +\@ifpackagelater{expl3}{2016/10/19} {} {% \PackageError{xparse}{Support package l3kernel too old} @@ -65,8 +65,8 @@ } \def\ExplFileName{xparse} \def\ExplFileDescription{L3 Experimental document command parser} -\def\ExplFileDate{2016/05/18} -\def\ExplFileVersion{6512} +\def\ExplFileDate{2016/10/19} +\def\ExplFileVersion{6730} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \tl_const:Nx \c__xparse_no_value_tl @@ -97,12 +97,12 @@ \int_new:N \l__xparse_processor_int \tl_new:N \l__xparse_signature_tl \tl_new:N \l__xparse_tmp_tl -\cs_new_protected_nopar:Npn \__xparse_declare_cmd:Nnn +\cs_new_protected:Npn \__xparse_declare_cmd:Nnn { \bool_set_false:N \l__xparse_expandable_bool \__xparse_declare_cmd_aux:Nnn } -\cs_new_protected_nopar:Npn \__xparse_declare_expandable_cmd:Nnn +\cs_new_protected:Npn \__xparse_declare_expandable_cmd:Nnn { \bool_set_true:N \l__xparse_expandable_bool \__xparse_declare_cmd_aux:Nnn @@ -267,7 +267,7 @@ \quark_if_recursion_tail_stop_do:nn {#3} { \__xparse_bad_arg_spec:wn } \__xparse_count_mandatory:N } -\cs_new_protected_nopar:Npn \__xparse_count_type_g:w +\cs_new_protected:Npn \__xparse_count_type_g:w { \__xparse_count_mandatory:N } \cs_new_protected:Npn \__xparse_count_type_G:w #1 { @@ -286,7 +286,7 @@ \quark_if_recursion_tail_stop_do:nn {#2} { \__xparse_bad_arg_spec:wn } \__xparse_count_mandatory:N } -\cs_new_protected_nopar:Npn \__xparse_count_type_m:w +\cs_new_protected:Npn \__xparse_count_type_m:w { \int_incr:N \l__xparse_mandatory_args_int \__xparse_count_mandatory:N @@ -342,7 +342,7 @@ \tl_clear:N \l__xparse_signature_tl \__xparse_prepare_signature:N #1 \q_recursion_tail \q_recursion_stop } -\cs_new_protected_nopar:Npn \__xparse_prepare_signature:N +\cs_new_protected:Npn \__xparse_prepare_signature:N { \bool_set_false:N \l__xparse_processor_bool \__xparse_prepare_signature_bypass:N @@ -373,7 +373,7 @@ { \__xparse_add_type_m:w } } } -\cs_new_protected_nopar:cpn { __xparse_add_type_+:w } +\cs_new_protected:cpn { __xparse_add_type_+:w } { \__xparse_flush_m_args: \bool_set_true:N \l__xparse_long_bool @@ -397,7 +397,7 @@ \tl_put_right:Nn \l__xparse_signature_tl { #1 #2 {#3} } \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_type_g:w +\cs_new_protected:Npn \__xparse_add_type_g:w { \exp_args:No \__xparse_add_type_G:w \c__xparse_no_value_tl } \cs_new_protected:Npn \__xparse_add_type_G:w #1 { @@ -415,13 +415,13 @@ \tl_put_right:Nn \l__xparse_signature_tl { #1 {#2} } \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_type_l:w +\cs_new_protected:Npn \__xparse_add_type_l:w { \__xparse_flush_m_args: \__xparse_add_grabber_mandatory:N l \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_type_m:w +\cs_new_protected:Npn \__xparse_add_type_m:w { \bool_if:nTF { \l__xparse_long_bool || \l__xparse_processor_bool } { @@ -454,13 +454,13 @@ \tl_put_right:Nn \l__xparse_signature_tl { {#1} } \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_type_v:w +\cs_new_protected:Npn \__xparse_add_type_v:w { \__xparse_flush_m_args: \__xparse_add_grabber_mandatory:N v \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_flush_m_args: +\cs_new_protected:Npn \__xparse_flush_m_args: { \int_compare:nNnT \l__xparse_m_args_int > \c_zero { @@ -470,7 +470,7 @@ } \int_zero:N \l__xparse_m_args_int } -\cs_new_protected_nopar:Npn \__xparse_add_grabber_mandatory:N #1 +\cs_new_protected:Npn \__xparse_add_grabber_mandatory:N #1 { \tl_put_right:Nx \l__xparse_signature_tl { @@ -480,7 +480,7 @@ \bool_set_false:N \l__xparse_long_bool \int_decr:N \l__xparse_mandatory_args_int } -\cs_new_protected_nopar:Npn \__xparse_add_grabber_optional:N #1 +\cs_new_protected:Npn \__xparse_add_grabber_optional:N #1 { \tl_put_right:Nx \l__xparse_signature_tl { @@ -495,7 +495,7 @@ } \bool_set_false:N \l__xparse_long_bool } -\cs_new_protected_nopar:cpn { __xparse_add_expandable_type_+:w } +\cs_new_protected:cpn { __xparse_add_expandable_type_+:w } { \bool_set_true:N \l__xparse_long_bool \int_compare:nNnTF \l__xparse_current_arg_int = \c_one @@ -561,24 +561,24 @@ \bool_set_false:N \l__xparse_long_bool \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_g:w +\cs_new_protected:Npn \__xparse_add_expandable_type_g:w { \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { g } \__xparse_add_expandable_type_m:w } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_G:w #1 +\cs_new_protected:Npn \__xparse_add_expandable_type_G:w #1 { \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { G } \__xparse_add_expandable_type_m:w } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_k:w #1 +\cs_new_protected:Npn \__xparse_add_expandable_type_k:w #1 { \exp_args:NNo \__xparse_add_expandable_type_K:w #1 \c__xparse_no_value_tl } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_K:w #1#2 +\cs_new_protected:Npn \__xparse_add_expandable_type_K:w #1#2 { \__xparse_add_expandable_grabber_optional:n { K } \bool_if:NTF \l__xparse_all_long_bool @@ -594,13 +594,13 @@ \bool_set_false:N \l__xparse_long_bool \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_l:w +\cs_new_protected:Npn \__xparse_add_expandable_type_l:w { \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { l } \__xparse_add_expandable_type_m:w } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_m:w +\cs_new_protected:Npn \__xparse_add_expandable_type_m:w { \int_incr:N \l__xparse_m_args_int \__xparse_add_expandable_grabber_mandatory:n { m } @@ -624,7 +624,7 @@ \__xparse_add_expandable_type_D_aux:NNn #1#2 } } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_t:w #1 +\cs_new_protected:Npn \__xparse_add_expandable_type_t:w #1 { \__xparse_add_expandable_grabber_optional:n { t } \bool_if:NTF \l__xparse_all_long_bool @@ -639,19 +639,19 @@ \bool_set_false:N \l__xparse_long_bool \__xparse_prepare_signature:N } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_u:w #1 +\cs_new_protected:Npn \__xparse_add_expandable_type_u:w #1 { \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { u } \__xparse_add_expandable_type_m:w } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_v:w +\cs_new_protected:Npn \__xparse_add_expandable_type_v:w { \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { v } \__xparse_add_expandable_type_m:w } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_grabber_mandatory:n #1 +\cs_new_protected:Npn \__xparse_add_expandable_grabber_mandatory:n #1 { \__xparse_add_expandable_long_check: \tl_put_right:Nx \l__xparse_signature_tl @@ -659,7 +659,7 @@ \bool_set_false:N \l__xparse_long_bool \int_decr:N \l__xparse_mandatory_args_int } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_grabber_optional:n #1 +\cs_new_protected:Npn \__xparse_add_expandable_grabber_optional:n #1 { \__xparse_add_expandable_long_check: \int_compare:nNnF \l__xparse_mandatory_args_int > \c_zero @@ -668,7 +668,7 @@ { \exp_not:c { __xparse_expandable_grab_ #1 :w } } \bool_set_false:N \l__xparse_long_bool } -\cs_new_protected_nopar:Npn \__xparse_add_expandable_long_check: +\cs_new_protected:Npn \__xparse_add_expandable_long_check: { \bool_if:nT { \l__xparse_all_long_bool && ! \l__xparse_long_bool } { \__msg_kernel_error:nn { xparse } { inconsistent-long } } @@ -1010,12 +1010,12 @@ } \tl_new:N \l__xparse_v_rest_of_signature_tl \tl_new:N \l__xparse_v_arg_tl -\cs_new_protected_nopar:Npn \__xparse_grab_v:w +\cs_new_protected:Npn \__xparse_grab_v:w { \bool_set_false:N \l__xparse_long_bool \__xparse_grab_v_aux:w } -\cs_new_protected_nopar:Npn \__xparse_grab_v_long:w +\cs_new_protected:Npn \__xparse_grab_v_long:w { \bool_set_true:N \l__xparse_long_bool \__xparse_grab_v_aux:w @@ -1038,7 +1038,7 @@ { \__xparse_grab_v_aux_abort:n { } } } } -\cs_new_protected_nopar:Npn \__xparse_grab_v_group_end: +\cs_new_protected:Npn \__xparse_grab_v_group_end: { \group_align_safe_end: \exp_args:NNNo @@ -1074,14 +1074,14 @@ } { \__xparse_grab_v_aux_abort:n {#2} #2 } } -\cs_new_protected_nopar:Npn \__xparse_grab_v_aux_loop_end: +\cs_new_protected:Npn \__xparse_grab_v_aux_loop_end: { \__xparse_grab_v_group_end: \exp_args:Nx \__xparse_add_arg:n { \tl_tail:N \l__xparse_v_arg_tl } \l__xparse_v_rest_of_signature_tl \l__xparse_args_tl } \int_new:N \l__xparse_v_nesting_int -\cs_new_protected_nopar:Npx \__xparse_grab_v_bgroup: +\cs_new_protected:Npx \__xparse_grab_v_bgroup: { \exp_not:N \__xparse_grab_v_aux_catcodes: \exp_not:n { \int_set_eq:NN \l__xparse_v_nesting_int \c_one } @@ -1117,7 +1117,7 @@ } { \__xparse_grab_v_aux_abort:n {#1} #1 } } -\cs_new_protected_nopar:Npn \__xparse_grab_v_aux_catcodes: +\cs_new_protected:Npn \__xparse_grab_v_aux_catcodes: { \cs_set_eq:NN \do \char_set_catcode_other:N \dospecials @@ -1759,8 +1759,8 @@ \cs_new_eq:NN \IfNoValueF \__xparse_if_no_value:nF \cs_new_eq:NN \IfNoValueT \__xparse_if_no_value:nT \cs_new_eq:NN \IfNoValueTF \__xparse_if_no_value:nTF -\cs_new_nopar:Npn \IfValueF { \__xparse_if_no_value:nT } -\cs_new_nopar:Npn \IfValueT { \__xparse_if_no_value:nF } +\cs_new:Npn \IfValueF { \__xparse_if_no_value:nT } +\cs_new:Npn \IfValueT { \__xparse_if_no_value:nF } \cs_new:Npn \IfValueTF #1#2#3 { \__xparse_if_no_value:nTF {#1} {#3} {#2} } \tl_new:N \ProcessedArgument \cs_new_eq:NN \ReverseBoolean \__xparse_bool_reverse:N diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty index 04efdce2561..8f389e34ab5 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}[2016/05/18] -\@ifpackagelater{expl3}{2016/05/18} +\RequirePackage{expl3}[2016/10/19] +\@ifpackagelater{expl3}{2016/10/19} {} {% \PackageError{xtemplate}{Support package l3kernel too old} @@ -65,8 +65,8 @@ } \def\ExplFileName{xtemplate} \def\ExplFileDescription{L3 Experimental prototype document functions} -\def\ExplFileDate{2016/05/18} -\def\ExplFileVersion{6512} +\def\ExplFileDate{2016/10/19} +\def\ExplFileVersion{6730} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \tl_const:Nn \c__xtemplate_code_root_tl { template~code~>~ } @@ -295,7 +295,7 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_parse_keys_elt_aux:n #1 +\cs_new_protected:Npn \__xtemplate_parse_keys_elt_aux:n #1 { \str_if_eq:onT \l__xtemplate_keytype_tl {#1} { @@ -308,7 +308,7 @@ } } } -\cs_new_nopar:Npn \__xtemplate_parse_keys_elt_aux: +\cs_new:Npn \__xtemplate_parse_keys_elt_aux: { \tl_set:Nx \l__xtemplate_tmp_tl { @@ -377,7 +377,7 @@ { \tl_set:Nn \l__xtemplate_keytype_tl {#1} \tl_clear:N \l__xtemplate_keytype_arg_tl - \cs_set_protected_nopar:Npn \__xtemplate_split_keytype_arg_aux:n ##1 + \cs_set_protected:Npn \__xtemplate_split_keytype_arg_aux:n ##1 { \tl_if_in:nnT {#1} {##1} { @@ -398,8 +398,8 @@ \__xtemplate_split_keytype_arg_aux:n } \cs_generate_variant:Nn \__xtemplate_split_keytype_arg:n { o } -\cs_new_nopar:Npn \__xtemplate_split_keytype_arg_aux:n #1 { } -\cs_new_nopar:Npn \__xtemplate_split_keytype_arg_aux:w #1 \q_stop { } +\cs_new:Npn \__xtemplate_split_keytype_arg_aux:n #1 { } +\cs_new:Npn \__xtemplate_split_keytype_arg_aux:w #1 \q_stop { } \cs_new_protected:Npn \__xtemplate_store_value_boolean:n #1 { \__xtemplate_if_eval_now:nTF {#1} @@ -573,7 +573,7 @@ { \tl_to_str:n { #1 global #2 } } } } -\cs_new_protected_nopar:Npn \__xtemplate_create_variable:N #1 +\cs_new_protected:Npn \__xtemplate_create_variable:N #1 { \str_case:onF \l__xtemplate_keytype_tl { @@ -607,7 +607,7 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_implement_choices_default: +\cs_new_protected:Npn \__xtemplate_implement_choices_default: { \tl_set:Nx \l__xtemplate_tmp_tl { \l__xtemplate_key_name_tl \c_space_tl \l__xtemplate_tmp_tl } @@ -789,7 +789,7 @@ \__xtemplate_declare_instance_aux:nnnnn {#1} {#2} } \cs_generate_variant:Nn \__xtemplate_edit_instance_aux:nnnnn { no } -\cs_new_protected_nopar:Npn \__xtemplate_convert_to_assignments: +\cs_new_protected:Npn \__xtemplate_convert_to_assignments: { \tl_clear:N \l__xtemplate_assignments_tl \seq_map_function:NN \l__xtemplate_key_order_seq @@ -819,7 +819,7 @@ } } \cs_generate_variant:Nn \__xtemplate_convert_to_assignments_aux:nn { no } -\cs_new_protected_nopar:Npn \__xtemplate_find_global: +\cs_new_protected:Npn \__xtemplate_find_global: { \bool_set_false:N \l__xtemplate_global_bool \tl_if_in:onT \l__xtemplate_var_tl { global } @@ -843,13 +843,13 @@ \use:c { \c__xtemplate_code_root_tl #1 / #2 } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_boolean: +\cs_new_protected:Npn \__xtemplate_assign_boolean: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_boolean_aux:n { bool_gset } } { \__xtemplate_assign_boolean_aux:n { bool_set } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_boolean_aux:n #1 +\cs_new_protected:Npn \__xtemplate_assign_boolean_aux:n #1 { \__xtemplate_if_key_value:oTF \l__xtemplate_value_tl { @@ -869,7 +869,7 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_choice: +\cs_new_protected:Npn \__xtemplate_assign_choice: { \__xtemplate_assign_choice_aux:xF { \l__xtemplate_key_name_tl \c_space_tl \l__xtemplate_value_tl } @@ -886,7 +886,7 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_choice_aux:nF #1 +\cs_new_protected:Npn \__xtemplate_assign_choice_aux:nF #1 { \prop_get:NnNTF \l__xtemplate_vars_prop @@ -895,7 +895,7 @@ { \tl_put_right:No \l__xtemplate_assignments_tl \l__xtemplate_tmp_tl } } \cs_generate_variant:Nn \__xtemplate_assign_choice_aux:nF { x } -\cs_new_protected_nopar:Npn \__xtemplate_assign_code: +\cs_new_protected:Npn \__xtemplate_assign_code: { \tl_put_right:Nx \l__xtemplate_assignments_tl { @@ -905,13 +905,13 @@ } } \cs_new_protected:Npn \__xtemplate_assign_code:n #1 { } -\cs_new_protected_nopar:Npn \__xtemplate_assign_function: +\cs_new_protected:Npn \__xtemplate_assign_function: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_function_aux:N \cs_gset:Npn } { \__xtemplate_assign_function_aux:N \cs_set:Npn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_function_aux:N #1 +\cs_new_protected:Npn \__xtemplate_assign_function_aux:N #1 { \tl_put_right:Nx \l__xtemplate_assignments_tl { @@ -922,13 +922,13 @@ { \exp_not:o \l__xtemplate_value_tl } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_instance: +\cs_new_protected:Npn \__xtemplate_assign_instance: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_instance_aux:N \cs_gset_protected:Npn } { \__xtemplate_assign_instance_aux:N \cs_set_protected:Npn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_instance_aux:N #1 +\cs_new_protected:Npn \__xtemplate_assign_instance_aux:N #1 { \tl_put_right:Nx \l__xtemplate_assignments_tl { @@ -940,43 +940,43 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_integer: +\cs_new_protected:Npn \__xtemplate_assign_integer: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_variable:N \int_gset:Nn } { \__xtemplate_assign_variable:N \int_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_length: +\cs_new_protected:Npn \__xtemplate_assign_length: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_variable:N \dim_gset:Nn } { \__xtemplate_assign_variable:N \dim_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_muskip: +\cs_new_protected:Npn \__xtemplate_assign_muskip: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_variable:N \muskip_gset:Nn } { \__xtemplate_assign_variable:N \muskip_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_real: +\cs_new_protected:Npn \__xtemplate_assign_real: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_variable:N \fp_gset:Nn } { \__xtemplate_assign_variable:N \fp_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_skip: +\cs_new_protected:Npn \__xtemplate_assign_skip: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_variable:N \skip_gset:Nn } { \__xtemplate_assign_variable:N \skip_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_tokenlist: +\cs_new_protected:Npn \__xtemplate_assign_tokenlist: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_tokenlist_aux:NN \tl_gset:NV \tl_gset:Nn } { \__xtemplate_assign_tokenlist_aux:NN \tl_set:NV \tl_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_tokenlist_aux:NN #1#2 +\cs_new_protected:Npn \__xtemplate_assign_tokenlist_aux:NN #1#2 { \__xtemplate_if_key_value:oTF \l__xtemplate_value_tl { @@ -995,13 +995,13 @@ } } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_commalist: +\cs_new_protected:Npn \__xtemplate_assign_commalist: { \bool_if:NTF \l__xtemplate_global_bool { \__xtemplate_assign_tokenlist_aux:NN \clist_gset:NV \clist_gset:Nn } { \__xtemplate_assign_tokenlist_aux:NN \clist_set:NV \clist_set:Nn } } -\cs_new_protected_nopar:Npn \__xtemplate_assign_variable:N #1 +\cs_new_protected:Npn \__xtemplate_assign_variable:N #1 { \__xtemplate_if_key_value:oT \l__xtemplate_value_tl { \__xtemplate_key_to_value: } @@ -1011,7 +1011,7 @@ { \exp_not:o \l__xtemplate_value_tl } } } -\cs_new_protected_nopar:Npn \__xtemplate_key_to_value: +\cs_new_protected:Npn \__xtemplate_key_to_value: { \exp_after:wN \__xtemplate_key_to_value_auxi:w \l__xtemplate_value_tl } \cs_new_protected:Npn \__xtemplate_key_to_value_auxi:w \KeyValue #1 { @@ -1076,12 +1076,12 @@ \l__xtemplate_collection_tl { \tl_clear:N \l__xtemplate_collection_tl } } -\cs_new_nopar:Npn \__xtemplate_assignments_pop: { \l__xtemplate_assignments_tl } +\cs_new:Npn \__xtemplate_assignments_pop: { \l__xtemplate_assignments_tl } \cs_new_protected:Npn \__xtemplate_assignments_push:n #1 { \tl_set:Nn \l__xtemplate_assignments_tl {#1} } -\cs_new_protected_nopar:Npn \__xtemplate_show_code:nn #1#2 +\cs_new_protected:Npn \__xtemplate_show_code:nn #1#2 { \cs_show:c { \c__xtemplate_code_root_tl #1 / #2 } } -\cs_new_protected_nopar:Npn \__xtemplate_show_defaults:nn #1#2 +\cs_new_protected:Npn \__xtemplate_show_defaults:nn #1#2 { \__xtemplate_if_keys_exist:nnT {#1} {#2} { @@ -1090,7 +1090,7 @@ {#1} {#2} { default~values } } } -\cs_new_protected_nopar:Npn \__xtemplate_show_keytypes:nn #1#2 +\cs_new_protected:Npn \__xtemplate_show_keytypes:nn #1#2 { \__xtemplate_if_keys_exist:nnT {#1} {#2} { @@ -1099,7 +1099,7 @@ {#1} {#2} { interface } } } -\cs_new_protected_nopar:Npn \__xtemplate_show_vars:nn #1#2 +\cs_new_protected:Npn \__xtemplate_show_vars:nn #1#2 { \__xtemplate_execute_if_code_exist:nnT {#1} {#2} { @@ -1108,7 +1108,7 @@ {#1} {#2} { variable~mapping } } } -\cs_new_protected_nopar:Npn \__xtemplate_show:Nnnn #1#2#3#4 +\cs_new_protected:Npn \__xtemplate_show:Nnnn #1#2#3#4 { \__msg_show_pre:nnnnnn { xtemplate } { \prop_if_empty:NTF #1 { show-no-attribute } { show-attribute } } @@ -1116,7 +1116,7 @@ \__msg_show_wrap:n { \prop_map_function:NN #1 \__msg_show_item_unbraced:nn } } -\cs_new_protected_nopar:Npn \__xtemplate_show_values:nnn #1#2#3 +\cs_new_protected:Npn \__xtemplate_show_values:nnn #1#2#3 { \__xtemplate_if_instance_exist:nnnT {#1} {#2} {#3} { @@ -1341,7 +1341,7 @@ \tl_if_empty:nF {#4} { (from~template~'#4')~ } has~values: } -\cs_new_protected_nopar:Npn \DeclareObjectType #1#2 +\cs_new_protected:Npn \DeclareObjectType #1#2 { \__xtemplate_declare_object_type:nn {#1} {#2} } \cs_new_protected:Npn \DeclareTemplateInterface #1#2#3#4 { \__xtemplate_declare_template_keys:nnnn {#1} {#2} {#3} {#4} } @@ -1359,33 +1359,33 @@ { \__xtemplate_edit_instance:nnnn {#1} { } {#2} {#3} } \cs_new_protected:Npn \EditCollectionInstance #1#2#3#4 { \__xtemplate_edit_instance:nnnn {#2} {#1} {#3} {#4} } -\cs_new_protected_nopar:Npn \UseTemplate #1#2#3 +\cs_new_protected:Npn \UseTemplate #1#2#3 { \__xtemplate_use_template:nnn {#1} {#2} {#3} } -\cs_new_protected_nopar:Npn \UseInstance #1#2 +\cs_new_protected:Npn \UseInstance #1#2 { \__xtemplate_use_instance:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \UseCollection #1#2 +\cs_new_protected:Npn \UseCollection #1#2 { \__xtemplate_use_collection:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \ShowTemplateCode #1#2 +\cs_new_protected:Npn \ShowTemplateCode #1#2 { \__xtemplate_show_code:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \ShowTemplateDefaults #1#2 +\cs_new_protected:Npn \ShowTemplateDefaults #1#2 { \__xtemplate_show_defaults:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \ShowTemplateInterface #1#2 +\cs_new_protected:Npn \ShowTemplateInterface #1#2 { \__xtemplate_show_keytypes:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \ShowTemplateVariables #1#2 +\cs_new_protected:Npn \ShowTemplateVariables #1#2 { \__xtemplate_show_vars:nn {#1} {#2} } -\cs_new_protected_nopar:Npn \ShowInstanceValues #1#2 +\cs_new_protected:Npn \ShowInstanceValues #1#2 { \__xtemplate_show_values:nnn {#1} { } {#2} } -\cs_new_protected_nopar:Npn \ShowCollectionInstanceValues #1#2#3 +\cs_new_protected:Npn \ShowCollectionInstanceValues #1#2#3 { \__xtemplate_show_values:nnn {#1} {#2} {#3} } -\cs_new_nopar:Npn \IfInstanceExistTF #1#2 +\cs_new:Npn \IfInstanceExistTF #1#2 { \__xtemplate_if_instance_exist:nnnTF {#1} { } {#2} } -\cs_new_nopar:Npn \IfInstanceExistT #1#2 +\cs_new:Npn \IfInstanceExistT #1#2 { \__xtemplate_if_instance_exist:nnnT {#1} { } {#2} } -\cs_new_nopar:Npn \IfInstanceExistF #1#2 +\cs_new:Npn \IfInstanceExistF #1#2 { \__xtemplate_if_instance_exist:nnnF {#1} { } {#2} } \cs_new_protected:Npn \EvaluateNow #1 {#1} \cs_new_protected:Npn \KeyValue #1 {#1} -\cs_new_protected_nopar:Npn \AssignTemplateKeys +\cs_new_protected:Npn \AssignTemplateKeys { \__xtemplate_assignments_pop: } \cs_new_eq:NN \ShowTemplateKeytypes \ShowTemplateInterface %% |