diff options
author | Karl Berry <karl@freefriends.org> | 2022-11-02 22:00:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-11-02 22:00:49 +0000 |
commit | 3f1026bdc52825d68d83555c8d4cdc31a41f7687 (patch) | |
tree | 199f5a2a890795c71d60f3f33d3869d3eb714ba4 /Master/texmf-dist/tex/latex-dev | |
parent | 263850a3c1c53d9e6c691c7046923b77f46aa465 (diff) |
latex-dev 2022-11 (2nov22)
git-svn-id: svn://tug.org/texlive/trunk@64899 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev')
9 files changed, 307 insertions, 727 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx index fb37f7bfdb1..b8a4e3a4c36 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx @@ -705,8 +705,8 @@ %%% From File: ltvers.dtx \def\fmtname{LaTeX2e} \edef\fmtversion - {2022-11-01} -\def\patch@level{-2} + {2023-05-01} +\def\patch@level{-0} \edef\development@branch@name{develop \the\year-\the\month-\the\day} \iffalse \def\reserved@a#1/#2/#3\@nil{% @@ -1367,7 +1367,7 @@ \let\@iden\@firstofone \long\def\@thirdofthree#1#2#3{#3} \def\@expandtwoargs#1#2#3{% -\edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a} +\protected@edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a} \edef\@backslashchar{\expandafter\@gobble\string\\} \def\@unexpandable@protect{\noexpand\protect\noexpand} \def\DeclareRobustCommand{\@star@or@long\declare@robustcommand} @@ -14257,7 +14257,7 @@ Type H <return> for immediate help.}% {\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}% \reserved@a\reserved@b \@expl@@@filehook@clear@replacement@flag@@ - \expandafter\xdef\csname opt@\reserved@a\endcsname{% + \expandafter\protected@xdef\csname opt@\reserved@a\endcsname{% \@ifundefined{opt@\reserved@a}\@empty {\csname opt@\reserved@a\endcsname,}% \zap@space#2 \@empty}% @@ -14298,7 +14298,7 @@ Type H <return> for immediate help.}% \@onlypreamble\OptionNotUsed \def\ProcessOptions{% \let\ds@\@empty - \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% + \protected@edef\@curroptions{\@ptionlist{\@currname.\@currext}}% \@ifstar\@xprocess@ptions\@process@ptions} \@onlypreamble\ProcessOptions \def\@process@ptions{% @@ -14319,7 +14319,7 @@ Type H <return> for immediate help.}% \ifx\@classoptionslist\relax\else \@for\CurrentOption:=\@classoptionslist\do{% \ifx\CurrentOption\@empty\else - \@ifundefined{ds@\CurrentOption}{}{% + \@ifundefined{ds@\detokenize\expandafter{\CurrentOption}}{}{% \@use@ption \expandafter\let\csname ds@\CurrentOption\endcsname\@empty }% @@ -14330,7 +14330,7 @@ Type H <return> for immediate help.}% \@onlypreamble\@xprocess@ptions \def\@process@pti@ns{% \@for\CurrentOption:=\@curroptions\do{% - \@ifundefined{ds@\CurrentOption}% + \@ifundefined{ds@\detokenize\expandafter{\CurrentOption}}% {\@use@ption \default@ds}% \@use@ption}% @@ -14348,7 +14348,7 @@ Type H <return> for immediate help.}% \@expandtwoargs\@removeelement {\expandafter\@remove@eq@value\CurrentOption=\@nil}% \@unusedoptionlist\@unusedoptionlist - \csname ds@\CurrentOption\endcsname} + \csname ds@\detokenize\expandafter{\CurrentOption}\endcsname} \@onlypreamble\@use@ption \def\ExecuteOptions#1{% \edef\@fortmp{\zap@space#1 \@empty}% @@ -14445,7 +14445,7 @@ Type H <return> for immediate help.}% \def\@fileswith@pti@ns#1[#2]#3[#4]{% \ifx#1\@clsextension \ifx\@classoptionslist\relax - \xdef\@classoptionslist{\zap@space#2 \@empty}% + \protected@xdef\@classoptionslist{\zap@space#2 \@empty}% \gdef\@raw@classoptionslist{#2}% \def\reserved@a{% \@onefilewithoptions#3[{#2}][{#4}]#1% @@ -14480,15 +14480,13 @@ Type H <return> for immediate help.}% \global\let\@currext#4% \@ifl@aded\@currext\@currname {% - \@ifundefined{opt@fam@\@currname.\@currext} + \@ifundefined{opt@handler@\@currname.\@currext} {\@onefilewithoptions@clashchk{#2}} {% - \expandafter\edef\csname opt@\@currname.\@currext\endcsname + \expandafter\protected@edef\csname opt@\@currname.\@currext\endcsname {\zap@space#2 \@empty}% \@namedef{@raw@opt@\@currname.\@currext}{#2}% - \expandafter\expandafter\expandafter\ProcessKeyOptions - \expandafter\expandafter\expandafter - [\csname opt@fam@\@currname.\@currext\endcsname]% + \@nameuse{opt@handler@\@currname.\@currext}% }% }% {\makeatletter @@ -14649,7 +14647,7 @@ Type H <return> for immediate help.}% \@onlypreamble\@unknownoptionerror \def\@@unprocessedoptions{% \ifx\@currext\@pkgextension - \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% + \protected@edef\@curroptions{\@ptionlist{\@currname.\@currext}}% \@for\CurrentOption:=\@curroptions\do{% \ifx\CurrentOption\@empty\else\@unknownoptionerror\fi}% \fi} @@ -15031,7 +15029,8 @@ Type H <return> for immediate help.}% { \__keys_options_expand_module:Nn \__keys_options_aux:n {#1} } \cs_new_protected:Npn \__keys_options_aux:n #1 { - \cs_gset_nopar:cpn { opt@fam@\@currname.\@currext } {#1} + \cs_gset_protected:cpn { opt@handler@\@currname.\@currext } + { \ProcessKeyOptions [ #1 ] } \cs_set_protected:Npn \__keys_option_end: { } \clist_clear:N \l__keys_options_clist \__keys_options_global:n {#1} @@ -15094,11 +15093,12 @@ Type H <return> for immediate help.}% \cs_new_protected:Npn \__keys_options_class:nnn #1#2#3 { \keys_if_exist:nnTF {#3} {#1} - { \clist_put_right:Nn \l__keys_options_clist {#2} } { - \str_if_eq:eeF - { \exp_not:v { @raw@opt@ \@currname . \@currext } } - { \exp_not:V \@raw@classoptionslist } + \clist_put_right:Nn \l__keys_options_clist {#2} + \clist_remove_all:Nn \@unusedoptionlist {#1} + } + { + \clist_if_in:NnF \@unusedoptionlist {#1} { \clist_put_right:Nn \@unusedoptionlist {#1} } } } @@ -15173,11 +15173,9 @@ Type H <return> for immediate help.}% \cs_new_protected:Npn \__keys_options_loaded:nn #1#2 { \bool_if:NTF \l__keys_options_loading_bool - { - \msg_warning:nnxx { keys } { load-option-ignored } - { \use:c { opt@fam@\@currname.\@currext } } {#2} - } - { \msg_error:nnnn { keys } { load-only } {#1} {#2} } + { \msg_warning:nnnn { keys } { load-option-ignored } } + { \msg_error:nnnn { keys } { load-only } } + {#1} {#2} } \msg_new:nnn { keys } { load-option-ignored } { @@ -17351,12 +17349,50 @@ Type H <return> for immediate help.}% \lccode`\^^[=`\^^[ % oe in OT1 \fi % End of reset block for 8-bit engines \ExplSyntaxOn -\cs_new_protected_nopar:cpn{MakeUppercase~}{\text_uppercase:n} -\cs_set_nopar:Npx\MakeUppercase#1{\use:c{MakeUppercase~}{#1}} -\cs_new_protected_nopar:cpn{MakeLowercase~}{\text_lowercase:n} -\cs_set_nopar:Npx\MakeLowercase#1{\use:c{MakeLowercase~}{#1}} -\cs_new_protected_nopar:cpn{MakeTitlecase~}{\text_titlecase:n} -\cs_set_nopar:Npx\MakeTitlecase#1{\use:c{MakeTitlecase~}{#1}} +\keys_define:nn { __kernel } + { + lang .str_set:N = \reserved@a , + locale .str_set:N = \reserved@a + } +\cs_new_protected:Npn \@@text@case@aux #1#2#3 + { + \cs_set_nopar:Npn \reserved@a { } + \tl_if_blank:nTF {#2} + { \@@text@case@aux@ } + { \keys_set:nn { __kernel } {#2} } + \use:c { text_ #1 case:Vn } \reserved@a {#3} + } +\cs_new_protected:Npn \@@text@case@aux@ { } +\tl_gput_right:Nn \@kernel@after@begindocument + { + \@ifpackageloaded { babel } + { + \@ifpackagelater { babel } { 2020-01-15 } + { + \cs_gset_protected:Npn \@@text@case@aux@ + { + \str_set:Nx \reserved@a + { \localeinfo* { tag.bcp47 } } + } + } + { } + } + { } + } +\exp_args_generate:n { cnx } +\cs_set_protected:Npn \reserved@a #1 + { + \cs_generate_variant:cn { text_ \str_lowercase:n {#1} case:nn } { V } + \cs_new_protected:cpx { Make#1case \c_space_tl \c_space_tl \c_space_tl } [##1] ##2 + { \exp_not:N \@@text@case@aux { \str_lowercase:n {#1} } {##1} {##2} } + \ExpandArgs { cnx } \NewExpandableDocumentCommand + { Make#1case } + { O{} +m } + { \exp_not:c { Make#1case \c_space_tl \c_space_tl \c_space_tl } [####1] {####2} } + } +\reserved@a { Upper } +\reserved@a { Lower } +\reserved@a { Title } \cs_new_protected_nopar:Npn\AddToNoCaseChangeList {\tl_put_right:Nn \l_text_case_exclude_arg_tl} \AddToNoCaseChangeList{ \NoCaseChange } diff --git a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty index d573c3f6cca..61da7ccb865 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty +++ b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty @@ -290,7 +290,7 @@ } %%% From File: ltvers.dtx \edef\latexreleaseversion - {2022-11-01} + {2023-05-01} \newif\if@includeinrelease \@includeinreleasefalse \def\IncludeInRelease#1{% @@ -1430,6 +1430,16 @@ of this package available from CTAN} \IncludeInRelease{0000/00/00}{\@carcube}{Undo: Make \@carcube long}% \def\@carcube#1#2#3#4\@nil{#1#2#3} \EndIncludeInRelease +\IncludeInRelease{2022/11/01}% + {\@expandtwoargs}{protected edef}% +\def\@expandtwoargs#1#2#3{% +\protected@edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a} +\EndIncludeInRelease +\IncludeInRelease{00/00/00}% + {\@expandtwoargs}{protected edef}% +\def\@expandtwoargs#1#2#3{% +\edef\reserved@a{\noexpand#1{#2}{#3}}\reserved@a} +\EndIncludeInRelease \IncludeInRelease{2020/10/01}{\MakeRobust}{\MakeRobust}% \def\MakeRobust#1{% \count@=\escapechar @@ -14027,7 +14037,7 @@ of this package available from CTAN} {\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}% \reserved@a\reserved@b \@expl@@@filehook@clear@replacement@flag@@ - \expandafter\xdef\csname opt@\reserved@a\endcsname{% + \expandafter\protected@xdef\csname opt@\reserved@a\endcsname{% \@ifundefined{opt@\reserved@a}\@empty {\csname opt@\reserved@a\endcsname,}% \zap@space#2 \@empty}% @@ -14093,7 +14103,7 @@ of this package available from CTAN} \ifx\@classoptionslist\relax\else \@for\CurrentOption:=\@classoptionslist\do{% \ifx\CurrentOption\@empty\else - \@ifundefined{ds@\CurrentOption}{}{% + \@ifundefined{ds@\detokenize\expandafter{\CurrentOption}}{}{% \@use@ption \expandafter\let\csname ds@\CurrentOption\endcsname\@empty }% @@ -14122,7 +14132,7 @@ of this package available from CTAN} {\@process@pti@ns}{Unused options issue}% \def\@process@pti@ns{% \@for\CurrentOption:=\@curroptions\do{% - \@ifundefined{ds@\CurrentOption}% + \@ifundefined{ds@\detokenize\expandafter{\CurrentOption}}% {\@use@ption \default@ds}% \@use@ption}% @@ -14156,7 +14166,7 @@ of this package available from CTAN} \@expandtwoargs\@removeelement {\expandafter\@remove@eq@value\CurrentOption=\@nil}% \@unusedoptionlist\@unusedoptionlist - \csname ds@\CurrentOption\endcsname} + \csname ds@\detokenize\expandafter{\CurrentOption}\endcsname} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% {\@use@ption}{filter unused option list}% @@ -14221,7 +14231,7 @@ of this package available from CTAN} \def\@fileswith@pti@ns#1[#2]#3[#4]{% \ifx#1\@clsextension \ifx\@classoptionslist\relax - \xdef\@classoptionslist{\zap@space#2 \@empty}% + \protected@xdef\@classoptionslist{\zap@space#2 \@empty}% \gdef\@raw@classoptionslist{#2}% \def\reserved@a{% \@onefilewithoptions#3[{#2}][{#4}]#1% @@ -14313,15 +14323,13 @@ of this package available from CTAN} \global\let\@currext#4% \@ifl@aded\@currext\@currname {% - \@ifundefined{opt@fam@\@currname.\@currext} + \@ifundefined{opt@handler@\@currname.\@currext} {\@onefilewithoptions@clashchk{#2}} {% - \expandafter\edef\csname opt@\@currname.\@currext\endcsname + \expandafter\protected@edef\csname opt@\@currname.\@currext\endcsname {\zap@space#2 \@empty}% \@namedef{@raw@opt@\@currname.\@currext}{#2}% - \expandafter\expandafter\expandafter\ProcessKeyOptions - \expandafter\expandafter\expandafter - [\csname opt@fam@\@currname.\@currext\endcsname]% + \@nameuse{opt@handler@\@currname.\@currext}% }% }% {\makeatletter diff --git a/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua b/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua index b59cc1484bd..1565ae7d19d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua +++ b/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua @@ -240,7 +240,107 @@ local function new_luafunction(name) return tex_count[luafunction_count_name] end luatexbase.new_luafunction = new_luafunction -local callbacklist = callbacklist or { } +local realcallbacklist = {} +local callbackrules = {} +local callbacklist = setmetatable({}, { + __index = function(t, name) + local list = realcallbacklist[name] + local rules = callbackrules[name] + if list and rules then + local meta = {} + for i, entry in ipairs(list) do + local t = {value = entry, count = 0, pos = i} + meta[entry.description], list[i] = t, t + end + local count = #list + local pos = count + for i, rule in ipairs(rules) do + local rule = rules[i] + local pre, post = meta[rule[1]], meta[rule[2]] + if pre and post then + if rule.type then + if not rule.hidden then + assert(rule.type == 'incompatible-warning' and luatexbase_warning + or rule.type == 'incompatible-error' and luatexbase_error)( + "Incompatible functions \"" .. rule[1] .. "\" and \"" .. rule[2] + .. "\" specified for callback \"" .. name .. "\".") + rule.hidden = true + end + else + local post_count = post.count + post.count = post_count+1 + if post_count == 0 then + local post_pos = post.pos + if post_pos ~= pos then + local new_post_pos = list[pos] + new_post_pos.pos = post_pos + list[post_pos] = new_post_pos + end + list[pos] = nil + pos = pos - 1 + end + pre[#pre+1] = post + end + end + end + for i=1, count do -- The actual sort begins + local current = list[i] + if current then + meta[current.value.description] = nil + for j, cur in ipairs(current) do + local count = cur.count + if count == 1 then + pos = pos + 1 + list[pos] = cur + else + cur.count = count - 1 + end + end + list[i] = current.value + else + -- Cycle occured. TODO: Show cycle for debugging + -- list[i] = ... + local remaining = {} + for name, entry in next, meta do + local value = entry.value + list[#list + 1] = entry.value + remaining[#remaining + 1] = name + end + table.sort(remaining) + local first_name = remaining[1] + for j, name in ipairs(remaining) do + local entry = meta[name] + list[i + j - 1] = entry.value + for _, post_entry in ipairs(entry) do + local post_name = post_entry.value.description + if not remaining[post_name] then + remaining[post_name] = name + end + end + end + local cycle = {first_name} + local index = 1 + local last_name = first_name + repeat + cycle[last_name] = index + last_name = remaining[last_name] + index = index + 1 + cycle[index] = last_name + until cycle[last_name] + local length = index - cycle[last_name] + 1 + table.move(cycle, cycle[last_name], index, 1) + for i=2, length//2 do + cycle[i], cycle[length + 1 - i] = cycle[length + 1 - i], cycle[i] + end + error('Cycle occured at ' .. table.concat(cycle, ' -> ', 1, length)) + end + end + end + realcallbacklist[name] = list + t[name] = list + return list + end +}) local list, data, exclusive, simple, reverselist = 1, 2, 3, 4, 5 local types = { list = list, @@ -481,10 +581,10 @@ local function add_to_callback(name, func, description) .. "add_to_callback(<callback>, <function>, <description>)" ) end - local l = callbacklist[name] + local l = realcallbacklist[name] if l == nil then l = { } - callbacklist[name] = l + realcallbacklist[name] = l local shared = shared_callbacks[name] if shared then shared.count = shared.count + 1 @@ -499,7 +599,6 @@ local function add_to_callback(name, func, description) func = func, description = description, } - local priority = #l + 1 if callbacktypes[name] == exclusive then if #l == 1 then luatexbase_error( @@ -507,13 +606,56 @@ local function add_to_callback(name, func, description) name .. "'") end end - table.insert(l, priority, f) + table.insert(l, f) + callbacklist[name] = nil luatexbase_log( - "Inserting `" .. description .. "' at position " - .. priority .. " in `" .. name .. "'." + "Inserting `" .. description .. "' in `" .. name .. "'." ) end luatexbase.add_to_callback = add_to_callback +local function declare_callback_rule(name, desc1, relation, desc2) + if not callbacktypes[name] or + not desc1 or not desc2 or + desc1 == "" or desc2 == "" then + luatexbase_error( + "Unable to create ordering constraint. " + .. "Correct usage:\n" + .. "declare_callback_rule(<callback>, <description_a>, <description_b>)" + ) + end + if relation == 'before' then + relation = nil + elseif relation == 'after' then + desc2, desc1 = desc1, desc2 + relation = nil + elseif relation == 'incompatible-warning' or relation == 'incompatible-error' then + elseif relation == 'unrelated' then + else + luatexbase_error( + "Unknown relation type in declare_callback_rule" + ) + end + callbacklist[name] = nil + local rules = callbackrules[name] + if rules then + for i, rule in ipairs(rules) do + if rule[1] == desc1 and rule[2] == desc2 or rule[1] == desc2 and rule[2] == desc1 then + if relation == 'unrelated' then + table.remove(rules, i) + else + rule[1], rule[2], rule.type = desc1, desc2, relation + end + return + end + end + if relation ~= 'unrelated' then + rules[#rules + 1] = {desc1, desc2, type = relation} + end + elseif relation ~= 'unrelated' then + callbackrules[name] = {{desc1, desc2, type = relation}} + end +end +luatexbase.declare_callback_rule = declare_callback_rule local function remove_from_callback(name, description) if not name or name == "" then luatexbase_error("Unable to remove function from callback:\n" .. @@ -528,7 +670,7 @@ local function remove_from_callback(name, description) .. "remove_from_callback(<callback>, <description>)" ) end - local l = callbacklist[name] + local l = realcallbacklist[name] if not l then luatexbase_error( "No callback list for `" .. name .. "'\n") @@ -551,6 +693,7 @@ local function remove_from_callback(name, description) "Removing `" .. description .. "' from `" .. name .. "'." ) if #l == 0 then + realcallbacklist[name] = nil callbacklist[name] = nil local shared = shared_callbacks[name] if shared then @@ -568,12 +711,12 @@ luatexbase.remove_from_callback = remove_from_callback local function in_callback(name, description) if not name or name == "" - or not callbacklist[name] + or not realcallbacklist[name] or not callbacktypes[name] or not description then return false end - for _, i in pairs(callbacklist[name]) do + for _, i in pairs(realcallbacklist[name]) do if i.description == description then return true end @@ -582,7 +725,7 @@ local function in_callback(name, description) end luatexbase.in_callback = in_callback local function disable_callback(name) - if(callbacklist[name] == nil) then + if(realcallbacklist[name] == nil) then callback_register(name, false) else luatexbase_error("Callback list for " .. name .. " not empty") @@ -593,7 +736,7 @@ local function callback_descriptions (name) local d = {} if not name or name == "" - or not callbacklist[name] + or not realcallbacklist[name] or not callbacktypes[name] then return d diff --git a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex index f676d94a416..dc356201b06 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex +++ b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex @@ -47,7 +47,7 @@ #1#2[#3]{\endgroup\immediate\write-1{File: #1 #3}} \fi \ProvidesFile{ltluatex.tex}% -[2022/08/13 v1.1y +[2022/10/03 v1.2a LuaTeX support for plain TeX (core) ] \edef\etatcatcode{\the\catcode`\@} diff --git a/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx b/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx index 6d89029bf83..ebdf7f5f99c 100644 --- a/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx +++ b/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx @@ -34,8 +34,8 @@ %% %% The LaTeX Project and any individual authors listed elsewhere %% in this file. -\def\LaTeXFirstAidDate{2022/06/23} -\def\LaTeXFirstAidVersion{v1.0s} +\def\LaTeXFirstAidDate{2022/10/29} +\def\LaTeXFirstAidVersion{v1.0u} \ProvidesFile{latex2e-first-aid-for-external-files.ltx} [\LaTeXFirstAidDate\space \LaTeXFirstAidVersion\space LaTeX kernel fixes to external files and packages] @@ -71,6 +71,7 @@ } } \ExplSyntaxOff +\AddToHook{file/babel.sty/before}[firstaid]{\def\BabelCaseHack{}} \AddToHook{file/bigfoot.sty/after}{% \ifnum\count10<\insc@unt \global\count10=\insc@unt diff --git a/Master/texmf-dist/tex/latex-dev/graphics/mathcolor.ltx b/Master/texmf-dist/tex/latex-dev/graphics/mathcolor.ltx index c7588a3e195..6e9c12551ce 100644 --- a/Master/texmf-dist/tex/latex-dev/graphics/mathcolor.ltx +++ b/Master/texmf-dist/tex/latex-dev/graphics/mathcolor.ltx @@ -13,85 +13,79 @@ %% %% File: mathcolor.dtx (C) Copyright 2021-2022 %%% From File: mathcolor.dtx -\def\mathcolorversion{v1.0b} -\def\mathcolordate{2022/01/28} - - +\def\mathcolorversion{v1.0c} +\def\mathcolordate{2022/07/25} \ifcsname mathcolor\endcsname \endinput \fi \ExplSyntaxOn \seq_new:N \g__mathcolor_seq -\DeclareDocumentCommand \mathcolor { o m m } { - \mode_if_math:F { \non@alpherr {\mathcolor\space} } - \seq_gpush:No \g__mathcolor_seq \current@color - \group_insert_after:N \use_none:n - \IfValueTF{#1} { \color[#1]{#2} }{ \color{#2} } - #3 - \__mathcolor_scan_for_scripts:w -} -\cs_new_protected:Npn \__mathcolor_scan_for_scripts:w { - \__mathcolor_peek_catcode_ignore_filler_expand:NTF \c_math_subscript_token - { \__mathcolor_handle_scripts:Nw } - { \token_if_math_superscript:NTF \l_peek_token - { \__mathcolor_handle_scripts:Nw } - { \token_case_meaning:NnTF \l_peek_token +\DeclareDocumentCommand \mathcolor { o m m } + { + \mode_if_math:F { \non@alpherr {\mathcolor\space} } + \seq_gpush:No \g__mathcolor_seq \current@color + \group_insert_after:N \use_none:n + \IfValueTF {#1} { \color[#1]{#2} } { \color{#2} } + #3 + \__mathcolor_scan_for_scripts:w + } +\cs_new_protected:Npn \__mathcolor_scan_for_scripts:w + { + \peek_remove_filler:n + { + \group_align_safe_begin: + \token_case_catcode:NnTF \l_peek_token { - \limits { \limits } - \nolimits { \nolimits } - \displaylimits { \displaylimits } + \c_math_subscript_token { } + \c_math_superscript_token { } } - { \__mathcolor_scan_for_scripts:w \use_none:n } - { \peek_meaning_remove:NTF ' - { \__mathcolor_handle_scripts:Nw ^\c_group_begin_token \prim@s } - { \reset@color - \seq_gpop:NN \g__mathcolor_seq \current@color - } + { \__mathcolor_handle_scripts:Nw } + { + \token_case_meaning:NnTF \l_peek_token + { + \limits { \limits } + \nolimits { \nolimits } + \displaylimits { \displaylimits } + } + { + \group_align_safe_end: % case 4 + \__mathcolor_scan_for_scripts:w \use_none:n + } + { + \token_if_eq_meaning:NNTF \l_peek_token ' + { + \__mathcolor_handle_scripts:Nw ^ + \c_group_begin_token + \exp_after:wN \prim@s \use_none:n + } + { + \group_align_safe_end: % case 1 + \reset@color + \seq_gpop:NN \g__mathcolor_seq \current@color + } + } } } - } -} - -\cs_new_protected:Npn \__mathcolor_handle_scripts:Nw #1 { + } +\cs_new_protected:Npn \__mathcolor_handle_scripts:Nw #1 + { #1 \c_group_begin_token \c_group_begin_token \seq_get:NN \g__mathcolor_seq \current@color \set@color \group_insert_after:N \c_group_end_token \group_insert_after:N \__mathcolor_scan_for_scripts:w - \__mathcolor_peek_catcode_ignore_filler_expand:NTF \c_group_begin_token - { \peek_catcode_remove:NT \c_group_begin_token { } } - { \__mathcolor_handle_unbraced_script:N } - }% \end{macrocode} - -\cs_new_protected:Npn \__mathcolor_handle_unbraced_script:N #1 { - #1 \c_group_end_token } -\tl_new:N \l__mathcolor_peek_tmp_tl -\cs_new_protected:Npn \__mathcolor_peek_catcode_ignore_filler_expand:NTF #1#2#3 - { - \tl_set:Nn \l__mathcolor_peek_tmp_tl - { \token_if_eq_catcode:NNTF \l_peek_token #1 {#2} {#3} } - \__mathcolor_peek_expand:w - } -\cs_new_protected:Npn \__mathcolor_peek_expand:w - { - \exp_after:wN \peek_catcode_remove:NTF - \exp_after:wN \c_space_token - \exp_after:wN \__mathcolor_peek_test_expand:w - \exp_after:wN \__mathcolor_peek_test_relax:w - \exp:w \exp_end_continue_f:w - } -\cs_new_protected:Npn \__mathcolor_peek_test_expand:w - { - \token_if_expandable:NTF \l_peek_token - { \__mathcolor_peek_expand:w } - { \l__mathcolor_peek_tmp_tl } + \peek_remove_filler:n + { + \token_if_eq_meaning:NNTF \l_peek_token \c_group_begin_token + { + \group_align_safe_end: % case 2 + \peek_catcode_remove:NT \c_group_begin_token { } + } + { + \exp_after:wN \group_align_safe_end: % case 3 + \use_ii_i:nn \c_group_end_token + } + } } -\cs_new_protected:Npn \__mathcolor_peek_test_relax:w - { - \peek_meaning_remove:NTF \scan_stop: - { \__mathcolor_peek_expand:w } - { \__mathcolor_peek_test_expand:w } - } \ExplSyntaxOff - %%%%%%%%%%%%%%%% \endinput %% diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx index 560c1b98bae..66c25fc3e89 100644 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx +++ b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-footnotes.ltx @@ -34,7 +34,7 @@ %% %% File: latex-lab-footnotes.dtx \ProvidesFile{latex-lab-footnotes.ltx} - [2022-03-10 v0.6a changes to the footnote interfaces] + [2022-07-22 v0.6b changes to the footnote interfaces] % not looked at yet @@ -300,13 +300,13 @@ } -\DeclareDocumentCommand\footnotetext {om} { +\DeclareDocumentCommand\footnotetext {o+m} { \fnote_set_fnmark:nn {#1} \@mpfn \@footnotetext {#2} } -\DeclareDocumentCommand\footnote {om} { +\DeclareDocumentCommand\footnote {o+m} { \fnote_step_fnmark:nn {#1} \@mpfn \cs_set_eq:NN \__fnote_footnotemark_finish: \prg_do_nothing: \@footnotemark diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-prototype.sty b/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-prototype.sty deleted file mode 100644 index cedf3ad4d1b..00000000000 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/latex-lab-prototype.sty +++ /dev/null @@ -1,301 +0,0 @@ -%% -%% This is file `latex-lab-prototype.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% latex-lab-prototype.dtx (with options: `2ekernel') -%% -%% This is a generated file. -%% -%% Copyright 2021,2022 LaTeX Project -%% -%% This file was generated from file(s) of the `LaTeX-lab Bundle'. -%% ------------------------------------------------------------------------------------ -%% -%% It may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3c -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3c or later is part of all distributions of LaTeX -%% version 2008 or later. -%% -%% This file may only be distributed together with a copy of the LaTeX -%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' -%% without such generated files. -%% -%% The newest sources can be found below -%% -%% https://github.com/latex3/latex2e/required/latex-lab -%% -%% where one can also log issues in case there are any. -%% -%% -%% File: latex-lab-prototype.dtx -\ExplSyntaxOn -\tl_if_exist:NF \l__keys_precompile_tl - { - \bool_new:N \l__keys_precompile_bool - \tl_new:N \l__keys_precompile_tl - } -\cs_gset_protected:Npn \__keys_precompile:n #1 - { - \bool_if:NTF \l__keys_precompile_bool - { \tl_put_right:Nn \l__keys_precompile_tl } - { \use:n } - {#1} - } -\cs_gset_protected:Npn \__keys_bool_set:Nnnn #1#2#3#4 - { - \bool_if_exist:NF #1 { \bool_new:N #1 } - \__keys_choice_make: - \__keys_cmd_set:nx { \l_keys_path_str / true } - { \exp_not:c { bool_ #2 set_ #3 :N } \exp_not:N #1 } - \__keys_cmd_set:nx { \l_keys_path_str / false } - { \exp_not:c { bool_ #2 set_ #4 :N } \exp_not:N #1 } - \__keys_cmd_set_direct:nn { \l_keys_path_str / unknown } - { - \msg_error:nnx { keys } { boolean-values-only } - \l_keys_key_str - } - \__keys_default_set:n { true } - } -\cs_gset_protected:Npn \__keys_choice_make_aux:N #1 - { - \cs_set_nopar:cpn { \c__keys_type_root_str \l_keys_path_str } - { choice } - \__keys_cmd_set_direct:nn \l_keys_path_str { #1 {##1} } - \__keys_cmd_set_direct:nn { \l_keys_path_str / unknown } - { - \msg_error:nnxx { keys } { choice-unknown } - \l_keys_path_str {##1} - } - } -\cs_gset_protected:Npn \__keys_cmd_set:nn #1#2 - { \__keys_cmd_set_direct:nn {#1} { \__keys_precompile:n {#2} } } -\cs_gset_protected:Npn \__keys_cmd_set_direct:nn #1#2 - { \cs_set_protected:cpn { \c__keys_code_root_str #1 } ##1 {#2} } -\cs_gset_protected:Npn \__keys_cs_set:NNpn #1#2#3# - { - \cs_set_protected:cpx { \c__keys_code_root_str \l_keys_path_str } ##1 - { - \__keys_precompile:n - { #1 \exp_not:N #2 \exp_not:n {#3} {##1} } - } - \use_none:n - } -\cs_gset_protected:Npn \__keys_meta_make:n #1 - { - \exp_args:NVo \__keys_cmd_set_direct:nn \l_keys_path_str - { - \exp_after:wN \keys_set:nn \exp_after:wN - { \l__keys_module_str } {#1} - } - } -\cs_gset_protected:Npn \__keys_meta_make:nn #1#2 - { - \exp_args:NV \__keys_cmd_set_direct:nn - \l_keys_path_str { \keys_set:nn {#1} {#2} } - } -\cs_gset_protected:Npn \keys_precompile:nnN #1#2#3 - { - \bool_set_true:N \l__keys_precompile_bool - \tl_clear:N \l__keys_precompile_tl - \keys_set:nn {#1} {#2} - \bool_set_false:N \l__keys_precompile_bool - \tl_set_eq:NN #3 \l__keys_precompile_tl - } -\cs_gset_protected:Npn \__keys_show:Nnn #1#2#3 - { - #1 { keys } { show-key } - { \__keys_trim_spaces:n { #2 / #3 } } - { - \keys_if_exist:nnT {#2} {#3} - { - \exp_args:Nnf \msg_show_item_unbraced:nn { code } - { - \exp_args:Ne \__keys_show:n - { - \exp_args:Nc \cs_replacement_spec:N - { - \c__keys_code_root_str - \__keys_trim_spaces:n { #2 / #3 } - } - } - } - } - } - { } { } - } -\cs_gset:Npx \__keys_show:n #1 - { - \exp_not:N \__keys_show:w - #1 - \tl_to_str:n { \__keys_precompile:n } - #1 - \tl_to_str:n { \__keys_precompile:n } - \exp_not:N \s__keys_stop - } -\use:x - { - \cs_gset:Npn \exp_not:N \__keys_show:w - ##1 \tl_to_str:n { \__keys_precompile:n } - ##2 \tl_to_str:n { \__keys_precompile:n } - ##3 \exp_not:N \s__keys_stop - } - { - \tl_if_blank:nTF {#2} - {#1} - { \__keys_show:Nw #2 \s__keys_stop } - } -\use:x - { - \cs_gset:Npn \exp_not:N \__keys_show:Nw ##1##2 - \c_right_brace_str \exp_not:N \s__keys_stop - } - {#2} -\tl_new:N \l__prototype_tmp_tl -\prop_new:N \l__prototype_object_prop -\cs_new_protected:Npn \prototype_declare_object:nn #1#2 - { - \exp_args:Nx \__prototype_declare_object:nn { \int_eval:n {#2} } {#1} - } -\cs_new_protected:Npn \__prototype_declare_object:nn #1#2 - { - \int_compare:nTF { 0 <= #1 <= 9 } - { - \msg_info:nnnn { prototype } { declare-object-type } {#2} {#1} - \prop_put:Nnn \l__prototype_object_prop {#2} {#1} - } - { \msg_error:nnxx { prototype } { bad-number-of-arguments } {#2} {#1} } - } -\tl_new:N \l__prototype_assignments_tl -\cs_new_protected:Npn \prototype_declare_template:nnnn #1#2#3#4 - { - \prop_get:NnNTF \l__prototype_object_prop {#1} \l__prototype_tmp_tl - { - \keys_define:nn { prototype / #1 / #2 } {#3} - \tl_clear_new:c { l__prototype_defaults_ #1 _ #2 _tl } - \cs_generate_from_arg_count:cNnn - { __prototype_template_ #1 _ #2 :w } - \cs_set_protected:Npn - { \l__prototype_tmp_tl } - { - \tl_use:N \l__prototype_assignments_tl - #4 - } - } - { \msg_error:nnn { prototype } { unknown-object-type } {#1} } - } -\cs_new_protected:Npn \prototype_declare_defaults:nnn #1#2#3 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { \tl_set:cn { l__prototype_defaults_ #1 _ #2 _tl } {#3} } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_generate_variant:Nn \keys_precompile:nnN { v , nv } -\cs_new_protected:Npn \prototype_use_template:nnn #1#2#3 - { - \__prototype_declare_aux:nnnn {#1} {#2} {#3} - { \use:c { __prototype_template_ #1 _ #2 :w } } - } -\cs_new_protected:Npn \prototype_declare_instance:nnnn #1#2#3#4 - { - \__prototype_declare_aux:nnnn {#1} {#2} {#4} - { - \tl_clear_new:c { l__prototype_instance_ #1 _ #3 _pars_tl } - \tl_set_eq:cN { l__prototype_instance_ #1 _ #3 _pars_tl } - \l__prototype_assignments_tl - \tl_clear_new:c { l__prototype_instance_ #1 _ #3 _template_tl } - \tl_set:cn { l__prototype_instance_ #1 _ #3 _template_tl } {#2} - } - } -\cs_new_protected:Npn \__prototype_declare_aux:nnnn #1#2#3#4 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { - \keys_precompile:nvN - { prototype / #1 / #2 } - { l__prototype_defaults_ #1 _ #2 _tl } - \l__prototype_assignments_tl - \keys_precompile:nnN { prototype / #1 / #2 } {#3} \l__prototype_tmp_tl - \tl_put_right:NV \l__prototype_assignments_tl \l__prototype_tmp_tl - #4 - } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_use_instance:nn #1#2 - { \prototype_use_instance:nnn {#1} {#2} { } } -\cs_new_protected:Npn \prototype_use_instance:nnn #1#2#3 - { - \tl_if_exist:cTF { l__prototype_instance_ #1 _ #2 _template_tl } - { - \tl_set_eq:Nc \l__prototype_assignments_tl - { l__prototype_instance_ #1 _ #2 _pars_tl } - \tl_if_blank:nF {#3} - { - \keys_precompile:vnN - { - prototype / #1 / - \tl_use:c { l__prototype_instance_ #1 _ #2 _template_tl } - } - {#3} - \l__prototype_tmp_tl - \tl_put_right:NV \l__prototype_assignments_tl - \l__prototype_tmp_tl - } - \use:c - { - __prototype_template_ #1 _ - \tl_use:c { l__prototype_instance_ #1 _ #2 _template_tl } - :w - } - } - { \msg_error:nnn { prototype } { unknown-instance } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_show_template_code:nn #1#2 - { - \prop_if_in:NnTF \l__prototype_object_prop {#1} - { \cs_show:c { __prototype_template_ #1 _ #2 :w } } - { \msg_error:nnn { prototype } { unknown-object-type } {#1} } - } -\cs_new_protected:Npn \prototype_show_template_defaults:nn #1#2 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { \tl_show:c { l__prototype_defaults_ #1 _ #2 _tl } } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_show_instance_values:nn #1#2 - { - \tl_if_exist:cTF { l__prototype_instance_ #1 _ #2 _template_tl } - { \tl_show:c { l__prototype_instance_ #1 _ #2 _pars_tl } } - { \msg_error:nnn { prototype } { unknown-instance } {#1} {#2} } - } -\msg_new:nnnn { prototype } { bad-number-of-arguments } - { Bad~number~of~arguments~for~object~type~'#1'. } - { - An~object~may~accept~between~0~and~9~arguments.\\ - You~asked~to~use~#2~arguments:~this~is~not~supported. - } -\msg_new:nnnn { prototype } { unknown-instance } - { The~instance~'#2'~of~type~'#1'~is~unknown. } - { - You~have~asked~to~use~an~instance~'#2',~ - but~this~has~not~been~created. - } -\msg_new:nnnn { prototype } { unknown-object-type } - { The~object~type~'#1'~is~unknown. } - { An~object~type~needs~to~be~declared~prior~to~using~it. } -\msg_new:nnnn { prototype } { unknown-template } - { The~template~'#2'~of~type~'#1'~is~unknown. } - { - No~interface~has~been~declared~for~a~template~ - '#2'~of~object~type~'#1'. - } -\msg_new:nnn { prototype } { declare-object-type } - { Declaring~object~type~'#1'~taking~#2~argument(s). } -\ExplSyntaxOff -\endinput -%% -%% End of file `latex-lab-prototype.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/latex-lab/prototype-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex-dev/latex-lab/prototype-latex-lab-testphase.ltx deleted file mode 100644 index 876039967c4..00000000000 --- a/Master/texmf-dist/tex/latex-dev/latex-lab/prototype-latex-lab-testphase.ltx +++ /dev/null @@ -1,301 +0,0 @@ -%% -%% This is file `prototype-latex-lab-testphase.ltx', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% latex-lab-prototype.dtx (with options: `2ekernel') -%% -%% This is a generated file. -%% -%% Copyright 2021,2022 LaTeX Project -%% -%% This file was generated from file(s) of the `LaTeX-lab Bundle'. -%% ------------------------------------------------------------------------------------ -%% -%% It may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3c -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3c or later is part of all distributions of LaTeX -%% version 2008 or later. -%% -%% This file may only be distributed together with a copy of the LaTeX -%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' -%% without such generated files. -%% -%% The newest sources can be found below -%% -%% https://github.com/latex3/latex2e/required/latex-lab -%% -%% where one can also log issues in case there are any. -%% -%% -%% File: latex-lab-prototype.dtx -\ExplSyntaxOn -\tl_if_exist:NF \l__keys_precompile_tl - { - \bool_new:N \l__keys_precompile_bool - \tl_new:N \l__keys_precompile_tl - } -\cs_gset_protected:Npn \__keys_precompile:n #1 - { - \bool_if:NTF \l__keys_precompile_bool - { \tl_put_right:Nn \l__keys_precompile_tl } - { \use:n } - {#1} - } -\cs_gset_protected:Npn \__keys_bool_set:Nnnn #1#2#3#4 - { - \bool_if_exist:NF #1 { \bool_new:N #1 } - \__keys_choice_make: - \__keys_cmd_set:nx { \l_keys_path_str / true } - { \exp_not:c { bool_ #2 set_ #3 :N } \exp_not:N #1 } - \__keys_cmd_set:nx { \l_keys_path_str / false } - { \exp_not:c { bool_ #2 set_ #4 :N } \exp_not:N #1 } - \__keys_cmd_set_direct:nn { \l_keys_path_str / unknown } - { - \msg_error:nnx { keys } { boolean-values-only } - \l_keys_key_str - } - \__keys_default_set:n { true } - } -\cs_gset_protected:Npn \__keys_choice_make_aux:N #1 - { - \cs_set_nopar:cpn { \c__keys_type_root_str \l_keys_path_str } - { choice } - \__keys_cmd_set_direct:nn \l_keys_path_str { #1 {##1} } - \__keys_cmd_set_direct:nn { \l_keys_path_str / unknown } - { - \msg_error:nnxx { keys } { choice-unknown } - \l_keys_path_str {##1} - } - } -\cs_gset_protected:Npn \__keys_cmd_set:nn #1#2 - { \__keys_cmd_set_direct:nn {#1} { \__keys_precompile:n {#2} } } -\cs_gset_protected:Npn \__keys_cmd_set_direct:nn #1#2 - { \cs_set_protected:cpn { \c__keys_code_root_str #1 } ##1 {#2} } -\cs_gset_protected:Npn \__keys_cs_set:NNpn #1#2#3# - { - \cs_set_protected:cpx { \c__keys_code_root_str \l_keys_path_str } ##1 - { - \__keys_precompile:n - { #1 \exp_not:N #2 \exp_not:n {#3} {##1} } - } - \use_none:n - } -\cs_gset_protected:Npn \__keys_meta_make:n #1 - { - \exp_args:NVo \__keys_cmd_set_direct:nn \l_keys_path_str - { - \exp_after:wN \keys_set:nn \exp_after:wN - { \l__keys_module_str } {#1} - } - } -\cs_gset_protected:Npn \__keys_meta_make:nn #1#2 - { - \exp_args:NV \__keys_cmd_set_direct:nn - \l_keys_path_str { \keys_set:nn {#1} {#2} } - } -\cs_gset_protected:Npn \keys_precompile:nnN #1#2#3 - { - \bool_set_true:N \l__keys_precompile_bool - \tl_clear:N \l__keys_precompile_tl - \keys_set:nn {#1} {#2} - \bool_set_false:N \l__keys_precompile_bool - \tl_set_eq:NN #3 \l__keys_precompile_tl - } -\cs_gset_protected:Npn \__keys_show:Nnn #1#2#3 - { - #1 { keys } { show-key } - { \__keys_trim_spaces:n { #2 / #3 } } - { - \keys_if_exist:nnT {#2} {#3} - { - \exp_args:Nnf \msg_show_item_unbraced:nn { code } - { - \exp_args:Ne \__keys_show:n - { - \exp_args:Nc \cs_replacement_spec:N - { - \c__keys_code_root_str - \__keys_trim_spaces:n { #2 / #3 } - } - } - } - } - } - { } { } - } -\cs_gset:Npx \__keys_show:n #1 - { - \exp_not:N \__keys_show:w - #1 - \tl_to_str:n { \__keys_precompile:n } - #1 - \tl_to_str:n { \__keys_precompile:n } - \exp_not:N \s__keys_stop - } -\use:x - { - \cs_gset:Npn \exp_not:N \__keys_show:w - ##1 \tl_to_str:n { \__keys_precompile:n } - ##2 \tl_to_str:n { \__keys_precompile:n } - ##3 \exp_not:N \s__keys_stop - } - { - \tl_if_blank:nTF {#2} - {#1} - { \__keys_show:Nw #2 \s__keys_stop } - } -\use:x - { - \cs_gset:Npn \exp_not:N \__keys_show:Nw ##1##2 - \c_right_brace_str \exp_not:N \s__keys_stop - } - {#2} -\tl_new:N \l__prototype_tmp_tl -\prop_new:N \l__prototype_object_prop -\cs_new_protected:Npn \prototype_declare_object:nn #1#2 - { - \exp_args:Nx \__prototype_declare_object:nn { \int_eval:n {#2} } {#1} - } -\cs_new_protected:Npn \__prototype_declare_object:nn #1#2 - { - \int_compare:nTF { 0 <= #1 <= 9 } - { - \msg_info:nnnn { prototype } { declare-object-type } {#2} {#1} - \prop_put:Nnn \l__prototype_object_prop {#2} {#1} - } - { \msg_error:nnxx { prototype } { bad-number-of-arguments } {#2} {#1} } - } -\tl_new:N \l__prototype_assignments_tl -\cs_new_protected:Npn \prototype_declare_template:nnnn #1#2#3#4 - { - \prop_get:NnNTF \l__prototype_object_prop {#1} \l__prototype_tmp_tl - { - \keys_define:nn { prototype / #1 / #2 } {#3} - \tl_clear_new:c { l__prototype_defaults_ #1 _ #2 _tl } - \cs_generate_from_arg_count:cNnn - { __prototype_template_ #1 _ #2 :w } - \cs_set_protected:Npn - { \l__prototype_tmp_tl } - { - \tl_use:N \l__prototype_assignments_tl - #4 - } - } - { \msg_error:nnn { prototype } { unknown-object-type } {#1} } - } -\cs_new_protected:Npn \prototype_declare_defaults:nnn #1#2#3 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { \tl_set:cn { l__prototype_defaults_ #1 _ #2 _tl } {#3} } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_generate_variant:Nn \keys_precompile:nnN { v , nv } -\cs_new_protected:Npn \prototype_use_template:nnn #1#2#3 - { - \__prototype_declare_aux:nnnn {#1} {#2} {#3} - { \use:c { __prototype_template_ #1 _ #2 :w } } - } -\cs_new_protected:Npn \prototype_declare_instance:nnnn #1#2#3#4 - { - \__prototype_declare_aux:nnnn {#1} {#2} {#4} - { - \tl_clear_new:c { l__prototype_instance_ #1 _ #3 _pars_tl } - \tl_set_eq:cN { l__prototype_instance_ #1 _ #3 _pars_tl } - \l__prototype_assignments_tl - \tl_clear_new:c { l__prototype_instance_ #1 _ #3 _template_tl } - \tl_set:cn { l__prototype_instance_ #1 _ #3 _template_tl } {#2} - } - } -\cs_new_protected:Npn \__prototype_declare_aux:nnnn #1#2#3#4 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { - \keys_precompile:nvN - { prototype / #1 / #2 } - { l__prototype_defaults_ #1 _ #2 _tl } - \l__prototype_assignments_tl - \keys_precompile:nnN { prototype / #1 / #2 } {#3} \l__prototype_tmp_tl - \tl_put_right:NV \l__prototype_assignments_tl \l__prototype_tmp_tl - #4 - } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_use_instance:nn #1#2 - { \prototype_use_instance:nnn {#1} {#2} { } } -\cs_new_protected:Npn \prototype_use_instance:nnn #1#2#3 - { - \tl_if_exist:cTF { l__prototype_instance_ #1 _ #2 _template_tl } - { - \tl_set_eq:Nc \l__prototype_assignments_tl - { l__prototype_instance_ #1 _ #2 _pars_tl } - \tl_if_blank:nF {#3} - { - \keys_precompile:vnN - { - prototype / #1 / - \tl_use:c { l__prototype_instance_ #1 _ #2 _template_tl } - } - {#3} - \l__prototype_tmp_tl - \tl_put_right:NV \l__prototype_assignments_tl - \l__prototype_tmp_tl - } - \use:c - { - __prototype_template_ #1 _ - \tl_use:c { l__prototype_instance_ #1 _ #2 _template_tl } - :w - } - } - { \msg_error:nnn { prototype } { unknown-instance } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_show_template_code:nn #1#2 - { - \prop_if_in:NnTF \l__prototype_object_prop {#1} - { \cs_show:c { __prototype_template_ #1 _ #2 :w } } - { \msg_error:nnn { prototype } { unknown-object-type } {#1} } - } -\cs_new_protected:Npn \prototype_show_template_defaults:nn #1#2 - { - \cs_if_exist:cTF { __prototype_template_ #1 _ #2 :w } - { \tl_show:c { l__prototype_defaults_ #1 _ #2 _tl } } - { \msg_error:nnn { prototype } { unknown-template } {#1} {#2} } - } -\cs_new_protected:Npn \prototype_show_instance_values:nn #1#2 - { - \tl_if_exist:cTF { l__prototype_instance_ #1 _ #2 _template_tl } - { \tl_show:c { l__prototype_instance_ #1 _ #2 _pars_tl } } - { \msg_error:nnn { prototype } { unknown-instance } {#1} {#2} } - } -\msg_new:nnnn { prototype } { bad-number-of-arguments } - { Bad~number~of~arguments~for~object~type~'#1'. } - { - An~object~may~accept~between~0~and~9~arguments.\\ - You~asked~to~use~#2~arguments:~this~is~not~supported. - } -\msg_new:nnnn { prototype } { unknown-instance } - { The~instance~'#2'~of~type~'#1'~is~unknown. } - { - You~have~asked~to~use~an~instance~'#2',~ - but~this~has~not~been~created. - } -\msg_new:nnnn { prototype } { unknown-object-type } - { The~object~type~'#1'~is~unknown. } - { An~object~type~needs~to~be~declared~prior~to~using~it. } -\msg_new:nnnn { prototype } { unknown-template } - { The~template~'#2'~of~type~'#1'~is~unknown. } - { - No~interface~has~been~declared~for~a~template~ - '#2'~of~object~type~'#1'. - } -\msg_new:nnn { prototype } { declare-object-type } - { Declaring~object~type~'#1'~taking~#2~argument(s). } -\ExplSyntaxOff -\endinput -%% -%% End of file `prototype-latex-lab-testphase.ltx'. |