diff options
author | Karl Berry <karl@freefriends.org> | 2022-01-12 21:22:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-01-12 21:22:19 +0000 |
commit | 5e6c36a86d4bca486465e216ffd216bfd57a106f (patch) | |
tree | d1f502b8f22f80c9344f85249e076aaee4ba75e8 /Master/texmf-dist/source | |
parent | 81b17c3a69bb1b2f93e5ca4b114be5098da9b6d8 (diff) |
l3 (12jan22)
git-svn-id: svn://tug.org/texlive/trunk@61588 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
76 files changed, 1211 insertions, 909 deletions
diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-basics.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-basics.dtx index 48a8673e390..cc3ca4c9253 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-basics.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-basics.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-basics.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % @@ -70,27 +70,27 @@ % \begin{macrocode} \ProvidesExplFile %<*dvipdfmx> - {l3backend-dvipdfmx.def}{2021-12-14}{} + {l3backend-dvipdfmx.def}{2022-01-12}{} {L3 backend support: dvipdfmx} %</dvipdfmx> %<*dvips> - {l3backend-dvips.def}{2021-12-14}{} + {l3backend-dvips.def}{2022-01-12}{} {L3 backend support: dvips} %</dvips> %<*dvisvgm> - {l3backend-dvisvgm.def}{2021-12-14}{} + {l3backend-dvisvgm.def}{2022-01-12}{} {L3 backend support: dvisvgm} %</dvisvgm> %<*luatex> - {l3backend-luatex.def}{2021-12-14}{} + {l3backend-luatex.def}{2022-01-12}{} {L3 backend support: PDF output (LuaTeX)} %</luatex> %<*pdftex> - {l3backend-pdftex.def}{2021-12-14}{} + {l3backend-pdftex.def}{2022-01-12}{} {L3 backend support: PDF output (pdfTeX)} %</pdftex> %<*xetex> - {l3backend-xetex.def}{2021-12-14}{} + {l3backend-xetex.def}{2022-01-12}{} {L3 backend support: XeTeX} %</xetex> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-box.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-box.dtx index 29a20a8ceb0..5dcafc8c88d 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-box.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-box.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-box.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-color.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-color.dtx index b9185ea80ba..6bf3a809760 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-color.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-color.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-color.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % @@ -377,7 +377,6 @@ %<*dvips> \__kernel_backend_postscript:n { /color.sc ~ { } ~ def } %</dvips> - \group_insert_after:N \@@_backend_reset: } \cs_new_protected:Npn \@@_backend_reset: { \__kernel_backend_literal:n { color~pop } } @@ -424,7 +423,6 @@ \tl_set:Nn \l_@@_backend_fill_tl {#1} \tl_set:Nn \l_@@_backend_stroke_tl {#2} \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int { #1 ~ #2 } - \group_insert_after:N \@@_backend_reset: } \cs_new_protected:Npn \@@_backend_reset: { \__kernel_color_backend_stack_pop:n \l_@@_backend_stack_int } @@ -463,10 +461,7 @@ \int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 } { \cs_gset_protected:Npn \@@_backend_select_cmyk:n #1 - { - \__kernel_backend_literal:n { pdf: bc ~ [#1] } - \group_insert_after:N \@@_backend_reset: - } + { \__kernel_backend_literal:n { pdf: bc ~ [#1] } } \cs_gset_eq:NN \@@_backend_select_gray:n \@@_backend_select_cmyk:n \cs_gset_eq:NN \@@_backend_select_rgb:n \@@_backend_select_cmyk:n \cs_gset_protected:Npn \@@_backend_reset: diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-draw.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-draw.dtx index 6a9ac910c3b..41466652e17 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-draw.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-draw.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-draw.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-graphics.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-graphics.dtx index 57cac24006e..63d01c70f32 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-graphics.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-graphics.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-graphics.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-header.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-header.dtx index 6692fec9bf0..2e484987926 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-header.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-header.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-header.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-opacity.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-opacity.dtx index ed811bd7b7f..d401e247352 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-opacity.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-opacity.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-opacity.dtx % -% Copyright (C) 2021 The LaTeX Project +% Copyright (C) 2021,2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend-pdf.dtx b/Master/texmf-dist/source/latex/l3backend/l3backend-pdf.dtx index 2d09226bf11..f9d12695e46 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend-pdf.dtx +++ b/Master/texmf-dist/source/latex/l3backend/l3backend-pdf.dtx @@ -2,7 +2,7 @@ % %% File: l3backend-pdf.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-12-14} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3backend/l3backend.ins b/Master/texmf-dist/source/latex/l3backend/l3backend.ins index 8e316be0f04..c08a111ab6c 100644 --- a/Master/texmf-dist/source/latex/l3backend/l3backend.ins +++ b/Master/texmf-dist/source/latex/l3backend/l3backend.ins @@ -2,7 +2,7 @@ File l3backend.ins -Copyright (C) 2019-2021 The LaTeX Project +Copyright (C) 2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -35,7 +35,7 @@ license information is placed in the derived files. \preamble -Copyright (C) 2019-2021 The LaTeX Project +Copyright (C) 2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 21b528db1e3..b8cc780f0c9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -2,7 +2,7 @@ % %% File: expl3.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2021-11-22}% +\def\ExplFileDate{2022-01-12}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -897,12 +897,6 @@ % the option name alone is equivalent to using the option with the % \texttt{true} value. % -% \DescribeOption{undo-recent-deprecations} -% The \texttt{undo-recent-deprecations} option suppresses deprecation -% errors for the first six months after a command is deprecated. It is -% intended as a last resort measure for users of packages that were not -% updated in time. -% % \DescribeOption{check-declarations} % All variables used in \pkg{expl3} code should be declared. This is enforced % by \TeX{} for variable types based on \TeX{} registers, but not for those @@ -1408,11 +1402,7 @@ suppress-backend-headers .bool_gset_inverse:N = \g__kernel_backend_header_bool , suppress-backend-headers .initial:n = false , - undo-recent-deprecations .code:n = - { - \bool_gset_true:N \g__kernel_deprecation_undo_recent_bool - \sys_load_deprecation: - } + undo-recent-deprecations .code:n = {} % A stub } % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins index 265fde8ac9e..fbcc815d9f0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins @@ -2,7 +2,7 @@ File l3.ins -Copyright (C) 2011,2012,2014-2021 The LaTeX Project +Copyright (C) 2011,2012,2014-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -35,7 +35,7 @@ license information is placed in the derived files. \preamble -Copyright (C) 1990-2021 The LaTeX Project +Copyright (C) 1990-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of @@ -109,7 +109,7 @@ and all files in that bundle must be distributed together. \from{l3text-purify.dtx}{package} \from{l3candidates.dtx} {package} \from{l3legacy.dtx} {package} - \from{l3deprecation.dtx}{package,kernel} + \from{l3deprecation.dtx}{package} } } @@ -141,7 +141,6 @@ and all files in that bundle must be distributed together. } \generate{\file{l3debug.def} {\from{l3debug.dtx} {package}}} -\generate{\file{l3deprecation.def}{\from{l3deprecation.dtx}{package,patches}}} \generate{\file{l3docstrip.tex} {\from{l3docstrip.dtx} {program}}} @@ -152,7 +151,7 @@ and all files in that bundle must be distributed together. \def\MetaPrefix{--} \preamble -Copyright (C) 1990-2021 The LaTeX Project +Copyright (C) 1990-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 9b2e96aa901..d986ce162d2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -2,7 +2,7 @@ % %% File: l3basics.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 5303ec59431..56aa0da33ee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -2,7 +2,7 @@ % %% File: l3bootstrap.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index d0d647be84a..7159cb08c4e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -2,7 +2,7 @@ % %% File: l3box.dtx % -% Copyright (C) 2005-2021 The LaTeX Project +% Copyright (C) 2005-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index a9c9dee7f09..df95ed2051e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -2,7 +2,7 @@ % %% File: l3candidates.dtx % -% Copyright (C) 2012-2021 The LaTeX Project +% Copyright (C) 2012-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx index b8202b75348..4c74e3bde53 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3cctab.dtx @@ -2,7 +2,7 @@ % %% File: l3cctab.dtx % -% Copyright (C) 2018-2021 The LaTeX Project +% Copyright (C) 2018-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx index a8231410547..c91922e6a76 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx @@ -3,7 +3,7 @@ %% File: l3clist.dtx % % Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX Project -% (C) 2012-2021 The LaTeX Project +% (C) 2012-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -315,7 +315,9 @@ % \begin{function}[updated = 2011-09-06] % { % \clist_remove_all:Nn, \clist_remove_all:cn, -% \clist_gremove_all:Nn, \clist_gremove_all:cn +% \clist_remove_all:NV, \clist_remove_all:cV, +% \clist_gremove_all:Nn, \clist_gremove_all:cn, +% \clist_gremove_all:NV, \clist_gremove_all:cV % } % \begin{syntax} % \cs{clist_remove_all:Nn} \meta{comma list} \Arg{item} @@ -1407,9 +1409,17 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\clist_remove_all:Nn, \clist_remove_all:cn} +% \begin{macro} +% { +% \clist_remove_all:Nn, \clist_remove_all:cn, +% \clist_remove_all:NV, \clist_remove_all:cV +% } % \UnitTested -% \begin{macro}{\clist_gremove_all:Nn, \clist_gremove_all:cn} +% \begin{macro} +% { +% \clist_gremove_all:Nn, \clist_gremove_all:cn, +% \clist_gremove_all:NV, \clist_remove_all:cV +% } % \UnitTested % \begin{macro}{\@@_remove_all:NNNn} % \begin{macro}{\@@_remove_all:w} @@ -1482,8 +1492,8 @@ \cs_new:Npn \@@_remove_all: { \exp_after:wN \@@_remove_all:w \@@_tmp:w , } \cs_new:Npn \@@_remove_all:w #1 , \s_@@_mark , #2 , { \exp_not:n {#1} } -\cs_generate_variant:Nn \clist_remove_all:Nn { c } -\cs_generate_variant:Nn \clist_gremove_all:Nn { c } +\cs_generate_variant:Nn \clist_remove_all:Nn { c , NV , cV } +\cs_generate_variant:Nn \clist_gremove_all:Nn { c , NV , cV } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 56c296c1759..38e9cf23399 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -2,7 +2,7 @@ % %% File: l3coffins.dtx % -% Copyright (C) 2010-2021 The LaTeX Project +% Copyright (C) 2010-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx index f77304a0a5c..c6c8eb32625 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx @@ -2,7 +2,7 @@ % %% File: l3color.dtx % -% Copyright (C) 2017-2021 The LaTeX Project +% Copyright (C) 2017-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -249,6 +249,9 @@ % General selection of color is safe when split across pages: a stack is % used to ensure that the correct color is re-selected on the new page. % +% These commands set the current color (|.|): other more specialised functions +% such as fill and stroke selectors do \emph{not} adjust this value. +% % \begin{function}{\color_select:n} % \begin{syntax} % \cs{color_select:n} \Arg{color expression} @@ -281,9 +284,6 @@ % support this, and so color will need to be contained within a scope, such % as \cs{draw_begin:}/\cs{draw_end:}. % -% Note that the \emph{current color} is the fill color, as this is used for -% running text. -% % \begin{function}{\color_fill:n, \color_stroke:n} % \begin{syntax} % \cs{color_fill:n} \Arg{color expression} @@ -538,12 +538,15 @@ % \begin{macro}{\@@_select:nn} % Take an internal color specification and pass it to the driver. This code % is needed to ensure the current color but will also be used by the -% higher-level experimental material. +% higher-level material. % \begin{macrocode} \cs_new_protected:Npn \@@_select:N #1 { \exp_after:wN \@@_select:nn #1 } \cs_new_protected:Npn \@@_select:nn #1#2 - { \use:c { @@_backend_select_ #1 :n } {#2} } + { + \use:c { @@_backend_select_ #1 :n } {#2} + \group_insert_after:N \@@_backend_reset: + } % \end{macrocode} % \end{macro} % \end{macro} @@ -595,7 +598,7 @@ % % \subsection{Utility functions} % -% \begin{macro}[int, TF, EXP]{\@@_if_defined:n} +% \begin{macro}[TF, EXP]{\@@_if_defined:n} % A simple wrapper to avoid needing to have the lookup repeated in too many % places. % \begin{macrocode} @@ -632,33 +635,63 @@ % % \begin{macro}{\@@_convert:nnN, \@@_convert:VVN} % \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN} -% \begin{macro}[aux, EXP] +% \begin{macro}[EXP] % { +% \@@_convert_gray_gray:w % \@@_convert_gray_rgb:w % \@@_convert_gray_cmyk:w % \@@_convert_cmyk_gray:w % \@@_convert_cmyk_rgb:w +% \@@_convert_cmyk_cmyk:w % \@@_convert_rgb_gray:w +% \@@_convert_rgb_rgb:w % \@@_convert_rgb_cmyk:w % } -% \begin{macro}[aux, EXP]{\@@_convert_rgb_cmyk:nnnn} -% Model conversion is carried out using standard formulae, as described in -% the manual for \pkg{xcolor} (see also the \emph{PostScript Language -% Reference Manual}). +% \begin{macro}[EXP]{\@@_convert_rgb_cmyk:nnnn} +% Model conversion is carried out using standard formulae for base models, +% as described in the manual for \pkg{xcolor} (see also the \emph{PostScript +% Language Reference Manual}). For other models direct conversion might not +% be defined, so we go through the fallback models if necessary. % \begin{macrocode} \cs_new_protected:Npn \@@_convert:nnN #1#2#3 { \@@_convert:nnVN {#1} {#2} #3 #3 } \cs_generate_variant:Nn \@@_convert:nnN { VV } +\cs_generate_variant:Nn \exp_last_unbraced:Nf { c } \cs_new_protected:Npn \@@_convert:nnnN #1#2#3#4 { \tl_set:Nx #4 { - \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w } - { \use:c { @@_convert_ #1 _ #2 :w } #3 \s_@@_stop } - { \use:c { c_@@_fallback_ #2 _tl } } + \cs_if_exist_use:cTF { @@_convert_ #1 _ #2 :w } + { #3 \s_@@_stop } + { + \cs_if_exist:cTF { @@_convert_ \use:c { c_@@_fallback_ #1 _tl } _ #2 :w } + { + \exp_last_unbraced:cf + { @@_convert_ \use:c { c_@@_fallback_ #1 _tl } _ #2 :w } + { \use:c { @@_convert_ #1 _ \use:c { c_@@_fallback_ #1 _tl } :w } #3 \s_@@_stop } + \s_@@_stop + } + { + \exp_last_unbraced:cf + { @@_convert_ \use:c { c_@@_fallback_ #2 _tl } _ #2 :w } + { + \cs_if_exist_use:cTF { @@_convert_ #1 _ \use:c { c_@@_fallback_ #2 _tl } :w } + { #3 \s_@@_stop } + { + \exp_last_unbraced:cf + { @@_convert_ \use:c { c_@@_fallback_ #1 _tl } _ \use:c { c_@@_fallback_ #2 _tl } :w } + { \use:c { @@_convert_ #1 _ \use:c { c_@@_fallback_ #1 _tl } :w } #3 \s_@@_stop } + \s_@@_stop + } + } + \s_@@_stop + } + } } } \cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV } +\cs_new:Npn \@@_convert_gray_gray:w #1 \s_@@_stop + { #1 } \cs_new:Npn \@@_convert_gray_rgb:w #1 \s_@@_stop { #1 ~ #1 ~ #1 } \cs_new:Npn \@@_convert_gray_cmyk:w #1 \s_@@_stop @@ -669,6 +702,8 @@ % \begin{macrocode} \cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 \s_@@_stop { \fp_eval:n { 0.3 * #1 + 0.59 * #2 + 0.11 * #3 } } +\cs_new:Npn \@@_convert_rgb_rgb:w #1 \s_@@_stop + { #1 } % \end{macrocode} % The conversion from |rgb| to |cmyk| is the most complex: a two-step % procedure which requires \emph{black generation} and \emph{undercolor @@ -697,6 +732,8 @@ \fp_eval:n { 1 - min ( 1 , #2 + #4 ) } \c_space_tl \fp_eval:n { 1 - min ( 1 , #3 + #4 ) } } +\cs_new:Npn \@@_convert_cmyk_cmyk:w #1 \s_@@_stop + { #1 } % \end{macrocode} % \end{macro} % \end{macro} @@ -728,9 +765,9 @@ % \begin{macro}{\@@_parse_gray:n, \@@_parse_std:n} % \begin{macro}{\@@_parse_break:w} % \begin{macro}{\@@_parse_end:} -% \begin{macro}[aux, EXP]{\@@_parse_mix:Nnnn, \@@_parse_mix:NVVn} -% \begin{macro}[aux, EXP]{\@@_parse_mix:nNnn} -% \begin{macro}[aux, EXP] +% \begin{macro}[EXP]{\@@_parse_mix:Nnnn, \@@_parse_mix:NVVn} +% \begin{macro}[EXP]{\@@_parse_mix:nNnn} +% \begin{macro}[EXP] % { % \@@_parse_mix_gray:nw , % \@@_parse_mix_rgb:nw , @@ -1222,13 +1259,13 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_select:} +% \begin{macro}{\@@_finalise_current:} % A backend-neutral location for \enquote{last minute} manipulations before % handing off to the backend code. We set the special |.| syntax here: this % will therefore always be available. The finalisation is separate from the % main function so it can also be applied to \emph{e.g.}~page color. % \begin{macrocode} -\cs_new_protected:Npx \@@_select: +\cs_new_protected:Npx \@@_finalise_current: { \tl_set:Nx \exp_not:c { l_@@_named_ . _tl } { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl } @@ -1236,7 +1273,6 @@ \prop_put:NVx \exp_not:c { l_@@_named_ . _prop } \exp_not:c { l_@@_named_ . _tl } { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl } - \@@_select:N \exp_not:N \l_@@_current_tl } % \end{macrocode} % \end{macro} @@ -1254,13 +1290,15 @@ \cs_new_protected:Npn \color_select:n #1 { \@@_parse:nN {#1} \l_@@_current_tl - \@@_select: + \@@_finalise_current: + \@@_select:N \l_@@_current_tl } \cs_new_protected:Npn \color_select:nn #1#2 { \@@_select_main:Nw \l_@@_current_tl #1 / / \s_@@_mark #2 / / \s_@@_stop - \@@_select: + \@@_finalise_current: + \@@_select:N \l_@@_current_tl } % \end{macrocode} % If the first color model is the fixed one, or if there is no fixed @@ -1692,12 +1730,12 @@ % % \begin{variable} % {\c_@@_fallback_cmyk_tl, \c_@@_fallback_gray_tl, \c_@@_fallback_rgb_tl} -% Conversion from Separation or DeviceN spaces may not be possible; have -% a fallback to black. +% For every colorspace, we define one of the base colorspaces as a fallback. +% The base colorspaces themselves are their own fallback. % \begin{macrocode} -\tl_const:Nn \c_@@_fallback_cmyk_tl { 0 ~ 0 ~ 0 ~ 1 } -\tl_const:Nn \c_@@_fallback_gray_tl { 1 } -\tl_const:Nn \c_@@_fallback_rgb_tl { 1 ~ 1 ~ 1 } +\tl_const:Nn \c_@@_fallback_cmyk_tl { cmyk } +\tl_const:Nn \c_@@_fallback_gray_tl { gray } +\tl_const:Nn \c_@@_fallback_rgb_tl { rgb } % \end{macrocode} % \end{variable} % @@ -1803,14 +1841,13 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_model_init:nn} +% \begin{macro}{\@@_model_init:nnnn, \@@_model_init:nnnx} % A shared auxiliary to do the basics of setting up a new model: reserve a -% number, create a fallback and white-equivalent, set up links to the backend. +% number, create a white-equivalent, set up links to the backend. % \begin{macrocode} -\cs_new_protected:Npn \@@_model_init:nnnnn #1#2#3#4#5 +\cs_new_protected:Npn \@@_model_init:nnnn #1#2#3#4 { \int_gincr:N \g_@@_model_int - \tl_const:cn { c_@@_fallback_ #1 _tl } { #4 } \clist_map_inline:nn { fill , stroke , select } { \cs_new_protected:cpx { @@_backend_ ##1 _ #1 :n } ####1 @@ -1822,23 +1859,13 @@ \cs_new_protected:cpx { @@_model_ #1 _white: } { \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#1} - { \exp_not:n {#5} } + { \exp_not:n {#4} } \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0 { \group_insert_after:N \exp_not:c { @@_model_ #1 _ white: } } } \use:c { @@_model_ #1 _white: } } -\cs_generate_variant:Nn \@@_model_init:nnnnn { nnnxx } -\cs_new_protected:Npn \@@_model_init:nnn #1#2#3 - { - \@@_model_init:nnnxx { #1 } { #2 } { #3 } - { - 1 \prg_replicate:nn { #2 - 1 } { ~ 1 } - } - { - 0 \prg_replicate:nn { #2 - 1 } { ~ 0 } - } - } +\cs_generate_variant:Nn \@@_model_init:nnnn { nnnx } % \end{macrocode} % \end{macro} % @@ -1921,7 +1948,7 @@ \cs_new_protected:Npn \@@_model_separation:w #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7#8 { - \@@_model_init:nnn {#6} { 1 } { separation } + \@@_model_init:nnnn {#6} { 1 } { separation } { 0 } \cs_new_eq:cN { @@_parse_mix_ #6 :nw } \@@_parse_mix_gray:nw \cs_new:cpn { @@_parse_model_ #6 :w } ##1 , ##2 \s_@@_stop { {#6} { \@@_parse_number:n {##1} } } @@ -1933,6 +1960,7 @@ } \cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6 { + \tl_const:cn { c_@@_fallback_ #1 _tl } { cmyk } \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ @@ -1940,43 +1968,31 @@ \fp_eval:n {##1 * #5} ~ \fp_eval:n {##1 * #6} } - \@@_model_convert:nnn {#1} { cmyk } { rgb } - \@@_model_convert:nnn {#1} { cmyk } { gray } + \cs_new:cpn { @@_convert_cmyk_ #1 :w } ##1 \s_@@_stop { 1 } \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 , #6 } \@@_backend_separation_init:nnnnn {#2} { /DeviceCMYK } { } { 0 ~ 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 ~ #6 } } \cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6 { + \tl_const:cn { c_@@_fallback_ #1 _tl } { rgb } \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #4} ~ \fp_eval:n {##1 * #5} } - \@@_model_convert:nnn {#1} { rgb } { cmyk } - \@@_model_convert:nnn {#1} { rgb } { gray } + \cs_new:cpn { @@_convert_rgb_ #1 :w } ##1 \s_@@_stop { 1 } \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 } \@@_backend_separation_init:nnnnn {#2} { /DeviceRGB } { } { 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 } } \cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} - } + \tl_const:cn { c_@@_fallback_ #1 _tl } { gray } \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} - } + \cs_new:cpn { @@_convert_gray_ #1 :w } ##1 \s_@@_stop { 1 } \prop_gput:Nnn \g_@@_alternative_values_prop {#1} {#3} \@@_backend_separation_init:nnnnn {#2} { /DeviceGray } { } { 0 } {#3} } @@ -2013,19 +2029,18 @@ % If a CIELAB space is being set up, we need the illuminant, then create % the appropriate set up. At present, this doesn't include \texttt{BlackPoint} % or \texttt{Range} data, but that may be added later. As CIELAB colors -% cannot be converted to anything else, we fallback to producing black: the -% user should set up a second model for colors set up this way. +% cannot be converted to anything else, we fallback to producing black in the +% gray colorspace: the user should set up a second model for colors set up this way. % \begin{macrocode} \cs_new_protected:Npn \@@_model_separation_CIELAB:nnnnnnn #1#2#3#4#5#6#7 { \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl } { \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 } - \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 \s_@@_stop - { 0 ~ 0 ~ 0 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 \s_@@_stop - { 1 ~ 1 ~ 1 } + \tl_const:cn { c_@@_fallback_ #2 _tl } { gray } \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 \s_@@_stop + { 0 } + \cs_new:cpn { @@_convert_gray_ #2 :w } ##1 \s_@@_stop { 1 } } { @@ -2162,12 +2177,18 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_model_devicen:nnnn #1#2#3#4 { - \@@_model_init:nnn {#4} {#1} { devicen } + \@@_model_init:nnnx {#4} {#1} { devicen } + { + 0 \prg_replicate:nn { #1 - 1 } { ~ 0 } + } \cs_if_exist_use:cF { @@_model_devicen_parse_ #1 :nn } { \@@_model_devicen_parse_generic:nn } {#4} {#1} \@@_model_devicen_init:nnn {#1} {#2} {#3} - \@@_model_devicen_convert:nnn {#4} {#2} {#3} + \@@_model_devicen_convert:nnnx {#4} {#2} {#3} + { + 1 \prg_replicate:nn { #1 - 1 } { ~ 1 } + } } % \end{macrocode} % For short lists of DeviceN colors, we can use hand-tuned parsing. This @@ -2382,30 +2403,29 @@ % to other parameter-based spaces. Essentially the approach is exactly the same % as the PostScript, just expressed in \TeX{} terms. % \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen_convert:nnn #1#2#3 +\cs_new_protected:Npn \@@_model_devicen_convert:nnnn #1#2#3 { - \use:c { @@_model_devicen_convert_ #2 :nn } {#1} {#3} + \use:c { @@_model_devicen_convert_ #2 :nnn } {#1} {#3} } -\cs_new_protected:Npn \@@_model_devicen_convert_cmyk:nn #1#2 +\cs_generate_variant:Nn \@@_model_devicen_convert:nnnn { nnnx } +\cs_new_protected:Npn \@@_model_devicen_convert_cmyk:nnn #1#2 { - \@@_model_convert:nnn {#1} { cmyk } { gray } - \@@_model_convert:nnn {#1} { cmyk } { rgb } - \@@_model_devicen_convert:nnnn {#1} { cmyk } { 4 } {#2} + \tl_const:cn { c_@@_fallback_ #1 _tl } { cmyk } + \@@_model_devicen_convert:nnnnn {#1} { cmyk } { 4 } {#2} } -\cs_new_protected:Npn \@@_model_devicen_convert_gray:nn #1#2 +\cs_new_protected:Npn \@@_model_devicen_convert_gray:nnn #1#2 { - \@@_model_convert:nnn {#1} { gray } { cmyk } - \@@_model_convert:nnn {#1} { gray } { rgb } - \@@_model_devicen_convert:nnnn {#1} { gray } { 1 } {#2} + \tl_const:cn { c_@@_fallback_ #1 _tl } { gray } + \@@_model_devicen_convert:nnnnn {#1} { gray } { 1 } {#2} } -\cs_new_protected:Npn \@@_model_devicen_convert_rgb:nn #1#2 +\cs_new_protected:Npn \@@_model_devicen_convert_rgb:nnn #1#2 { - \@@_model_convert:nnn {#1} { rgb } { cmyk } - \@@_model_convert:nnn {#1} { rgb } { gray } - \@@_model_devicen_convert:nnnn {#1} { rgb } { 3 } {#2} + \tl_const:cn { c_@@_fallback_ #1 _tl } { rgb } + \@@_model_devicen_convert:nnnnn {#1} { rgb } { 3 } {#2} } -\cs_new_protected:Npn \@@_model_devicen_convert:nnnn #1#2#3#4 +\cs_new_protected:Npn \@@_model_devicen_convert:nnnnn #1#2#3#4#5 { + \cs_new:cpn { @@_convert_ #2 _ #1 :w } ##1 \s_@@_stop {#5} \cs_new:cpx { @@_convert_ #1 _ #2 :w } ##1 \s_@@_stop { \exp_not:c { @@_convert_devicen_ #2 : \prg_replicate:nn {#3} { n } w } @@ -2607,7 +2627,10 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_model_iccbased_aux:nnnnnn #1#2#3#4#5#6 { - \@@_model_init:nnnnn {#5} {#1} { iccbased } {#2} {#3} + \@@_model_init:nnnn {#5} {#1} { iccbased } {#3} + \tl_const:cn { c_@@_fallback_ #5 _tl } { gray } + \cs_new:cpn { @@_convert_ #5 _gray:w } ##1 \s_@@_stop { 0 } + \cs_new:cpn { @@_convert_gray_ #5 :w } ##1 \s_@@_stop { #2 } \use:c { @@_model_devicen_parse_ #1 :nn } {#5} {#1} \exp_args:Nx \@@_backend_iccbased_init:nnn { \file_full_name:n {#6} } {#1} {#4} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx index e9bf590f29e..04fee8a23c7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3debug.dtx @@ -2,7 +2,7 @@ % %% File: l3debug.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx index 903c8280bc4..f4123a42c2c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx @@ -2,7 +2,7 @@ % %% File: l3deprecation.dtx % -% Copyright (C) 2017-2021 The LaTeX Project +% Copyright (C) 2017-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -54,31 +54,6 @@ % A few commands have had to be deprecated over the years. This module % defines deprecated and deleted commands to produce an error. % -% The life of a deprecated command has several stages. -% \begin{itemize} -% \item When we decide it should be eventually removed the command's -% definition is put in this file \pkg{l3deprecation.dtx} and the name -% of the command is added to the list in \pkg{l3obsolete.txt}. The -% command remains defined by default for $12$ or more months, -% typically until the end of a year. During that time, if \pkg{expl3} -% is loaded with any of the options \texttt{check-declarations} or -% \texttt{log-functions} or \texttt{enable-debug} typically used in -% package test files, the command will produce a warning. -% \item Then by default the command produces an error for all users, -% which can be suppressed for $6$ months through the option -% \texttt{undo-recent-deprecations}. -% \item After this $6$-month grace period, the command irreversibly -% produces an error. Its original definition can then be removed from -% the sources, leaving only the error definition. In -% \pkg{l3obsolete.txt} its name is moved from the \enquote{Deprecated -% functions and variables} list to the \enquote{Removed functions and -% variables} list. -% \end{itemize} -% Package authors are encouraged to have a test file with -% \cs{debug_on:n} |{deprecation}|, which makes commands at all stages of -% this list into errors. This helps detect uses of deprecated commands -% before user complain. -% % \end{documentation} % % \begin{implementation} @@ -90,97 +65,9 @@ % \end{macrocode} % % \begin{macrocode} -%<*kernel> -% \end{macrocode} -% -% \begin{macrocode} %<@@=deprecation> % \end{macrocode} % -% \subsection{Helpers and variables} -% -% \begin{variable}{\l_@@_grace_period_bool} -% This is set to \texttt{true} when the deprecated command that is -% being defined is in its grace period, meaning between the time it -% becomes an error by default and the time $6$~months later where even -% \texttt{undo-recent-deprecations} stops restoring it. -% \begin{macrocode} -\bool_new:N \l_@@_grace_period_bool -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\s_@@_mark,\s_@@_stop} -% Internal scan marks. -% \begin{macrocode} -\scan_new:N \s_@@_mark -\scan_new:N \s_@@_stop -% \end{macrocode} -% \end{variable} -% -% \begin{macro}[EXP]{\@@_date_compare:nNnTF, \@@_date_compare_aux:w} -% Expects |#1| and |#3| to be dates in the format YYYY-MM-DD (but -% accepts YYYY or YYYY-MM too, filling in zeros for the missing data). -% Compares them using |#2| (one of |<|, |=|, |>|). -% \begin{macrocode} -\cs_new:Npn \@@_date_compare:nNnTF #1#2#3 - { \@@_date_compare_aux:w #1 -0-0- \s_@@_mark #2 #3 -0-0- \s_@@_stop } -\cs_new:Npn \@@_date_compare_aux:w - #1 - #2 - #3 - #4 \s_@@_mark #5 #6 - #7 - #8 - #9 \s_@@_stop - { - \int_compare:nNnTF {#1} = {#6} - { - \int_compare:nNnTF {#2} = {#7} - { \int_compare:nNnTF {#3} #5 {#8} } - { \int_compare:nNnTF {#2} #5 {#7} } - } - { \int_compare:nNnTF {#1} #5 {#6} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{variable}{\g__kernel_deprecation_undo_recent_bool} -% \begin{macrocode} -\bool_new:N \g__kernel_deprecation_undo_recent_bool -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\@@_not_yet_deprecated:nTF, \@@_minus_six_months:w} -% Receives a deprecation \meta{date} and runs the \texttt{true} -% (\texttt{false}) branch if the \pkg{expl3} date is earlier (later) -% than \meta{date}. If \texttt{undo-recent-deprecations} is used we -% subtract $6$ months to the \pkg{expl3} date (equivalently add $6$ -% months to the \meta{date}). In addition, if the \pkg{expl3} date is -% between \meta{date} and \meta{date} plus $6$ months, -% \cs{l_@@_grace_period_bool} is set to \texttt{true}, otherwise -% \texttt{false}. -% \begin{macrocode} -\cs_new_protected:Npn \@@_not_yet_deprecated:nTF #1 - { - \bool_set_false:N \l_@@_grace_period_bool - \exp_args:No \@@_date_compare:nNnTF { \ExplLoaderFileDate } < {#1} - { \use_i:nn } - { - \exp_args:Nf \@@_date_compare:nNnTF - { - \exp_after:wN \@@_minus_six_months:w - \ExplLoaderFileDate -0-0- \s_@@_stop - } < {#1} - { - \bool_set_true:N \l_@@_grace_period_bool - \bool_if:NTF \g__kernel_deprecation_undo_recent_bool - } - { \use_ii:nn } - } - } -\cs_new:Npn \@@_minus_six_months:w #1 - #2 - #3 - #4 \s_@@_stop - { - \int_compare:nNnTF {#2} > 6 - { #1 - \int_eval:n { #2 - 6 } - #3 } - { \int_eval:n { #1 - 1 } - \int_eval:n { #2 + 6 } - #3 } - } -% \end{macrocode} -% \end{macro} -% % \subsection{Patching definitions to deprecate} % % \begin{quote} @@ -231,20 +118,6 @@ % In both scenarios we the \meta{function} may be \tn{outer} so we % undefine it with \cs{tex_let:D} before redefining it, with % \cs{__kernel_deprecation_error:Nnn} or with some code added shortly. -% -% Then check the date (taking into account -% \texttt{undo-recent-deprecations}) to see if the command should be -% deprecated right away (\texttt{false} branch of -% \cs{@@_not_yet_deprecated:nTF}), in which case -% \cs{@@_just_error:nnNN} makes \meta{function} into an error (not -% \tn{outer}), ignoring its \meta{parameters} and \meta{code} -% completely. -% -% Otherwise distinguish cases where we should give a warning from -% those where we shouldn't: warnings can only happen for protected -% commands, and we only want them if either -% \texttt{undo-recent-deprecations} or \texttt{enable-debug} is in -% force, not for standard users. % \begin{macrocode} \cs_new_protected:Npn \__kernel_patch_deprecation:nnNNpn #1#2#3#4#5# { \@@_patch_aux:nnNNnn {#1} {#2} #3 #4 {#5} } @@ -256,18 +129,9 @@ \__kernel_deprecation_error:Nnn #4 {#2} {#1} } { \tex_let:D #4 \scan_stop: } - \@@_not_yet_deprecated:nTF {#1} - { - \bool_if:nTF - { - \cs_if_eq_p:NN #3 \cs_gset_protected:Npn && - \__kernel_if_debug:TF - { \c_true_bool } { \g__kernel_deprecation_undo_recent_bool } - } - { \@@_warn_once:nnNnn {#1} {#2} #4 {#5} {#6} } - { \@@_patch_aux:Nn #3 { #4 #5 {#6} } } - } - { \@@_just_error:nnNN {#1} {#2} #3 #4 } + \cs_if_eq:NNTF #3 \cs_gset_protected:Npn + { \@@_warn_once:nnNnn {#1} {#2} #4 {#5} {#6} } + { \@@_patch_aux:Nn #3 { #4 #5 {#6} } } } % \end{macrocode} % In case we want a warning, the \meta{function} is defined to produce @@ -315,32 +179,6 @@ { \__kernel_deprecation_code:nn { } { \cs_set:Npn #2 } } } % \end{macrocode} -% Finally, if we want an error we reuse the same \cs{@@_patch_aux:Nn} -% as the previous case. Indeed, we want \cs{debug_off:n} -% |{deprecation}| to make the \meta{function} into an error, just like -% it is by default. The error is expandable or not, and the last -% argument of the error message is empty or is \texttt{grace} to -% denote the case where we are in the $6$~month grace period, in which -% case the error message is more detailed. -% \begin{macrocode} -\cs_new_protected:Npn \@@_just_error:nnNN #1#2#3#4 - { - \exp_args:NNx \@@_patch_aux:Nn #3 - { - \exp_not:N #4 - { - \cs_if_eq:NNTF #3 \cs_gset_protected:Npn - { \exp_not:N \msg_error:nnnnnn } - { \exp_not:N \msg_expandable_error:nnnnnn } - { deprecation } { deprecated-command } - {#1} - { \token_to_str:N #4 } - { \tl_to_str:n {#2} } - { \bool_if:NT \l_@@_grace_period_bool { grace } } - } - } - } -% \end{macrocode} % \end{macro} % % \begin{macro}{\__kernel_deprecation_error:Nnn} @@ -368,13 +206,6 @@ { \tl_if_blank:nF {#3} { Use~ \tl_trim_spaces:n {#3} ~not~ } #2~deprecated~on~#1. - \str_if_eq:nnT {#4} { grace } - { - \c_space_tl - For~6~months~after~that~date~one~can~restore~a~deprecated~ - command~by~loading~the~expl3~package~with~the~option~ - 'undo-recent-deprecations'. - } } % \end{macrocode} % @@ -382,7 +213,7 @@ % % \begin{macro}{\@@_old_protected:Nnn, \@@_old:Nnn} % Short-hands for old commands whose definition does not matter -% anymore, i.e., commands past the grace period. +% any more as they were removed. % \begin{macrocode} \cs_new_protected:Npn \@@_old_protected:Nnn #1#2#3 { @@ -394,9 +225,13 @@ \__kernel_patch_deprecation:nnNNpn {#3} {#2} \cs_gset:Npn #1 { } } -\@@_old:Nnn \box_resize:Nnn +\@@_old_protected:Nnn \box_gset_eq_clear:NN + { \box_gset_eq_drop:NN } { 2021-07-01 } +\@@_old_protected:Nnn \box_set_eq_clear:NN + { \box_set_eq_drop:NN } { 2021-07-01 } +\@@_old_protected:Nnn \box_resize:Nnn { \box_resize_to_wd_and_ht_plus_dp:Nnn } { 2019-01-01 } -\@@_old:Nnn \box_use_clear:N +\@@_old_protected:Nnn \box_use_clear:N { \box_use_drop:N } { 2019-01-01 } \@@_old:Nnn \c_job_name_tl { \c_sys_jobname_str } { 2017-01-01 } @@ -448,22 +283,26 @@ { 1000 } { 2020-01-01 } \@@_old:Nnn \c_ten_thousand { 10000 } { 2020-01-01 } +\@@_old:Nnn \c_term_ior + { -1 } { 2021-07-01 } \@@_old:Nnn \dim_case:nnn { \dim_case:nnF } { 2015-07-14 } -\@@_old:Nnn \file_add_path:nN +\@@_old_protected:Nnn \file_add_path:nN { \file_get_full_name:nN } { 2019-01-01 } \@@_old_protected:Nnn \file_if_exist_input:nT { \file_if_exist:nT and~ \file_input:n } { 2018-03-05 } \@@_old_protected:Nnn \file_if_exist_input:nTF { \file_if_exist:nT and~ \file_input:n } { 2018-03-05 } -\@@_old:Nnn \file_list: +\@@_old_protected:Nnn \file_list: { \file_log_list: } { 2019-01-01 } \@@_old:Nnn \file_path_include:n { \seq_put_right:Nn \l_file_search_path_seq } { 2019-01-01 } -\@@_old:Nnn \file_path_remove:n +\@@_old_protected:Nnn \file_path_remove:n { \seq_remove_all:Nn \l_file_search_path_seq } { 2019-01-01 } \@@_old:Nnn \g_file_current_name_tl { \g_file_curr_name_str } { 2019-01-01 } +\@@_old_protected:Nnn \hbox_unpack_clear:N + { \hbox_unpack_drop:N } { 2021-07-01 } \@@_old:Nnn \int_case:nnn { \int_case:nnF } { 2015-07-14 } \@@_old:Nnn \int_from_binary:n @@ -480,13 +319,13 @@ { \int_to_oct:n } { 2016-01-05 } \@@_old_protected:Nnn \ior_get_str:NN { \ior_str_get:NN } { 2018-03-05 } -\@@_old:Nnn \ior_list_streams: +\@@_old_protected:Nnn \ior_list_streams: { \ior_show_list: } { 2019-01-01 } -\@@_old:Nnn \ior_log_streams: +\@@_old_protected:Nnn \ior_log_streams: { \ior_log_list: } { 2019-01-01 } -\@@_old:Nnn \iow_list_streams: +\@@_old_protected:Nnn \iow_list_streams: { \iow_show_list: } { 2019-01-01 } -\@@_old:Nnn \iow_log_streams: +\@@_old_protected:Nnn \iow_log_streams: { \iow_log_list: } { 2019-01-01 } \@@_old:Nnn \lua_escape_x:n { \lua_escape:e } { 2020-01-01 } @@ -560,12 +399,28 @@ { \tl_case:cnF } { 2015-07-14 } \@@_old:Nnn \tl_case:Nnn { \tl_case:NnF } { 2015-07-14 } +\@@_old_protected:Nnn \tl_gset_from_file:Nnn + { \file_get:nnN } { 2021-07-01 } +\@@_old_protected:Nnn \tl_gset_from_file_x:Nnn + { \file_get:nnN } { 2021-07-01 } +\@@_old_protected:Nnn \tl_set_from_file:Nnn + { \file_get:nnN } { 2021-07-01 } +\@@_old_protected:Nnn \tl_set_from_file_x:Nnn + { \file_get:nnN } { 2021-07-01 } \@@_old_protected:Nnn \tl_to_lowercase:n { \tex_lowercase:D } { 2018-03-05 } \@@_old_protected:Nnn \tl_to_uppercase:n { \tex_uppercase:D } { 2018-03-05 } -\@@_old:Nnn \token_new:Nn +\@@_old:Nnn \token_get_arg_spec:N + { \cs_argument_spec:N } { 2021-07-01 } +\@@_old:Nnn \token_get_prefix_spec:N + { \cs_prefix_spec:N } { 2021-07-01 } +\@@_old:Nnn \token_get_replacement_spec:N + { \cs_replacement_spec:N } { 2021-07-01 } +\@@_old_protected:Nnn \token_new:Nn { \cs_new_eq:NN } { 2019-01-01 } +\@@_old_protected:Nnn \vbox_unpack_clear:N + { \vbox_unpack_drop:N } { 2021-07-01 } \@@_old:Nnn \xetex_if_engine_p: { \sys_if_engine_xetex_p: } { 2017-01-01 } \@@_old:Nnn \xetex_if_engine:F @@ -577,81 +432,41 @@ % \end{macrocode} % \end{macro} % -% \subsection{Loading the patches} -% -% When loaded first, the patches are simply read here. -% Here the deprecation code is loaded with the lower-level |\__kernel_...| -% macro because we don't want it to flip the \cs{g__sys_deprecation_bool} -% boolean, so that the deprecation code can be re-loaded later (when using -% \texttt{undo-recent-deprecations}). -% -% \begin{macrocode} -\group_begin: -\cs_set_protected:Npn \ProvidesExplFile - { - \char_set_catcode_space:n { `\ } - \ProvidesExplFileAux - } -\cs_set_protected:Npx \ProvidesExplFileAux #1#2#3#4 - { - \group_end: - \cs_if_exist:NTF \ProvidesFile - { \exp_not:N \ProvidesFile {#1} [ #2~v#3~#4 ] } - { \iow_log:x { File:~#1~#2~v#3~#4 } } - } -\cs_gset_protected:Npn \__kernel_sys_configuration_load:n #1 - { \file_input:n { #1 .def } } -\__kernel_sys_configuration_load:n { l3deprecation } -% \end{macrocode} -% -% \begin{macrocode} -%</kernel> -% \end{macrocode} -% -% \begin{macrocode} -%<*patches> -% \end{macrocode} -% -% Standard file identification. -% \begin{macrocode} -\ProvidesExplFile{l3deprecation.def}{2019-04-06}{}{L3 Deprecated functions} -% \end{macrocode} -% % \subsection{Deprecated \pkg{l3str} functions} % % \begin{macrocode} %<@@=str> % \end{macrocode} % -% \begin{macro}[EXP, deprecated = 2022-07-01] +% \begin{macro}[EXP] % { % \str_lower_case:n, \str_lower_case:f, % \str_upper_case:n, \str_upper_case:f, % \str_fold_case:n, \str_fold_case:V % } % \begin{macrocode} -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_lowercase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:n } \cs_gset:Npn \str_lower_case:n { \str_lowercase:n } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_lowercase:f } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:f } \cs_gset:Npn \str_lower_case:f { \str_lowercase:f } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_uppercase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:n } \cs_gset:Npn \str_upper_case:n { \str_uppercase:n } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_uppercase:f } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:f } \cs_gset:Npn \str_upper_case:f { \str_uppercase:f } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_foldcase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_foldcase:n } \cs_gset:Npn \str_fold_case:n { \str_foldcase:n } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \str_foldcase:V } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_foldcase:V } \cs_gset:Npn \str_fold_case:V { \str_foldcase:V } % \end{macrocode} % \end{macro} % -% \begin{macro}[EXP, deprecated = 2022-07-01] +% \begin{macro}[EXP] % {\str_declare_eight_bit_encoding:nnn} % This command was made internal, with one more argument. There is no % easy way to compute a reasonable value for that extra argument so we -% take a value that is big enough to accomodate all of Unicode. +% take a value that is big enough to accommodate all of Unicode. % \begin{macrocode} -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { } +\__kernel_patch_deprecation:nnNNpn { 2020-08-20 } { } \cs_gset_protected:Npn \str_declare_eight_bit_encoding:nnn #1 { \@@_declare_eight_bit_encoding:nnnn {#1} { 1114112 } } % \end{macrocode} @@ -659,17 +474,30 @@ % % \subsection{Deprecated \pkg{l3seq} functions} % -% \begin{macro}[EXP, deprecated = 2023-01-01] -% { -% \seq_indexed_map_inline:Nn, \seq_indexed_map_function:NN -% } +% \begin{macro}{\seq_indexed_map_inline:Nn} +% \begin{macro}[EXP]{ \seq_indexed_map_function:NN} % \begin{macrocode} -\__kernel_patch_deprecation:nnNNpn { 2022-07-01 } { \seq_map_indexed_inline:Nn } -\cs_gset:Npn \seq_indexed_map_inline:Nn { \seq_map_indexed_inline:Nn } -\__kernel_patch_deprecation:nnNNpn { 2022-07-01 } { \seq_map_indexed_function:NN } +\__kernel_patch_deprecation:nnNNpn { 2020-06-18 } { \seq_map_indexed_inline:Nn } +\cs_gset_protected:Npn \seq_indexed_map_inline:Nn { \seq_map_indexed_inline:Nn } +\__kernel_patch_deprecation:nnNNpn { 2020-06-18 } { \seq_map_indexed_function:NN } \cs_gset:Npn \seq_indexed_map_function:NN { \seq_map_indexed_function:NN } % \end{macrocode} % \end{macro} +% \end{macro} +% +% \subsection{Deprecated \pkg{l3sys} functions} +% +% \begin{macro}{\sys_load_deprecation:} +% \begin{macrocode} +\__kernel_patch_deprecation:nnNNpn { 2021-01-11 } { (no~longer~required) } +\cs_gset_protected:Npn \sys_load_deprecation: + { + \bool_if:NF \g_@@_deprecation_bool + { \__kernel_sys_configuration_load:n { l3deprecation } } + \bool_gset_true:N \g_@@_deprecation_bool + } +% \end{macrocode} +% \end{macro} % % \subsection{Deprecated \pkg{l3tl} functions} % @@ -677,29 +505,29 @@ %<@@=tl> % \end{macrocode} % -% \begin{macro}[deprecated = 2022-07-01] +% \begin{macro} % { % \tl_lower_case:n, \tl_lower_case:nn, % \tl_upper_case:n, \tl_upper_case:nn, % \tl_mixed_case:n, \tl_mixed_case:nn, % } % \begin{macrocode} -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_lowercase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:n } \cs_gset:Npn \tl_lower_case:n #1 { \text_lowercase:n {#1} } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_lowercase:nn } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:nn } \cs_gset:Npn \tl_lower_case:nn #1#2 { \text_lowercase:nn {#1} {#2} } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_uppercase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_uppercase:n } \cs_gset:Npn \tl_upper_case:n #1 { \text_uppercase:n {#1} } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_uppercase:nn } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_uppercase:nn } \cs_gset:Npn \tl_upper_case:nn #1#2 { \text_uppercase:nn {#1} {#2} } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_titlecase:n } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase:n } \cs_gset:Npn \tl_mixed_case:n #1 { \text_titlecase:n {#1} } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \text_titlecase:nn } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase:nn } \cs_gset:Npn \tl_mixed_case:nn #1#2 { \text_titlecase:nn {#1} {#2} } % \end{macrocode} @@ -707,7 +535,7 @@ % % \subsection{Deprecated \pkg{l3token} functions} % -% \begin{macro}[EXP, deprecated = 2022-07-01] +% \begin{macro}[EXP] % { % \char_lower_case:N, \char_upper_case:N, % \char_mixed_case:Nn, \char_fold_case:N, @@ -715,28 +543,64 @@ % \char_str_mixed_case:Nn, \char_str_fold_case:N, % } % \begin{macrocode} -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_lowercase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_lowercase:N } \cs_gset:Npn \char_lower_case:N { \char_lowercase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_uppercase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_uppercase:N } \cs_gset:Npn \char_upper_case:N { \char_uppercase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_titlecase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_titlecase:N } \cs_gset:Npn \char_mixed_case:N { \char_titlecase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_foldcase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_foldcase:N } \cs_gset:Npn \char_fold_case:N { \char_foldcase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_str_lowercase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_str_lowercase:N } \cs_gset:Npn \char_str_lower_case:N { \char_str_lowercase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_str_uppercase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_str_uppercase:N } \cs_gset:Npn \char_str_upper_case:N { \char_str_uppercase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_str_titlecase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_str_titlecase:N } \cs_gset:Npn \char_str_mixed_case:N { \char_str_titlecase:N } -\__kernel_patch_deprecation:nnNNpn { 2022-01-01 } { \char_str_foldcase:N } +\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \char_str_foldcase:N } \cs_gset:Npn \char_str_fold_case:N { \char_str_foldcase:N } % \end{macrocode} % \end{macro} % +% \begin{macro}[TF] +% { +% \peek_catcode_ignore_spaces:N, \peek_catcode_remove_ignore_spaces:N, +% \peek_charcode_ignore_spaces:N, \peek_charcode_remove_ignore_spaces:N, +% \peek_meaning_ignore_spaces:N, \peek_meaning_remove_ignore_spaces:N +% } +% A little extra fun here to deal with the expansion. % \begin{macrocode} -%</patches> +\tl_map_inline:nn + { + { catcode } { catcode_remove } + { charcode } { charcode_remove } + { meaning } { meaning_remove } + } + { + \use:x + { + \__kernel_patch_deprecation:nnNNpn { 2022-01-11 } { \peek_remove_spaces:n } + \cs_gset_protected:Npn \exp_not:c { peek_ #1 _ignore_spaces:NTF } ####1####2####3 + { + \peek_remove_spaces:n + { \exp_not:c { peek_ #1 :NTF } ####1 {####2} {####3} } + } + \__kernel_patch_deprecation:nnNNpn { 2022-01-11 } { \peek_remove_spaces:n } + \cs_gset_protected:Npn \exp_not:c { peek_ #1 _ignore_spaces:NT } ####1####2 + { + \peek_remove_spaces:n + { \exp_not:c { peek_ #1 :NT } ####1 {####2} } + } + \__kernel_patch_deprecation:nnNNpn { 2022-01-11 } { \peek_remove_spaces:n } + \cs_gset_protected:Npn \exp_not:c { peek_ #1 _ignore_spaces:NF } ####1####2 + { + \peek_remove_spaces:n + { \exp_not:c { peek_ #1 :NF } ####1 {####2} } + } + } + } % \end{macrocode} +% \end{macro} % % \begin{macrocode} %</package> diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index dfbb2abbf30..eb67bd70b38 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -2,7 +2,7 @@ % %% File: l3doc.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -31,7 +31,7 @@ \askforoverwritefalse \preamble -Copyright (C) 1990-2021 The LaTeX Project +Copyright (C) 1990-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % \maketitle % \tableofcontents % @@ -1370,8 +1370,6 @@ and all files in that bundle must be distributed together. ':'~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. } \msg_new:nnn { l3doc } { date-format } { The~date~'#1'~should~be~given~in~YYYY-MM-DD~format. } \msg_new:nnn { l3doc } { future-date } @@ -2420,7 +2418,7 @@ and all files in that bundle must be distributed together. } , added .code:n = { \@@_date_set_past:Nn \l_@@_date_added_tl {#1} }, updated .code:n = { \@@_date_set_past:Nn \l_@@_date_updated_tl {#1} } , - deprecated .code:n = { \@@_deprecated_on:n {#1} } , + deprecated .code:n = {} , % A stub tested .code:n = { } , label .code:n = { @@ -2464,29 +2462,6 @@ and all files in that bundle must be distributed together. % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_deprecated_on:n} -% The date comparison function expects two dates in the YYYY-MM-DD -% format (|-|~is not subtraction here). -% Complain if a deprecated function should have been removed earlier. -% In any case, mark it as internal to suppress the text -% \enquote{documented on page \ldots{}}. -% \begin{macrocode} -\cs_new_protected:Npn \@@_deprecated_on:n #1 - { - \@@_date_set:Nn \l_@@_tmpa_tl {#1} - \exp_args:No \@@_date_compare:nNnT - { \l_@@_tmpa_tl } < { \c_sys_year_int - \c_sys_month_int - \c_sys_day_int } - { - \msg_error:nnxx { l3doc } { deprecated-function } - { \tl_to_str:N \l_@@_macro_argument_tl } - { \l_@@_tmpa_tl } - } - \bool_set_true:N \l_@@_macro_internal_bool - \bool_set_true:N \l_@@_macro_internal_set_bool - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_function:nnw} % \begin{arguments} % \item Key--value list. @@ -2922,7 +2897,7 @@ and all files in that bundle must be distributed together. } , added .code:n = {} , % TODO updated .code:n = {} , % TODO - deprecated .code:n = { \@@_deprecated_on:n {#1} } , + deprecated .code:n = {} , % A stub verb .bool_set:N = \l_@@_names_verb_bool , module .tl_set:N = \l_@@_override_module_tl , documented-as .tl_set:N = \l_@@_macro_documented_tl , diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx index 1f4c4061daf..c654fad889e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx @@ -2,7 +2,7 @@ % %% File l3dosctrip.dtx % -% Copyright (C) 2012,2014-2021 The LaTeX Project +% Copyright (C) 2012,2014-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 12e55bfc509..584707639fa 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -2,7 +2,7 @@ % %% File: l3expan.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index 07dffc2904b..2dd6b3706ed 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -2,7 +2,7 @@ % %% File: l3file.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx index 668cded03b5..737df316304 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3flag.dtx @@ -2,7 +2,7 @@ % %% File: l3flag.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx index 4f8573e2661..74658c8588c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-assign.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx index 9df90f504b0..c516234aed8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-aux.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx index dd34a0e6d71..6bfc75990ed 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-basics.dtx % -% Copyright (C) 2011-2014,2016-2021 The LaTeX Project +% Copyright (C) 2011-2014,2016-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index db755b39477..c462700dc09 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-convert.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx index d28f28258a0..e39ae9b9eac 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-expo.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx index 7ce778ccffa..e5ee0bfbb96 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-extended.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx index 5145278e6b6..8603c45e7fe 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-logic.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx index cc255e06f84..30df6a7b143 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-parse.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx index a25e8fbfee3..83efd217f95 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-random.dtx % -% Copyright (C) 2016-2021 The LaTeX Project +% Copyright (C) 2016-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx index 5bcd63e93a7..a4c3121ee1c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-round.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx index 9a66600ace7..f52c248f1cd 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-traps.dtx % -% Copyright (C) 2011-2014,2016-2021 The LaTeX Project +% Copyright (C) 2011-2014,2016-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % \maketitle % % \begin{documentation} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx index 7f32c26d5e2..c46866fa3c2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx @@ -2,7 +2,7 @@ % %% File: l3fp-trig.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index d5be93e21b7..94560b4ba81 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -2,7 +2,7 @@ % %% File: l3fp.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx index f03c04bb4eb..d37c1663f9c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fparray.dtx @@ -2,7 +2,7 @@ % %% File: l3fparray.dtx % -% Copyright (C) 2018-2021 The LaTeX Project +% Copyright (C) 2018-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index fedb4617f9b..9d21602f793 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -2,7 +2,7 @@ % %% File: l3int.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx index 8f0976fb25d..ffd2bf0c84d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3intarray.dtx @@ -2,7 +2,7 @@ % %% File: l3intarray.dtx % -% Copyright (C) 2017-2021 The LaTeX Project +% Copyright (C) 2017-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx index bfd7174febc..5dc90baa73c 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3kernel-functions.dtx @@ -2,7 +2,7 @@ % %% File: l3kernel-functions.dtx % -% Copyright (C) 2018-2021 The LaTeX Project +% Copyright (C) 2018-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index 51bfbec7128..dab5a8f423d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -2,7 +2,7 @@ % %% File: l3keys.dtx % -% Copyright (C) 2006-2021 The LaTeX Project +% Copyright (C) 2006-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -358,6 +358,24 @@ % require a value at point-of-use unless a default is set. % \end{function} % +% \begin{function}[updated = 2021-11-22] +% { +% .legacy_if_set:n, .legacy_if_gset:n, +% .legacy_if_set_inverse:n, .legacy_if_gset_inverse:n +% } +% \begin{syntax} +% \meta{key} .legacy_if_set:n = \meta{switch} +% \end{syntax} +% Defines \meta{key} to set legacy \cs{if} \meta{switch} to \meta{value} +% (which must be either \enquote{\texttt{true}} or \enquote{\texttt{false}}). +% The \meta{switch} is the name of the switch \emph{without the leading +% \cs{if}}. Note that in contrast to \pkg{expl3} variables, the \meta{switch} +% will \emph{not} be created if it does not exist. +% +% The \texttt{inverse} versions will set the \meta{switch} to the logical +% opposite of the \meta{value}. +% \end{function} +% % \begin{function}[updated = 2013-07-10]{.meta:n} % \begin{syntax} % \meta{key} .meta:n = \Arg{keyval list} @@ -661,6 +679,31 @@ % \cs{l_keys_choice_tl} and \cs{l_keys_choice_int} in exactly % the same way as described for \texttt{.choices:nn}. % +% \subsection{Key usage scope} +% +% Some keys will be used as settings which have a strictly limited scope +% of usage. Some will be only available once, others will only be valid +% until typesetting begins. To allow formats to support this in a structured +% way, \pkg{l3keys} allows this information to be specified using the +% \texttt{.usage:n} property. +% +% \begin{function}[added = 2022-01-10]{.usage:n} +% \begin{syntax} +% \meta{key} .usage:n = \meta{scope} +% \end{syntax} +% Defines the \meta{key} to have usage within the \meta{scope}, which +% should be one of \texttt{general}, \texttt{preamble} or \texttt{load}. +% \end{function} +% +% \begin{variable}[added = 2022-01-10] +% {\l_keys_usage_load_prop, \l_keys_usage_preamble_prop} +% \pkg{l3keys} itself does \emph{not} attempt to redefine keys based on the +% usage scope. Rather, this information is made available with these +% two property lists. These hold an entry for each module (prefix); the +% value of each entry is a comma-separated list of the usage-restricted +% key(s). +% \end{variable} +% % \section{Setting keys} % % \begin{function}[updated = 2017-11-14] @@ -831,7 +874,8 @@ % % \section{Utility functions for keys} % -% \begin{function}[EXP, pTF, updated = 2017-11-14]{\keys_if_exist:nn} +% \begin{function}[EXP, pTF, updated = 2022-01-10] +% {\keys_if_exist:nn, \keys_if_exist:ne} % \begin{syntax} % \cs{keys_if_exist_p:nn} \Arg{module} \Arg{key} \\ % \cs{keys_if_exist:nnTF} \Arg{module} \Arg{key} \Arg{true code} \Arg{false code} @@ -1461,20 +1505,20 @@ % \begin{variable} % { % \c_@@_code_root_str , +% \c_@@_check_root_str , % \c_@@_default_root_str , % \c_@@_groups_root_str , -% \c_@@_inherit_root_str , -% \c_@@_type_root_str , -% \c_@@_validate_root_str +% \c_@@_inherit_root_str , +% \c_@@_type_root_str % } % Various storage areas for the different data which make up keys. % \begin{macrocode} \str_const:Nn \c_@@_code_root_str { key~code~>~ } +\str_const:Nn \c_@@_check_root_str { key~check~>~ } \str_const:Nn \c_@@_default_root_str { key~default~>~ } \str_const:Nn \c_@@_groups_root_str { key~groups~>~ } \str_const:Nn \c_@@_inherit_root_str { key~inherit~>~ } \str_const:Nn \c_@@_type_root_str { key~type~>~ } -\str_const:Nn \c_@@_validate_root_str { key~validate~>~ } % \end{macrocode} % \end{variable} % @@ -1607,6 +1651,14 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\l_keys_usage_load_prop, \l_keys_usage_preamble_prop} +% Global data for document-level information. +% \begin{macrocode} +\prop_new:N \l_keys_usage_load_prop +\prop_new:N \l_keys_usage_preamble_prop +% \end{macrocode} +% \end{variable} +% % \subsubsection{Internal auxiliaries} % % \begin{variable}{\s_@@_nil,\s_@@_mark,\s_@@_stop} @@ -1916,7 +1968,7 @@ % \end{macro} % % \begin{macro}{\@@_default_set:n} -% Setting a default value is easy. These are stored using \cs{cs_set:cpx} as this +% Setting a default value is easy. These are stored using \cs{cs_set_nopar:cpx} as this % avoids any worries about whether a token list exists. % \begin{macrocode} \cs_new_protected:Npn \@@_default_set:n #1 @@ -2060,7 +2112,7 @@ \cs_new_protected:Npn \@@_undefine: { \clist_map_inline:nn - { code , default , groups , inherit , type , validate } + { code , default , groups , inherit , type , check } { \cs_set_eq:cN { \tl_use:c { c_@@_ ##1 _root_str } \l_keys_path_str } @@ -2071,7 +2123,7 @@ % \end{macro} % % \begin{macro}{\@@_value_requirement:nn} -% \begin{macro}{\@@_validate_forbidden:, \@@_validate_required:} +% \begin{macro}{\@@_check_forbidden:, \@@_check_required:} % Validating key input is done using a second function which runs before % the main key code. Setting that up means setting it equal to a generic % stub which does the check. This approach makes the lookup very fast at @@ -2085,17 +2137,17 @@ { true } { \cs_set_eq:cc - { \c_@@_validate_root_str \l_keys_path_str } - { @@_validate_ #1 : } + { \c_@@_check_root_str \l_keys_path_str } + { @@_check_ #1 : } } { false } { \cs_if_eq:ccT - { \c_@@_validate_root_str \l_keys_path_str } - { @@_validate_ #1 : } + { \c_@@_check_root_str \l_keys_path_str } + { @@_check_ #1 : } { \cs_set_eq:cN - { \c_@@_validate_root_str \l_keys_path_str } + { \c_@@_check_root_str \l_keys_path_str } \tex_undefined:D } } @@ -2106,7 +2158,7 @@ { .value_ #1 :n } } } -\cs_new_protected:Npn \@@_validate_forbidden: +\cs_new_protected:Npn \@@_check_forbidden: { \bool_if:NF \l_@@_no_value_bool { @@ -2115,7 +2167,7 @@ \use_none:nnn } } -\cs_new_protected:Npn \@@_validate_required: +\cs_new_protected:Npn \@@_check_required: { \bool_if:NT \l_@@_no_value_bool { @@ -2128,6 +2180,62 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\@@_usage:n} +% \begin{macro}{\@@_usage:NN} +% \begin{macro}{\@@_usage:w} +% Save the relevant data. +% \begin{macrocode} +\cs_new_protected:Npn \@@_usage:n #1 + { + \str_case:nnF {#1} + { + { general } + { + \@@_usage:NN \l_keys_usage_load_prop + \c_false_bool + \@@_usage:NN \l_keys_usage_preamble_prop + \c_false_bool + } + { load } + { + \@@_usage:NN \l_keys_usage_load_prop + \c_true_bool + \@@_usage:NN \l_keys_usage_preamble_prop + \c_false_bool + } + { preamble } + { + \@@_usage:NN \l_keys_usage_load_prop + \c_false_bool + \@@_usage:NN \l_keys_usage_preamble_prop + \c_true_bool + } + } + { + \msg_error:nnnn { keys } + { choice-unknown } + { .usage:n } + {#1} + } + } +\cs_new_protected:Npn \@@_usage:NN #1#2 + { + \prop_get:NVNF #1 \l_@@_module_str \l_@@_tmpa_tl + { \tl_clear:N \l_@@_tmpa_tl } + \tl_set:Nx \l_@@_tmpb_tl + { \exp_after:wN \@@_usage:w \l_keys_path_str \s_@@_stop } + \bool_if:NTF #2 + { \clist_put_right:NV \l_@@_tmpa_tl \l_@@_tmpb_tl } + { \clist_remove_all:NV \l_@@_tmpa_tl \l_@@_tmpb_tl } + \prop_put:NVV #1 \l_@@_module_str + \l_@@_tmpa_tl + } +\cs_new:Npn \@@_usage:w #1 / #2 \s_@@_stop {#2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\@@_variable_set:NnnN, \@@_variable_set:cnnN} % \begin{macro}{\@@_variable_set_required:NnnN, \@@_variable_set_required:cnnN} % Setting a variable takes the type and scope separately so that @@ -2529,6 +2637,13 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{.usage:n} +% \begin{macrocode} +\cs_new_protected:cpn { \c_@@_props_root_str .usage:n } #1 + { \@@_usage:n {#1} } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{.value_forbidden:n} % \begin{macro}{.value_required:n} % These are very similar, so both call the same function. @@ -2541,6 +2656,29 @@ % \end{macro} % \end{macro} % +% \subsection{Key properties for \LaTeXe{} options} +% +% \begin{macro}{.if, .store, .usage} +% \begin{macrocode} +\group_begin: + \cs_set_protected:Npn \@@_tmp:nn #1#2 + { + \quark_if_recursion_tail_stop:n {#1} + \cs_new_eq:cc + { \c_@@_props_root_str . #2 } + { \c_@@_props_root_str . #1 } + \@@_tmp:nn + } + \@@_tmp:nn + { legacy_if:n } { if } + { tl_set:N } { store } + { usage:n } { usage } + { \q_recursion_tail } { } + \q_recursion_stop +\group_end: +% \end{macrocode} +% \end{macro} +% % \subsection{Setting keys} % % \begin{macro} @@ -2968,7 +3106,7 @@ { \cs_if_exist:cTF { \c_@@_code_root_str \l_keys_path_str } { - \cs_if_exist_use:c { \c_@@_validate_root_str \l_keys_path_str } + \cs_if_exist_use:c { \c_@@_check_root_str \l_keys_path_str } \@@_execute:no \l_keys_path_str \l_keys_value_tl } { @@ -2992,7 +3130,7 @@ { \c_@@_code_root_str ##1 / \l_keys_key_str } { \str_set:Nn \l_@@_inherit_str {##1} - \cs_if_exist_use:c { \c_@@_validate_root_str ##1 / \l_keys_key_str } + \cs_if_exist_use:c { \c_@@_check_root_str ##1 / \l_keys_key_str } \@@_execute:no { ##1 / \l_keys_key_str } \l_keys_value_tl \clist_map_break:n \use_none:n } @@ -3231,6 +3369,7 @@ { \prg_return_true: } { \prg_return_false: } } +\prg_generate_conditional_variant:Nnn \keys_if_exist:nn { ne } { T , F , TF } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx index 91492a68136..9ffbb1c1e62 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3legacy.dtx @@ -2,7 +2,7 @@ % %% File: l3legacy.dtx % -% Copyright (C) 2019-2021 The LaTeX Project +% Copyright (C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 918f36c3acf..f3afe0a091d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -2,7 +2,7 @@ % %% File: l3luatex.dtx % -% Copyright (C) 2010-2021 The LaTeX Project +% Copyright (C) 2010-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -125,34 +125,9 @@ % |ltx.utils| table. % \end{function} % -% \begin{function}[deprecated = 2021-12-31]{l3kernel} -% For compatibility reasons, there are also some deprecated interfaces provided -% in the |l3kernel| table. These do not return their result as Lua values but -% instead print them to \TeX. -% \end{function} -% -% \begin{function}{l3kernel.charcat} -% \begin{syntax} -% |l3kernel.charcat(|\meta{charcode}, \meta{catcode}|)| -% \end{syntax} -% Constructs a character of \meta{charcode} and \meta{catcode} and returns -% the result to \TeX{}. -% \end{function} -% -% \begin{function}{l3kernel.elapsedtime} -% \begin{syntax} -% |l3kernel.elapsedtime()| -% \end{syntax} -% Returns the CPU time in \meta{scaled seconds} since the start of the -% \TeX{} run or since |l3kernel.resettimer| was issued. This only -% measures the time used by the CPU, not the real time, e.g., waiting -% for user input. -% \end{function} -% -% \begin{function}{ltx.utils.filedump, l3kernel.filedump} +% \begin{function}{ltx.utils.filedump} % \begin{syntax} % \meta{dump}| = ltx.utils.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)| \\ -% |l3kernel.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)| % \end{syntax} % Returns the uppercase hexadecimal representation of the content of the % \meta{file} read as bytes. If the \meta{length} is given, only this part @@ -161,10 +136,9 @@ % is read starting at the \meta{offset}. % \end{function} % -% \begin{function}{ltx.utils.filemd5sum, l3kernel.filemdfivesum} +% \begin{function}{ltx.utils.filemd5sum} % \begin{syntax} % \meta{hash}| = ltx.utils.filemd5sum(|\meta{file}|)| \\ -% |l3kernel.filemdfivesum(|\meta{file}|)| % \end{syntax} % Returns the MD5 sum of the file contents read as bytes; note that % the result will depend on the nature of the line endings used in the file, @@ -172,10 +146,9 @@ % nothing is returned with \emph{no error raised}. % \end{function} % -% \begin{function}{ltx.utils.filemoddate, l3kernel.filemoddate} +% \begin{function}{ltx.utils.filemoddate} % \begin{syntax} % \meta{date}| = ltx.utils.filemoddate(|\meta{file}|)| \\ -% |l3kernel.filemoddate(|\meta{file}|)| % \end{syntax} % Returns the date/time of last modification of the \meta{file} in the % format @@ -188,37 +161,14 @@ % not found, nothing is returned with \emph{no error raised}. % \end{function} % -% \begin{function}{ltx.utils.filesize, l3kernel.filesize} +% \begin{function}{ltx.utils.filesize} % \begin{syntax} % |size = ltx.utils.filesize(|\meta{file}|)| \\ -% |l3kernel.filesize(|\meta{file}|)| % \end{syntax} % Returns the size of the \meta{file} in bytes. If the \meta{file} is not % found, nothing is returned with \emph{no error raised}. % \end{function} % -% \begin{function}{l3kernel.resettimer} -% \begin{syntax} -% |l3kernel.resettimer()| -% \end{syntax} -% Resets the timer used by |l3kernel.elapsetime|. -% \end{function} -% -% \begin{function}{l3kernel.shellescape} -% \begin{syntax} -% |l3kernel.shellescape(|\meta{cmd}|)| -% \end{syntax} -% Executes the \meta{cmd} and prints to the log as for \pdfTeX{}. -% \end{function} -% -% \begin{function}{l3kernel.strcmp} -% \begin{syntax} -% |l3kernel.strcmp(|\meta{str one}, \meta{str two}|)| -% \end{syntax} -% Compares the two strings and returns |0| to \TeX{} -% if the two are identical. -% \end{function} -% % \end{documentation} % % \begin{implementation} @@ -322,18 +272,14 @@ % Most of the emulation of \pdfTeX{} here is based heavily on Heiko Oberdiek's % \pkg{pdftexcmds} package. % -% \begin{macro}{l3kernel} % \begin{macro}{ltx.utils} % Create a table for the kernel's own use. % \begin{macrocode} -l3kernel = l3kernel or { } -local l3kernel = l3kernel ltx = ltx or {utils={}} ltx.utils = ltx.utils or { } local ltxutils = ltx.utils % \end{macrocode} % \end{macro} -% \end{macro} % % Local copies of global tables. % \begin{macrocode} @@ -413,16 +359,6 @@ if not command_id and tokens and tokens.commands then end % \end{macrocode} % -% \begin{macrocode} -local function deprecated(table, name, func) - table[name] = function(...) - write_nl(format("Calling deprecated Lua function %s", name)) - table[name] = func - return func(...) - end -end -% \end{macrocode -% % Deal with Con\TeX{}t: doesn't use |kpse| library. % \begin{macrocode} local kpse_find = (resolvers and resolvers.findfile) or kpse.find_file @@ -440,40 +376,7 @@ end % \end{macrocode} % \end{macro} % -% \begin{macro}{l3kernel.charcat} -% Creating arbitrary chars using |tex.cprint|. -% The alternative approach using |token.put_next(token.create(...))| -% would be about 10\% slower. -% \begin{macrocode} -deprecated(l3kernel, 'charcat', function(charcode, catcode) - cprint(catcode, utf8_char(charcode)) -end) -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{l3kernel.elapsedtime, l3kernel.resettimer} -% Simple timing set up: give the result from the system clock in scaled -% seconds. -% \begin{macrocode} -local os_clock = os.clock -local base_clock_time = 0 -local function elapsedtime() - local val = (os_clock() - base_clock_time) * 65536 + 0.5 - if val > 2147483647 then - val = 2147483647 - end - write(format("%d",floor(val))) -end -l3kernel.elapsedtime = elapsedtime -local function resettimer() - base_clock_time = os_clock() -end -l3kernel.resettimer = resettimer -% \end{macrocode} -% \end{macro} -% % \begin{macro}{ltx.utils.filedump} -% \begin{macro}{l3kernel.filedump} % Similar comments here to the next function: read the file in binary mode % to avoid any line-end weirdness. % \begin{macrocode} @@ -490,15 +393,8 @@ local function filedump(name,offset,length) return escapehex(data) end ltxutils.filedump = filedump -deprecated(l3kernel, "filedump", function(name, offset, length) - local dump = filedump(name, tonumber(offset), tonumber(length)) - if dump then - write(dump) - end -end) % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{md5.HEX} % Hash a string and return the hash in uppercase hexadecimal format. @@ -516,7 +412,6 @@ end % \end{macrocode} % \end{macro} % \begin{macro}{ltx.utils.filemd5sum} -% \begin{macro}{l3kernel.filemdfivesum} % Read an entire file and hash it: the hash function itself is a built-in. % As Lua is byte-based there is no work needed here in terms of UTF-8 % (see \pkg{pdftexcmds} and how it handles strings that have passed through @@ -532,18 +427,10 @@ local function filemd5sum(name) return md5_HEX(data) end ltxutils.filemd5sum = filemd5sum -deprecated(l3kernel, "filemdfivesum", function(name) - local hash = filemd5sum(name) - if hash then - write(hash) - end -end) % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{ltx.utils.filemoddate} -% \begin{macro}{l3kernel.filemoddate} % There are two cases: If the C standard library is C99 compliant, % we can use |%z| to get the timezone in almost the right format. % We only have to add primes and replace a zero or missing offset @@ -607,18 +494,10 @@ else end end ltxutils.filemoddate = filemoddate -deprecated(l3kernel, "filemoddate", function(name) - local hash = filemoddate(name) - if hash then - write(hash) - end -end) % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{ltx.utils.filesize} -% \begin{macro}{l3kernel.filesize} % A simple disk lookup. % \begin{macrocode} local function filesize(name) @@ -631,46 +510,6 @@ local function filesize(name) end end ltxutils.filesize = filesize -deprecated(l3kernel, "filesize", function(name) - local size = filesize(name) - if size then - write(size) - end -end) -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{l3kernel.strcmp} -% String comparison which gives the same results as \pdfTeX{}'s -% \tn{pdfstrcmp}, although the ordering should likely not be relied upon! -% \begin{macrocode} -deprecated(l3kernel, "strcmp", function (A, B) - if A == B then - write("0") - elseif A < B then - write("-1") - else - write("1") - end -end) -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{l3kernel.shellescape} -% Replicating the \pdfTeX{} log interaction for shell escape. -% \begin{macrocode} -local os_exec = os.execute -deprecated(l3kernel, "shellescape", function(cmd) - local status,msg = os_exec(cmd) - if status == nil then - write_nl("log","runsystem(" .. cmd .. ")...(" .. msg .. ")\n") - elseif status == 0 then - write_nl("log","runsystem(" .. cmd .. ")...executed\n") - else - write_nl("log","runsystem(" .. cmd .. ")...failed " .. (msg or "") .. "\n") - end -end) % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index d9c76ed8c46..7e0e798ac7e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -2,7 +2,7 @@ % %% File: l3msg.dtx % -% Copyright (C) 2009-2021 The LaTeX Project +% Copyright (C) 2009-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index e046dd2c808..b113b69e933 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -2,7 +2,7 @@ % %% File: l3names.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx index 5d7779ff4fd..347c801e50b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3pdf.dtx @@ -2,7 +2,7 @@ % %% File: l3pdf.dtx % -% Copyright(C) 2019-2021 The LaTeX Project +% Copyright(C) 2019-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index f6eb57c9019..dbeddb192b9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -2,7 +2,7 @@ % %% File: l3prg.dtx % -% Copyright (C) 2005-2021 The LaTeX Project +% Copyright (C) 2005-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx index 55d962b292b..16db6a427b0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx @@ -2,7 +2,7 @@ % %% File: l3prop.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -311,6 +311,21 @@ % the input stream as an \meta{integer denotation}. % \end{function} % +% \begin{function}[EXP]{\prop_to_keyval:N} +% \begin{syntax} +% \cs{prop_to_keyval:N} \meta{property list} +% \end{syntax} +% Expands to the \meta{property list} in a key--value notation. Keep in mind +% that a \meta{property list} is \emph{unordered}, while key--value interfaces +% don't necessarily are, so this can't be used for arbitrary interfaces. +% \begin{texnote} +% The result is returned within the \tn{unexpanded} primitive +% (\cs{exp_not:n}), which means that the key--value list does not expand +% further when appearing in an \texttt{x}-type argument expansion. +% It also needs exactly two steps of expansion. +% \end{texnote} +% \end{function} +% % \section{Modifying property lists} % % \begin{function}[added = 2012-05-12] @@ -1055,6 +1070,79 @@ % \end{macro} % \end{macro} % +% \begin{macro}[EXP]{\prop_to_keyval:N} +% \begin{macro}[EXP] +% {\@@_to_keyval_exp_after:wN, \@@_to_keyval:nn, \@@_to_keyval:nnw} +% Each property name and value pair will be returned in the form +% \verb*| |\marg{name}\verb*|= |\marg{value}. As one of the main use cases for +% this macro is to pass the \meta{property list} on to a key--value parser, we +% have to make sure that the behaviour is as good as possible. Using a space +% before the opening brace we get the correct brace stripping behaviour for +% most of the key--value parsers available in \LaTeX. +% If \cs{tex_expanded:D} is available this function makes use of it, so there +% are two different implementations here. They both start with +% \cs{__kernel_exp_not:w} to start the expansion context to expand in two +% steps. If the \meta{property list} is empty they just leave an empty set of +% braces in the input stream for \cs{__kernel_exp_not:w}. +% \begin{macrocode} +\cs_if_exist:NTF \tex_expanded:D + { +% \end{macrocode} +% The variant using \cs{tex_expanded:D} can just iterate over the +% \meta{property list} and remove the leading comma afterwards. Only the value +% has to be protected in \cs{__kernel_exp_not:w} as the property name is +% always a string. After the loop the leading comma is removed by +% \cs{use_none:n} and afterwards \cs{__kernel_exp_not:w} eventually finds the +% opening brace of its argument. +% \begin{macrocode} + \cs_new:Npn \prop_to_keyval:N #1 + { + \__kernel_exp_not:w + \prop_if_empty:NTF #1 + { {} } + { + \exp_after:wN \exp_after:wN \exp_after:wN + { + \tex_expanded:D + { + \__kernel_exp_not:w { \use_none:n } + \prop_map_function:NN #1 \@@_to_keyval:nn + } + } + } + } + \cs_new:Npn \@@_to_keyval:nn #1#2 + { , ~ {#1} =~ { \__kernel_exp_not:w {#2} } } + } +% \end{macrocode} +% The other variant will iterate over the \meta{property list} and has to +% output the result in a group after the marker +% \cs{@@_to_keyval_exp_after:wN}. As a result this is considerably slower than +% the \cs{tex_expanded:D} using variant as it has to read the entire contents +% of the \meta{property list} for each item. Since the marker is just +% \cs{exp_after:wN} with another name, after the loop the leading comma is +% gobbled by \cs{use_none:n}, leaving the result as the argument to +% \cs{__kernel_exp_not:w}. +% \begin{macrocode} + { + \cs_new:Npn \prop_to_keyval:N #1 + { + \__kernel_exp_not:w + \prop_if_empty:NTF #1 + { {} } + { + \prop_map_function:NN #1 \@@_to_keyval:nnw + \@@_to_keyval_exp_after:wN { \use_none:n } + } + } + \cs_new_eq:NN \@@_to_keyval_exp_after:wN \exp_after:wN + \cs_new:Npn \@@_to_keyval:nnw #1#2#3 \@@_to_keyval_exp_after:wN #4 + { #3 \@@_to_keyval_exp_after:wN { #4 , ~ {#1} =~ {#2} } } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}[TF, tested = m3prop004] % {\prop_pop:NnN, \prop_pop:cnN, \prop_gpop:NnN, \prop_gpop:cnN} % Popping an item from a property list, keeping track of whether diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index cfa9a985da9..2b1bb4eacb4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -2,7 +2,7 @@ % %% File: l3quark.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx index dd95825c87f..cab4d738bff 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3regex.dtx @@ -2,7 +2,7 @@ % %% File: l3regex.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -99,7 +99,7 @@ % % \section{Syntax of regular expressions} % -% \subsection{Regex examples} +% \subsection{Regular expression examples} % % We start with a few examples, and encourage the reader to apply % \cs{regex_show:n} to these regular expressions. @@ -620,6 +620,38 @@ % results in \cs[no-index]{l_foo_int} taking the value $5$. % \end{function} % +% \begin{function}[noTF, added = 2022-01-10]{\regex_match_case:nn} +% \begin{syntax} +% \cs{regex_match_case:nnTF} +% ~~|{| \\ +% ~~~~\Arg{regex_1} \Arg{code case_1} \\ +% ~~~~\Arg{regex_2} \Arg{code case_2} \\ +% ~~~~\ldots \\ +% ~~~~\Arg{regex_n} \Arg{code case_n} \\ +% ~~|}| \Arg{token list} +% ~~\Arg{true code} \Arg{false code} +% \end{syntax} +% Determines which of the \meta{regular expressions} matches at the +% earliest point in the \meta{token list}, and leaves the +% corresponding \meta{code_i} followed by the \meta{true code} in the +% input stream. If several \meta{regex} match starting at the same +% point, then the first one in the list is selected and the others are +% discarded. If none of the \meta{regex} match, the \meta{false code} +% is left in the input stream. Each \meta{regex} can either be given +% as a regex variable or as an explicit regular expression. +% +% In detail, for each starting position in the \meta{token list}, each +% of the \meta{regex} is searched in turn. If one of them matches +% then the corresponding \meta{code} is used and everything else is +% discarded, while if none of the \meta{regex} match at a given +% position then the next starting position is attempted. If none of +% the \meta{regex} match anywhere in the \meta{token list} then +% nothing is left in the input stream. Note that this differs from +% nested \cs{regex_match:nnTF} statements since all \meta{regex} are +% attempted at each position rather than attempting to match +% \meta{regex_1} at every position before moving on to \meta{regex_2}. +% \end{function} +% % \section{Submatch extraction} % % \begin{function}[noTF, added = 2017-05-26] @@ -734,6 +766,74 @@ % locally to \meta{tl~var}. % \end{function} % +% \begin{function}[noTF, added = 2022-01-10]{\regex_replace_case_once:nN} +% \begin{syntax} +% \cs{regex_replace_case_once:nNTF} +% ~~|{| \\ +% ~~~~\Arg{regex_1} \Arg{replacement_1} \\ +% ~~~~\Arg{regex_2} \Arg{replacement_2} \\ +% ~~~~\ldots \\ +% ~~~~\Arg{regex_n} \Arg{replacement_n} \\ +% ~~|}| \meta{tl~var} +% ~~\Arg{true code} \Arg{false code} +% \end{syntax} +% Replaces the earliest match of the regular expression +% "(?|"\meta{regex_1}"|"\dots"|"\meta{regex_n}")" in the \meta{token +% list variable} by the \meta{replacement} corresponding to which +% \meta{regex_i} matched, then leaves the \meta{true code} in the +% input stream. If none of the \meta{regex} match, then the +% \meta{tl~var} is not modified, and the \meta{false code} is left in +% the input stream. Each \meta{regex} can either be given as a regex +% variable or as an explicit regular expression. +% +% In detail, for each starting position in the \meta{token list}, each +% of the \meta{regex} is searched in turn. If one of them matches +% then it is replaced by the corresponding \meta{replacement} as +% described for \cs{regex_replace_once:nnN}. This is equivalent to +% checking with \cs{regex_match_case:nn} which \meta{regex} matches, +% then performing the replacement with \cs{regex_replace_once:nnN}. +% \end{function} +% +% \begin{function}[noTF, added = 2022-01-10]{\regex_replace_case_all:nN} +% \begin{syntax} +% \cs{regex_replace_case_all:nNTF} +% ~~|{| \\ +% ~~~~\Arg{regex_1} \Arg{replacement_1} \\ +% ~~~~\Arg{regex_2} \Arg{replacement_2} \\ +% ~~~~\ldots \\ +% ~~~~\Arg{regex_n} \Arg{replacement_n} \\ +% ~~|}| \meta{tl~var} +% ~~\Arg{true code} \Arg{false code} +% \end{syntax} +% Replaces all occurrences of all \meta{regex} in the \meta{token +% list} by the corresponding \meta{replacement}. Every match is +% treated independently, and matches cannot overlap. The result is +% assigned locally to \meta{tl~var}, and the \meta{true code} or +% \meta{false code} is left in the input stream depending on whether +% any replacement was made or not. +% +% In detail, for each starting position in the \meta{token list}, each +% of the \meta{regex} is searched in turn. If one of them matches +% then it is replaced by the corresponding \meta{replacement}, and the +% search resumes at the position that follows this match (and +% replacement). For instance +% \begin{verbatim} +% \tl_set:Nn \l_tmpa_tl { Hello,~world! } +% \regex_replace_case_all:nN +% { +% { [A-Za-z]+ } { ``\0'' } +% { \b } { --- } +% { . } { [\0] } +% } \l_tmpa_tl +% \end{verbatim} +% results in \cs{l_tmpa_tl} having the contents +% \verb*|``Hello''---[,][ ]``world''---[!]|. Note in particular that +% the word-boundary assertion |\b| did not match at the start of words +% because the case |[A-Za-z]+| matched at these positions. To change +% this, one could simply swap the order of the two cases in the +% argument of \cs{regex_replace_case_all:nN}. +% \end{function} +% % \section{Scratch regular expressions} % % \begin{variable}[added = 2017-12-11]{\l_tmpa_regex, \l_tmpb_regex} @@ -786,7 +886,7 @@ % \texttt{curr_state} and \texttt{curr_submatches}. % \item If possible, when a state is reused by the same thread, kill % other subthreads. -% \item Use an array rather than \cs[no-index]{l__regex_balance_tl} +% \item Use an array rather than \cs[no-index]{g__regex_balance_tl} % to build the function \cs[no-index]{__regex_replacement_balance_one_match:n}. % \item Reduce the number of epsilon-transitions in alternatives. % \item Optimize simple strings: use less states (|abcade| should give @@ -1100,6 +1200,26 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_tl_odd_items:n, \@@_tl_even_items:n, \@@_tl_even_items_loop:nn} +% Map through a token list one pair at a time, leaving the +% odd-numbered or even-numbered items (the first item is +% numbered~$1$). +% \begin{macrocode} +\cs_new:Npn \@@_tl_odd_items:n #1 { \@@_tl_even_items:n { ? #1 } } +\cs_new:Npn \@@_tl_even_items:n #1 + { + \@@_tl_even_items_loop:nn #1 \q_@@_nil \q_@@_nil + \prg_break_point: + } +\cs_new:Npn \@@_tl_even_items_loop:nn #1#2 + { + \@@_use_none_delimit_by_q_nil:w #2 \prg_break: \q_@@_nil + { \exp_not:n {#2} } + \@@_tl_even_items_loop:nn + } +% \end{macrocode} +% \end{macro} +% % \subsubsection{Constants and variables} % % \begin{macro}{\@@_tmp:w} @@ -1186,9 +1306,17 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\q_@@_nil} +% Internal quarks. +% \begin{macrocode} +\quark_new:N \q_@@_nil +% \end{macrocode} +% \end{variable} +% % \begin{macro}[EXP]{ % \@@_use_none_delimit_by_q_recursion_stop:w, -% \@@_use_i_delimit_by_q_recursion_stop:nw +% \@@_use_i_delimit_by_q_recursion_stop:nw, +% \@@_use_none_delimit_by_q_nil:w, % } % Functions to gobble up to a quark. % \begin{macrocode} @@ -1196,16 +1324,10 @@ #1 \q_@@_recursion_stop { } \cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw #1 #2 \q_@@_recursion_stop {#1} +\cs_new:Npn \@@_use_none_delimit_by_q_nil:w #1 \q_@@_nil { } % \end{macrocode} % \end{macro} % -% \begin{variable}{\q_@@_nil} -% Internal quarks. -% \begin{macrocode} -\quark_new:N \q_@@_nil -% \end{macrocode} -% \end{variable} -% % \begin{macro}[pTF]{\@@_quark_if_nil:n} % Branching quark conditional. % \begin{macrocode} @@ -2343,6 +2465,29 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_compile_use:n} +% Use a regex, regardless of whether it is given as a string (in which +% case we need to compile) or as a regex variable. This is used for +% \cs{regex_match_case:nn} and related functions to allow a mixture of +% explicit regex and regex variables. +% \begin{macrocode} +\cs_new_protected:Npn \@@_compile_use:n #1 + { + \tl_if_single_token:nT {#1} + { + \exp_after:wN \@@_compile_use_aux:w + \token_to_meaning:N #1 ~ \q_@@_nil + } + \@@_compile:n {#1} \l_@@_internal_regex + } +\cs_new_protected:Npn \@@_compile_use_aux:w #1 ~ #2 \q_@@_nil + { + \str_if_eq:nnT { #1 ~ } { macro:->\@@_branch:n } + { \use_ii:nnn } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_compile_escaped:N, \@@_compile_special:N} % If the special character or escaped alphanumeric has a particular % meaning in regexes, the corresponding function is used. Otherwise, @@ -4154,6 +4299,80 @@ % \end{macrocode} % \end{macro} % +% \begin{variable}{\g_@@_case_int} +% Case number that was successfully matched in +% \cs{regex_match_case:nn} and related functions. +% \begin{macrocode} +\int_new:N \g_@@_case_int +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\l_@@_case_max_group_int} +% The largest group number appearing in any of the \meta{regex} in the +% argument of \cs{regex_match_case:nn} and related functions. +% \begin{macrocode} +\int_new:N \l_@@_case_max_group_int +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_case_build:n, \@@_case_build:x, \@@_case_build_aux:Nn, \@@_case_build_loop:n} +% See \cs{@@_build:n}, but with a loop. +% \begin{macrocode} +\cs_new_protected:Npn \@@_case_build:n #1 + { + \@@_case_build_aux:Nn \c_true_bool {#1} + \int_gzero:N \g_@@_case_int + } +\cs_generate_variant:Nn \@@_case_build:n { x } +\cs_new_protected:Npn \@@_case_build_aux:Nn #1#2 + { + \@@_standard_escapechar: + \int_set_eq:NN \l_@@_max_state_int \l_@@_min_state_int + \@@_build_new_state: + \@@_build_new_state: + \@@_toks_put_right:Nn \l_@@_left_state_int + { \@@_action_start_wildcard:N #1 } + % + \@@_build_new_state: + \@@_toks_put_left:Nx \l_@@_left_state_int + { \@@_action_submatch:nN { 0 } < } + \@@_push_lr_states: + \int_zero:N \l_@@_case_max_group_int + \int_gzero:N \g_@@_case_int + \tl_map_inline:nn {#2} + { + \int_gincr:N \g_@@_case_int + \@@_case_build_loop:n {##1} + } + \int_set_eq:NN \l_@@_capturing_group_int \l_@@_case_max_group_int + \@@_pop_lr_states: + } +\cs_new_protected:Npn \@@_case_build_loop:n #1 + { + \int_set:Nn \l_@@_capturing_group_int { 1 } + \@@_compile_use:n {#1} + \int_set:Nn \l_@@_case_max_group_int + { + \int_max:nn { \l_@@_case_max_group_int } + { \l_@@_capturing_group_int } + } + \seq_pop:NN \l_@@_right_state_seq \l_@@_internal_a_tl + \int_set:Nn \l_@@_right_state_int \l_@@_internal_a_tl + \@@_toks_put_left:Nx \l_@@_right_state_int + { + \@@_action_submatch:nN { 0 } > + \int_gset:Nn \g_@@_case_int + { \int_use:N \g_@@_case_int } + \@@_action_success: + } + \@@_toks_clear:N \l_@@_max_state_int + \seq_push:No \l_@@_right_state_seq + { \int_use:N \l_@@_max_state_int } + \int_incr:N \l_@@_max_state_int + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_build_for_cs:n} % The matching code relies on some global intarray variables, but only % uses a range of their entries. Specifically, @@ -4495,7 +4714,7 @@ % the group, and leaves \texttt{internal_a} pointing to the left end % of the last repetition. We only record the submatch information at % the last repetition. Finally, add a state at the end (the transition -% to it has been taken care of by the replicating auxiliary. +% to it has been taken care of by the replicating auxiliary). % \begin{macrocode} \cs_new_protected:Npn \@@_group_repeat:nn #1#2 { @@ -5425,12 +5644,12 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\l_@@_balance_tl} +% \begin{variable}{\g_@@_balance_tl} % This token list holds the replacement text for % \cs{@@_replacement_balance_one_match:n} while it is being built % incrementally. % \begin{macrocode} -\tl_new:N \l_@@_balance_tl +\tl_new:N \g_@@_balance_tl % \end{macrocode} % \end{variable} % @@ -5573,11 +5792,11 @@ % % \subsubsection{Framework} % -% \begin{macro}{\@@_replacement:n} -% \begin{macro}{\@@_replacement_aux:n} +% \begin{macro}{\@@_replacement:n, \@@_replacement:x} +% \begin{macro}{\@@_replacement_apply:Nn, \@@_replacement_set:n} % The replacement text is built incrementally. We keep track in % \cs{l_@@_balance_int} of the balance of explicit begin- and -% end-group tokens and we store in \cs{l_@@_balance_tl} some +% end-group tokens and we store in \cs{g_@@_balance_tl} some % code to compute the brace balance from submatches (see its % description). Detect unescaped right braces, and escaped characters, % with trailing \cs{prg_do_nothing:} because some of the later @@ -5585,12 +5804,14 @@ % parsed, make sure that there is no open csname. Finally, define the % \texttt{balance_one_match} and \texttt{do_one_match} functions. % \begin{macrocode} -\cs_new_protected:Npn \@@_replacement:n #1 +\cs_new_protected:Npn \@@_replacement:n + { \@@_replacement_apply:Nn \@@_replacement_set:n } +\cs_new_protected:Npn \@@_replacement_apply:Nn #1#2 { \group_begin: \tl_build_begin:N \l_@@_build_tl \int_zero:N \l_@@_balance_int - \tl_clear:N \l_@@_balance_tl + \tl_gclear:N \g_@@_balance_tl \@@_escape_use:nnnn { \if_charcode:w \c_right_brace_str ##1 @@ -5606,7 +5827,7 @@ } { \@@_replacement_escaped:N ##1 } { \@@_replacement_normal:n ##1 } - {#1} + {#2} \prg_do_nothing: \prg_do_nothing: \if_int_compare:w \l_@@_replacement_csnames_int > \c_zero_int \msg_error:nnx { regex } { replacement-missing-rbrace } @@ -5620,18 +5841,15 @@ { \seq_count:N \l_@@_replacement_category_seq } \seq_clear:N \l_@@_replacement_category_seq } - \cs_gset:Npx \@@_replacement_balance_one_match:n ##1 - { - + \int_use:N \l_@@_balance_int - \l_@@_balance_tl - - \@@_submatch_balance:n {##1} - } + \tl_gput_right:Nx \g_@@_balance_tl + { + \int_use:N \l_@@_balance_int } \tl_build_end:N \l_@@_build_tl \exp_args:NNo \group_end: - \@@_replacement_aux:n \l_@@_build_tl + #1 \l_@@_build_tl } -\cs_new_protected:Npn \@@_replacement_aux:n #1 +\cs_generate_variant:Nn \@@_replacement:n { x } +\cs_new_protected:Npn \@@_replacement_set:n #1 { \cs_set:Npn \@@_replacement_do_one_match:n ##1 { @@ -5646,11 +5864,47 @@ } #1 } + \exp_args:Nno \use:n + { \cs_gset:Npn \@@_replacement_balance_one_match:n ##1 } + { + \g_@@_balance_tl + - \@@_submatch_balance:n {##1} + } } % \end{macrocode} % \end{macro} % \end{macro} % +% \begin{macro}{\@@_case_replacement:n, \@@_case_replacement:x} +% \begin{macrocode} +\tl_new:N \g_@@_case_replacement_tl +\tl_new:N \g_@@_case_balance_tl +\cs_new_protected:Npn \@@_case_replacement:n #1 + { + \tl_gset:Nn \g_@@_case_balance_tl + { + \if_case:w + \__kernel_intarray_item:Nn + \g_@@_submatch_case_intarray {##1} + } + \tl_gset_eq:NN \g_@@_case_replacement_tl \g_@@_case_balance_tl + \tl_map_tokens:nn {#1} + { \@@_replacement_apply:Nn \@@_case_replacement_aux:n } + \tl_gset:No \g_@@_balance_tl + { \g_@@_case_balance_tl \fi: } + \exp_args:No \@@_replacement_set:n + { \g_@@_case_replacement_tl \fi: } + } +\cs_generate_variant:Nn \@@_case_replacement:n { x } +\cs_new_protected:Npn \@@_case_replacement_aux:n #1 + { + \tl_gput_right:Nn \g_@@_case_replacement_tl { \or: #1 } + \tl_gput_right:No \g_@@_case_balance_tl + { \exp_after:wN \or: \g_@@_balance_tl } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_replacement_put:n} % This gets redefined for \cs{peek_regex_replace_once:nnTF}. % \begin{macrocode} @@ -5751,7 +6005,7 @@ % construction, it must be taken into account in the brace balance. % Later on, |##1| will be replaced by a pointer to the $0$-th submatch for a % given match. There is an \cs{exp_not:N} here as at the point-of-use -% of \cs{l_@@_balance_tl} there is an \texttt{x}-type expansion which is needed +% of \cs{g_@@_balance_tl} there is an \texttt{x}-type expansion which is needed % to get |##1| in correctly. % \begin{macrocode} \cs_new_protected:Npn \@@_replacement_put_submatch:n #1 @@ -5768,11 +6022,8 @@ \tl_build_put_right:Nn \l_@@_build_tl { \@@_query_submatch:n { \int_eval:n { #1 + ##1 } } } \if_int_compare:w \l_@@_replacement_csnames_int = \c_zero_int - \tl_put_right:Nn \l_@@_balance_tl - { - + \@@_submatch_balance:n - { \exp_not:N \int_eval:n { #1 + ##1 } } - } + \tl_gput_right:Nn \g_@@_balance_tl + { + \@@_submatch_balance:n { \int_eval:n { #1 + ##1 } } } \fi: } % \end{macrocode} @@ -6269,6 +6520,29 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[noTF]{\regex_match_case:nn} +% The auxiliary errors if |#1| has an odd number of items, and +% otherwise it sets \cs{g_@@_case_int} according to which case was +% found (zero if not found). The \texttt{true} branch leaves the +% corresponding code in the input stream. +% \begin{macrocode} +\cs_new_protected:Npn \regex_match_case:nnTF #1#2#3 + { + \@@_match_case:nnTF {#1} {#2} + { + \tl_item:nn {#1} { 2 * \g_@@_case_int } + #3 + } + } +\cs_new_protected:Npn \regex_match_case:nn #1#2 + { \regex_match_case:nnTF {#1} {#2} { } { } } +\cs_new_protected:Npn \regex_match_case:nnT #1#2#3 + { \regex_match_case:nnTF {#1} {#2} {#3} { } } +\cs_new_protected:Npn \regex_match_case:nnF #1#2 + { \regex_match_case:nnTF {#1} {#2} { } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}[noTF] % { % \regex_extract_once:nnN, \regex_extract_once:NnN, @@ -6306,6 +6580,72 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[noTF]{\regex_replace_case_once:nN} +% If the input is bad (odd number of items) then take the false +% branch. Otherwise, use the same auxiliary as +% \cs{regex_replace_once:nnN}, but with more complicated code to build +% the automaton, and to find what replacement text to use. The +% \cs{tl_item:nn} is only expanded once we know the value of +% \cs{g_@@_case_int}, namely which case matched. +% \begin{macrocode} +\cs_new_protected:Npn \regex_replace_case_once:nNTF #1#2 + { + \int_if_odd:nTF { \tl_count:n {#1} } + { + \msg_error:nnxxxx { regex } { case-odd } + { \token_to_str:N \regex_replace_case_once:nN(TF) } { code } + { \tl_count:n {#1} } { \tl_to_str:n {#1} } + \use_ii:nn + } + { + \@@_replace_once_aux:nnN + { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } + { \@@_replacement:x { \tl_item:nn {#1} { 2 * \g_@@_case_int } } } + #2 + \bool_if:NTF \g_@@_success_bool + } + } +\cs_new_protected:Npn \regex_replace_case_once:nN #1#2 + { \regex_replace_case_once:nNTF {#1} {#2} { } { } } +\cs_new_protected:Npn \regex_replace_case_once:nNT #1#2#3 + { \regex_replace_case_once:nNTF {#1} {#2} {#3} { } } +\cs_new_protected:Npn \regex_replace_case_once:nNF #1#2 + { \regex_replace_case_once:nNTF {#1} {#2} { } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[noTF]{\regex_case_replace_all:nN} +% If the input is bad (odd number of items) then take the false +% branch. Otherwise, use the same auxiliary as +% \cs{regex_replace_all:nnN}, but with more complicated code to build +% the automaton, and to find what replacement text to use. +% \begin{macrocode} +\cs_new_protected:Npn \regex_replace_case_all:nNTF #1#2 + { + \int_if_odd:nTF { \tl_count:n {#1} } + { + \msg_error:nnxxxx { regex } { case-odd } + { \token_to_str:N \regex_replace_case_all:nN(TF) } { code } + { \tl_count:n {#1} } { \tl_to_str:n {#1} } + \use_ii:nn + } + { + \@@_replace_all_aux:nnN + { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } + { \@@_case_replacement:x { \@@_tl_even_items:n {#1} } } + #2 + \bool_if:NTF \g_@@_success_bool + } + } +\cs_new_protected:Npn \regex_replace_case_all:nN #1#2 + { \regex_replace_case_all:nNTF {#1} {#2} { } { } } +\cs_new_protected:Npn \regex_replace_case_all:nNT #1#2#3 + { \regex_replace_case_all:nNTF {#1} {#2} {#3} { } } +\cs_new_protected:Npn \regex_replace_case_all:nNF #1#2 + { \regex_replace_case_all:nNTF {#1} {#2} { } } +% \end{macrocode} +% \end{macro} +% % \subsubsection{Variables and helpers for user functions} % % \begin{variable}{\l_@@_match_count_int} @@ -6343,12 +6683,14 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_submatch_prev_intarray, \g_@@_submatch_begin_intarray, \g_@@_submatch_end_intarray} -% Hold the place where the match attempt begun and the end-points of each submatch. +% \begin{variable}{\g_@@_submatch_prev_intarray, \g_@@_submatch_begin_intarray, \g_@@_submatch_end_intarray, \g_@@_submatch_case_intarray} +% Hold the place where the match attempt begun, the end-points of each +% submatch, and which regex case the match corresponds to, respectively. % \begin{macrocode} \intarray_new:Nn \g_@@_submatch_prev_intarray { 65536 } \intarray_new:Nn \g_@@_submatch_begin_intarray { 65536 } \intarray_new:Nn \g_@@_submatch_end_intarray { 65536 } +\intarray_new:Nn \g_@@_submatch_case_intarray { 65536 } % \end{macrocode} % \end{variable} % @@ -6433,6 +6775,34 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_match_case:nnTF} +% \begin{macro}[EXP]{\@@_match_case_aux:nn} +% The code would get badly messed up if the number of items in |#1| +% were not even, so we catch this case, then follow the same code as +% \cs{regex_match:nnTF} but using \cs{@@_case_build:n} and without +% returning a result. +% \begin{macrocode} +\cs_new_protected:Npn \@@_match_case:nnTF #1#2 + { + \int_if_odd:nTF { \tl_count:n {#1} } + { + \msg_error:nnxxxx { regex } { case-odd } + { \token_to_str:N \regex_match_case:nn(TF) } { code } + { \tl_count:n {#1} } { \tl_to_str:n {#1} } + \use_ii:nn + } + { + \@@_if_match:nn + { \@@_case_build:x { \@@_tl_odd_items:n {#1} } } + {#2} + \bool_if:NTF \g_@@_success_bool + } + } +\cs_new:Npn \@@_match_case_aux:nn #1#2 { \exp_not:n { {#1} } } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}{\@@_count:nnN} % Again, we don't care about submatches. Instead of aborting after the % first \enquote{longest match} is found, we search for multiple @@ -6739,10 +7109,14 @@ { \__kernel_intarray_gset:Nnn \g_@@_submatch_prev_intarray { \l_@@_submatch_int } { 0 } + \__kernel_intarray_gset:Nnn \g_@@_submatch_case_intarray + { \l_@@_submatch_int } { 0 } \int_incr:N \l_@@_submatch_int } \__kernel_intarray_gset:Nnn \g_@@_submatch_prev_intarray { \l_@@_zeroth_submatch_int } { \l_@@_start_pos_int } + \__kernel_intarray_gset:Nnn \g_@@_submatch_case_intarray + { \l_@@_zeroth_submatch_int } { \g_@@_case_int } \int_zero:N \l_@@_internal_a_int \exp_after:wN \@@_extract_aux:w \l_@@_success_submatches_tl \prg_break_point: \@@_use_none_delimit_by_q_recursion_stop:w , @@ -6767,7 +7141,7 @@ % % \subsubsection{Replacement} % -% \begin{macro}{\@@_replace_once:nnN} +% \begin{macro}{\@@_replace_once:nnN, \@@_replace_once_aux:nnN} % Build the \textsc{nfa} and the replacement functions, then find a % single match. If the match failed, simply exit the % group. Otherwise, we do the replacement. Extract submatches. Compute @@ -6781,18 +7155,19 @@ % \texttt{x}-expansion, and checks that braces are balanced in the % final result. % \begin{macrocode} -\cs_new_protected:Npn \@@_replace_once:nnN #1#2#3 +\cs_new_protected:Npn \@@_replace_once:nnN #1#2 + { \@@_replace_once_aux:nnN {#1} { \@@_replacement:n {#2} } } +\cs_new_protected:Npn \@@_replace_once_aux:nnN #1#2#3 { \group_begin: \@@_single_match: #1 \exp_args:No \@@_match:n {#3} - \if_meaning:w \c_false_bool \g_@@_success_bool - \group_end: - \else: + \bool_if:NTF \g_@@_success_bool + { \@@_extract: \exp_args:No \@@_query_set:n {#3} - \@@_replacement:n {#2} + #2 \int_set:Nn \l_@@_balance_int { \@@_replacement_balance_one_match:n @@ -6810,7 +7185,8 @@ { \l_@@_max_pos_int } } \@@_group_end_replace:N #3 - \fi: + } + { \group_end: } } % \end{macrocode} % \end{macro} @@ -6827,14 +7203,16 @@ % match. Join together the replacement texts for each match (including % the part of the query before the match), and the end of the query. % \begin{macrocode} -\cs_new_protected:Npn \@@_replace_all:nnN #1#2#3 +\cs_new_protected:Npn \@@_replace_all:nnN #1#2 + { \@@_replace_all_aux:nnN {#1} { \@@_replacement:n {#2} } } +\cs_new_protected:Npn \@@_replace_all_aux:nnN #1#2#3 { \group_begin: \@@_multi_match:n { \@@_extract: } #1 \exp_args:No \@@_match:n {#3} \exp_args:No \@@_query_set:n {#3} - \@@_replacement:n {#2} + #2 \int_set:Nn \l_@@_balance_int { 0 @@ -7617,8 +7995,15 @@ { The~values~given~in~a~quantifier~must~be~in~order. } % \end{macrocode} % -% Used when showing a regex. +% Used in user commands, and when showing a regex. % \begin{macrocode} +\msg_new:nnnn { regex } { case-odd } + { #1~with~odd~number~of~items } + { + There~must~be~a~#2~part~for~each~regex:~ + found~odd~number~of~items~(#3)~in\\ + \iow_indent:n {#4} + } \msg_new:nnn { regex } { show } { >~Compiled~regex~ diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx index f6d5611de65..3800fc99d8b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx @@ -2,7 +2,7 @@ % %% File: l3seq.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 0f00ceb209f..7e98d77f3ef 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -3,7 +3,7 @@ %% File: l3skip.dtx % % Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX Project -% (C) 2012-2021 The LaTeX Project +% (C) 2012-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx index 04d00e83d95..7781995193a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sort.dtx @@ -2,7 +2,7 @@ % %% File l3sort.dtx % -% Copyright (C) 2012-2021 The LaTeX Project +% Copyright (C) 2012-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx index 50e5e82ccb6..49e0ef8d491 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str-convert.dtx @@ -2,7 +2,7 @@ % %% File: l3str-convert.dtx % -% Copyright (C) 2013-2021 The LaTeX Project +% Copyright (C) 2013-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index 89f7177e001..637d892b4e1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -2,7 +2,7 @@ % %% File: l3str.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx index cbffa7e7eca..5d5d5ae9b12 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -2,7 +2,7 @@ % %% File: l3sys.dtx % -% Copyright (C) 2015-2021 The LaTeX Project +% Copyright (C) 2015-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -220,8 +220,8 @@ % \cs{q_no_value} in the non-branching version. % Note that quote characters (|"|) \emph{cannot} be used inside the % \meta{shell command}. The \cs{sys_get_shell:nnNTF} conditional -% returns \texttt{true} if the shell is available and no quote is -% detected, and \texttt{false} otherwise. +% inserts the \texttt{true code} if the shell is available and no quote is +% detected, and the \texttt{false code} otherwise. % \end{function} % % \begin{variable}[added = 2017-05-27]{\c_sys_shell_escape_int} @@ -295,13 +295,11 @@ % issued. % \end{variable} % -% \begin{function}[added = 2019-09-12]{\sys_load_debug:, \sys_load_deprecation:} +% \begin{function}[added = 2019-09-12]{\sys_load_debug:} % \begin{syntax} % \cs{sys_load_debug:} -% \cs{sys_load_deprecation:} % \end{syntax} -% Load the additional configuration files for debugging support and rolling -% back deprecations, respectively. +% Load the additional configuration file for debugging support. % \end{function} % % \subsection{Final settings} @@ -563,14 +561,13 @@ % \end{macro} % \end{macro} % -% \begin{variable}{\g_@@_debug_bool, \g_@@_deprecation_bool} +% \begin{variable}{\g_@@_debug_bool} % \begin{macrocode} \bool_new:N \g_@@_debug_bool -\bool_new:N \g_@@_deprecation_bool % \end{macrocode} % \end{variable} % -% \begin{macro}{\sys_load_debug:, \sys_load_deprecation:} +% \begin{macro}{\sys_load_debug:} % Simple. % \begin{macrocode} \cs_new_protected:Npn \sys_load_debug: @@ -579,12 +576,6 @@ { \__kernel_sys_configuration_load:n { l3debug } } \bool_gset_true:N \g_@@_debug_bool } -\cs_new_protected:Npn \sys_load_deprecation: - { - \bool_if:NF \g_@@_deprecation_bool - { \__kernel_sys_configuration_load:n { l3deprecation } } - \bool_gset_true:N \g_@@_deprecation_bool - } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx index 914e725f0dd..07131772c19 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx @@ -2,7 +2,7 @@ % %% File: l3text-case.dtx % -% Copyright (C) 2020,2021 The LaTeX Project +% Copyright (C) 2020-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx index a3349bea868..63ccc846106 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-purify.dtx @@ -2,7 +2,7 @@ % %% File: l3text-purify.dtx % -% Copyright (C) 2020,2021 The LaTeX Project +% Copyright (C) 2020-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx index 638d9f47b94..0be16822a65 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text.dtx @@ -2,7 +2,7 @@ % %% File: l3text.dtx % -% Copyright (C) 2020,2021 The LaTeX Project +% Copyright (C) 2020-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx index 733ca763522..c8ceb1d531d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl-analysis.dtx @@ -2,7 +2,7 @@ % %% File: l3tl-analysis.dtx % -% Copyright (C) 2011-2021 The LaTeX Project +% Copyright (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 1f2c4eed3b7..39f98f5e28e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -2,7 +2,7 @@ % %% File: l3tl.dtx % -% Copyright (C) 1990-2021 The LaTeX Project +% Copyright (C) 1990-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -301,6 +301,7 @@ % The \meta{token list_2} cannot contain the tokens |{|, |}| or |#| % (more precisely, explicit character tokens with category code $1$ % (begin-group) or $2$ (end-group), and tokens with category code $6$). +% The search does \emph{not} enter brace (category code $1$/$2$) groups. % \end{function} % % \begin{function}[added = 2017-11-14, EXP,pTF]{\tl_if_novalue:n} @@ -1072,6 +1073,10 @@ % % \subsection{Replacing tokens} % +% Within token lists, replacement takes place at the top level: there is +% no recursion into brace groups (more precisely, within a group defined by +% a categroy code $1$/$2$ pair). +% % \begin{function}[updated = 2011-08-11] % { % \tl_replace_once:Nnn, \tl_replace_once:cnn, diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index e4381736518..42236e0021e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -2,7 +2,7 @@ % %% File: l3token.dtx % -% Copyright (C) 2005-2021 The LaTeX Project +% Copyright (C) 2005-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % @@ -841,19 +841,6 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_ignore_spaces:N} -% \begin{syntax} -% \cs{peek_catcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next non-space \meta{token} in the input stream has the -% same category code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens -% (with character code 32 and category code 10) are ignored and -% removed by the test and the \meta{token} is left in the input -% stream after the \meta{true code} or \meta{false code} (as -% appropriate to the result of the test). -% \end{function} -% % \begin{function}[updated = 2012-12-20, TF]{\peek_catcode_remove:N} % \begin{syntax} % \cs{peek_catcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code} @@ -867,21 +854,6 @@ % appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2012-12-20, TF] -% {\peek_catcode_remove_ignore_spaces:N} -% \begin{syntax} -% \cs{peek_catcode_remove_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next non-space \meta{token} in the input stream has the -% same category code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_catcode:NNTF}). Explicit and implicit space tokens -% (with character code 32 and category code 10) are ignored and -% removed by the test and the \meta{token} is removed from the -% input stream if the test is true. The function then places -% either the \meta{true code} or \meta{false code} in the input stream -% (as appropriate to the result of the test). -% \end{function} -% % \begin{function}[updated = 2012-12-20, TF]{\peek_charcode:N} % \begin{syntax} % \cs{peek_charcode:NTF} \meta{test token} \Arg{true code} \Arg{false code} @@ -894,19 +866,6 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_ignore_spaces:N} -% \begin{syntax} -% \cs{peek_charcode_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next non-space \meta{token} in the input stream has the -% same character code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens -% (with character code 32 and category code 10) are ignored and removed by -% the test and the \meta{token} is left in the input stream after -% the \meta{true code} or \meta{false code} (as appropriate to the -% result of the test). -% \end{function} -% % \begin{function}[updated = 2012-12-20, TF]{\peek_charcode_remove:N} % \begin{syntax} % \cs{peek_charcode_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code} @@ -920,22 +879,6 @@ % appropriate to the result of the test). % \end{function} % -% \begin{function}[updated = 2012-12-20, TF] -% {\peek_charcode_remove_ignore_spaces:N} -% \begin{syntax} -% \cs{peek_charcode_remove_ignore_spaces:NTF} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next non-space \meta{token} in the input stream has the -% same character code as the \meta{test token} (as defined by the test -% \cs{token_if_eq_charcode:NNTF}). Explicit and implicit space tokens -% (with character code 32 and category code 10) are ignored and -% removed by the test and the \meta{token} is removed from the -% input stream if the test is true. The function then places -% either the \meta{true code} or \meta{false code} in the input stream -% (as appropriate to the result of the test). -% \end{function} -% % \begin{function}[updated = 2011-07-02, TF]{\peek_meaning:N} % \begin{syntax} % \cs{peek_meaning:NTF} \meta{test token} \Arg{true code} \Arg{false code} @@ -948,19 +891,6 @@ % result of the test). % \end{function} % -% \begin{function}[updated = 2012-12-05, TF]{\peek_meaning_ignore_spaces:N} -% \begin{syntax} -% \cs{peek_meaning_ignore_spaces:NTF} \meta{test token} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the next non-space \meta{token} in the input stream has the -% same meaning as the \meta{test token} (as defined by the test -% \cs{token_if_eq_meaning:NNTF}). Explicit and implicit space tokens -% (with character code 32 and category code 10) are ignored and -% removed by the test and the \meta{token} is left in the input -% stream after the \meta{true code} or \meta{false code} (as -% appropriate to the result of the test). -% \end{function} -% % \begin{function}[updated = 2011-07-02, TF]{\peek_meaning_remove:N} % \begin{syntax} % \cs{peek_meaning_remove:NTF} \meta{test token} \Arg{true code} \Arg{false code} @@ -974,6 +904,40 @@ % appropriate to the result of the test). % \end{function} % +% \begin{function}[added = 2018-10-01]{\peek_remove_spaces:n} +% \begin{syntax} +% \cs{peek_remove_spaces:n} \Arg{code} +% \end{syntax} +% Peeks ahead and detect if the following token is a space (category code +% $10$ and character code $32$). If so, removes the token and checks the +% next token. Once a non-space token is found, the \meta{code} will be +% inserted into the input stream. Typically this will contain a \texttt{peek} +% operation, but this is not required. +% \end{function} +% +% \begin{function}[added = 2022-01-10]{\peek_remove_filler:n} +% \begin{syntax} +% \cs{peek_remove_filler:n} \Arg{code} +% \end{syntax} +% Peeks ahead and detect if the following token is a space (category code +% $10$) or has meaning equal to \cs{scan_stop:}. If so, +% removes the token and checks the next token. If neither of these cases +% apply, expands the next token using \texttt{f}-type expansion, then checks +% the resulting leading token in the same way. If after expansion the next +% token is neither of the two test cases, the \meta{code} will be inserted +% into the input stream. Typically this will contain a \texttt{peek} +% operation, but this is not required. +% \begin{texnote} +% This is essentially a macro-based implementation of how \TeX{} handles +% the search for a left brace after for example \tn{everypar}, except that +% any non-expandable token cleanly ends the \meta{filler} (i.e.~it does not +% lead to a \TeX{} error). +% +% In contrast to \TeX{}'s filler removal, a construct +% \verb|\exp_not:N \foo| will be treated in the same way as \verb|\foo|. +% \end{texnote} +% \end{function} +% % \begin{function}[updated = 2012-12-05, TF] % {\peek_meaning_remove_ignore_spaces:N} % \begin{syntax} @@ -2914,6 +2878,68 @@ end % \end{macrocode} % \end{macro} % +% \begin{macro}{\peek_remove_filler:n} +% \begin{macro}{\@@_remove_filler:w} +% \begin{macro}{\@@_remove_filler:} +% \begin{macro}{\@@_remove_filler_expand:w} +% Here we expand the input, removing spaces and \cs{scan_stop:} tokens until +% we reach a non-expandable token. At that stage we re-insert the payload. +% To deal with the problem of |&| tokens, we have to put the align-safe +% group in the correct place. +% \begin{macrocode} +\cs_new_protected:Npn \peek_remove_filler:n #1 + { + \cs_set:Npn \@@_true_aux:w { \@@_remove_filler:w } + \cs_set:Npx \@@_false:w + { + \exp_not:N \group_align_safe_end: + \exp_not:n {#1} + } + \group_align_safe_begin: + \@@_remove_filler:w + } +\cs_new_protected:Npn \@@_remove_filler:w + { + \exp_after:wN \peek_after:Nw \exp_after:wN \@@_remove_filler: + \exp:w \exp_end_continue_f:w + } +% \end{macrocode} +% Here we can nest conditionals as \cs{l_peek_token} is only skipped over in +% the nested one if it's a space: no problems with conditionals or outer +% tokens. +% \begin{macrocode} +\cs_new_protected:Npn \@@_remove_filler: + { + \if_catcode:w \exp_not:N \l_peek_token \c_space_token + \exp_after:wN \@@_true_remove:w + \else: + \if_meaning:w \l_peek_token \scan_stop: + \exp_after:wN \exp_after:wN \exp_after:wN + \@@_true_remove:w + \else: + \exp_after:wN \exp_after:wN \exp_after:wN + \@@_remove_filler_expand:w + \fi: + \fi: + } +% \end{macrocode} +% To deal with undefined control sequences in the same way \TeX{} does, +% we need to check for expansion manually. +% \begin{macrocode} +\cs_new_protected:Npn \@@_remove_filler_expand:w + { + \exp_after:wN \if_meaning:w \exp_not:N \l_peek_token \l_peek_token + \exp_after:wN \@@_false:w + \else: + \exp_after:wN \@@_remove_filler:w + \fi: + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\@@_token_generic_aux:NNNTF} % The generic functions store the test token in both implicit and % explicit modes, and the \texttt{true} and \texttt{false} code as @@ -3080,41 +3106,6 @@ end % \end{macrocode} % \end{macro} % -% \begin{macro}[TF] -% { -% \peek_catcode_ignore_spaces:N, \peek_catcode_remove_ignore_spaces:N, -% \peek_charcode_ignore_spaces:N, \peek_charcode_remove_ignore_spaces:N, -% \peek_meaning_ignore_spaces:N, \peek_meaning_remove_ignore_spaces:N -% } -% To ignore spaces, remove them using \cs{peek_remove_spaces:n} -% before running the tests. -% \begin{macrocode} -\tl_map_inline:nn - { - { catcode } { catcode_remove } - { charcode } { charcode_remove } - { meaning } { meaning_remove } - } - { - \cs_new_protected:cpx { peek_#1_ignore_spaces:NTF } ##1##2##3 - { - \peek_remove_spaces:n - { \exp_not:c { peek_#1:NTF } ##1 {##2} {##3} } - } - \cs_new_protected:cpx { peek_#1_ignore_spaces:NT } ##1##2 - { - \peek_remove_spaces:n - { \exp_not:c { peek_#1:NT } ##1 {##2} } - } - \cs_new_protected:cpx { peek_#1_ignore_spaces:NF } ##1##2 - { - \peek_remove_spaces:n - { \exp_not:c { peek_#1:NF } ##1 {##2} } - } - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}[TF]{\peek_N_type:} % \begin{macro} % {\@@_execute_branches_N_type:, \@@_N_type:w, \@@_N_type_aux:nnw} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx index 476eeb02bba..452281b7351 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode.dtx @@ -2,7 +2,7 @@ % %% File: l3unicode.dtx % -% Copyright (C) 2018-2021 The LaTeX Project +% Copyright (C) 2018-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-11-22} +% \date{Released 2022-01-12} % % \maketitle % diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index 6aeaba3229a..675b914f444 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -2,7 +2,7 @@ % %% File: l3keys2e.dtx % -% Copyright (C) 2009,2011-2021 The LaTeX Project +% Copyright (C) 2009,2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -62,7 +62,7 @@ % }^^A % } % -% \date{Released 2021-11-12} +% \date{Released 2022-01-12} % % \maketitle % @@ -139,7 +139,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3keys2e}{2021-11-12}{} +\ProvidesExplPackage{l3keys2e}{2022-01-12}{} {LaTeX2e option processing using LaTeX3 keys} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins index 3c437d8ee80..b475045073f 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins @@ -2,7 +2,7 @@ File: l3keys2e.ins -Copyright (C) 2009,2011,2012,2016,2017,2019-2021 The LaTeX Project +Copyright (C) 2009,2011,2012,2016,2017,2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -23,7 +23,7 @@ The released version of this bundle is available from CTAN. \preamble -Copyright (C) 2009-2021 The LaTeX Project +Copyright (C) 2009-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx index c3ba90bb149..5863f1579d6 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.dtx @@ -2,7 +2,7 @@ % %% File: xfp.dtx % -% Copyright (C) 2017-2021 The LaTeX Project +% Copyright (C) 2017-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -63,12 +63,17 @@ % }^^A % } % -% \date{Released 2021-11-12} +% \date{Released 2022-01-12} % % \maketitle % % \begin{documentation} % +% The two functions provided by this package are part of the \LaTeX{} +% format starting with 2022-06-01 release. This package is +% therefore no longer needed and only provided to be able to +% process older documents loading. +% % This package provides a \LaTeXe{} document-level interface to the \LaTeX{}3 % floating point unit (part of \pkg{expl3}). It also provides a parallel % integer expression interface for convenience. @@ -166,21 +171,24 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfp}{2021-11-12}{} +\ProvidesExplPackage{xfp}{2022-01-12}{} {L3 Floating point unit} % \end{macrocode} % % \begin{macro}{\fpeval} -% A document level wrapper around the code level function. +% A document level wrapper around the code level function. This +% definition will be moved to the \LaTeXe{} format so we just +% ``provide'' it in case this package gets loaded in documents +% processed with a new format. % \begin{macrocode} -\NewExpandableDocumentCommand \fpeval { m } { \fp_eval:n {#1} } +\ProvideExpandableDocumentCommand \fpeval { m } { \fp_eval:n {#1} } % \end{macrocode} % \end{macro} % % \begin{macro}{\inteval} % A second one, this time around an \eTeX{} primitive. % \begin{macrocode} -\NewExpandableDocumentCommand \inteval { m } { \int_eval:n {#1} } +\ProvideExpandableDocumentCommand \inteval { m } { \int_eval:n {#1} } % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.ins b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.ins index b5c1d4eea9a..b91fbaa6b61 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfp/xfp.ins +++ b/Master/texmf-dist/source/latex/l3packages/xfp/xfp.ins @@ -2,7 +2,7 @@ File: xfp.ins -Copyright (C) 2017,2019-2021 The LaTeX Project +Copyright (C) 2017,2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -23,7 +23,7 @@ The released version of this bundle is available from CTAN. \preamble -Copyright (C) 2017-2021 The LaTeX Project +Copyright (C) 2017-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx index efe75c161a7..4fb469ae595 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx @@ -3,7 +3,7 @@ %% File: xfrac.dtx % % Copyright (C) 2004,2008-2010 Morten Hoegholm -% (C) 2011,2012,2014-2021 The LaTeX Project +% (C) 2011,2012,2014-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -65,7 +65,7 @@ % }^^A % } % -% \date{Released 2021-11-12} +% \date{Released 2022-01-12} % % \maketitle % @@ -535,7 +535,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfrac}{2021-11-12}{} +\ProvidesExplPackage{xfrac}{2022-01-12}{} {L3 Experimental split-level fractions} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins index 20d01acd7b0..aee872b5886 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins @@ -3,7 +3,7 @@ File: xfrac.ins Copyright (C) 2004,2008-2010 Morten Hoegholm - (C) 2011,2012,2016,2017,2019-2021 The LaTeX Project + (C) 2011,2012,2016,2017,2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -25,7 +25,7 @@ The released version of this bundle is available from CTAN. \preamble Copyright (C) 2004,2008-2010 Morten Hoegholm - (C) 2011-2021 The LaTeX Project + (C) 2011-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index f601bd9c5f2..03243ec0e25 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -4,7 +4,7 @@ % % Copyright (C) 1999 Frank Mittelbach, Chris Rowley, David Carlisle % (C) 2004-2008 Frank Mittelbach, The LaTeX Project -% (C) 2009-2021 The LaTeX Project +% (C) 2009-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -67,7 +67,7 @@ % }^^A % } % -% \date{Released 2021-11-12} +% \date{Released 2022-01-12} % % \maketitle % @@ -1064,7 +1064,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xparse}{2021-11-12}{} +\ProvidesExplPackage{xparse}{2022-01-12}{} {L3 Experimental document command parser} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins index 98a6dd8a394..c69d316de75 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins @@ -2,7 +2,7 @@ File: xparse.ins -Copyright (C) 2000-2012,2016,2017,2019-2021 The LaTeX Project +Copyright (C) 2000-2012,2016,2017,2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -23,7 +23,7 @@ The released version of this bundle is available from CTAN. \preamble -Copyright (C) 2009-2021 The LaTeX Project +Copyright (C) 2009-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 8dfe79ec343..987e20b6dda 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -4,7 +4,7 @@ % % Copyright (C) 1999 Frank Mittelbach, Chris Rowley, David Carlisle % (C) 2004-2010 Frank Mittelbach, The LaTeX Project -% (C) 2011-2021 The LaTeX Project +% (C) 2011-2022 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-11-12} +% \date{Released 2022-01-12} % % \maketitle % @@ -682,7 +682,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xtemplate}{2021-11-12}{} +\ProvidesExplPackage{xtemplate}{2022-01-12}{} {L3 Experimental prototype document functions} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins index 2e459227f7d..48eea78c7f4 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins @@ -2,7 +2,7 @@ File: xtemplate.ins -Copyright (C) 2000-2012,2016,2017,2019-2021 The LaTeX Project +Copyright (C) 2000-2012,2016,2017,2019-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -34,7 +34,7 @@ license information is placed in the derived files. \preamble -Copyright (C) 2011-2021 The LaTeX Project +Copyright (C) 2011-2022 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of |