activate caching for all Document Commands

This commit is contained in:
Maximilian Keßler 2022-01-31 21:02:48 +01:00
parent bea7380166
commit 48651b4919

View File

@ -1794,9 +1794,12 @@
{ new, renew, provide, declare }
{ \@@_Declarator: TheoremGroup }
{ O{} m }
{
\@@_lazy:n
{
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -1849,9 +1852,12 @@
%
% \begin{macrocode}
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m }
{
\@@_lazy:n
{
\groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
}
}
% \end{macrocode}
% \end{macro}
%
@ -1885,9 +1891,12 @@
%
% \begin{macrocode}
\NewDocumentCommand { \AddTheoremGroupParent } { m m }
{
\@@_lazy:n
{
\groupthm_add_parent:nn { #1 } { #2 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -1973,8 +1982,10 @@
% \begin{macrocode}
\NewDocumentCommand { \AppendToTheoremGroup } { O{} m }
{
\@@_lazy:n {
\groupthm_append_to_group:nn { #1 } { #2 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -2289,13 +2300,7 @@
{ \@@_Declarator: GroupedTheorem }
{ s O{} m }
{
\bool_if:NTF \g_@@_cache_bool
{
\hook_gput_code:nnn {@@/definelazy} { groupthm }
}
{
\use:n
}
\@@_lazy:n
{
\use:c { groupthm_#1_theorem:nnn }
{ ##2 }
@ -2447,12 +2452,15 @@
{ new, provide }
{ \@@_Declarator: GroupedTheoremFamily }
{ s O{} m }
{
\@@_lazy:n
{
\use:c { groupthm_#1_family:nnn }
{ ##2 }
{ ##3 }
{ ##1 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -2497,9 +2505,12 @@
%
% \begin{macrocode}
\NewDocumentCommand { \AddTheoremToGroup } { m }
{
\@@_lazy:n
{
\groupthm_add_theorem_to_group:n { #1 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -2668,6 +2679,34 @@
%
%
%
%
% \begin{macro}{\@@_lazy:n}
% \begin{syntax}
% \cs{@@_lazy:n}\marg{code}
% \end{syntax}
%
% Executes this code lazy at beginning of the document,
% iff caching is active.
%
% At beginning of document, code will be only executed
% if the aux file version was too old, otherwise dropped.
%
% \begin{macrocode}
\cs_new:Npn \@@_lazy:n
{
\bool_if:NTF \g_@@_cache_bool
{
\hook_gput_code:nnn {@@/definelazy} { groupthm }
}
{
\use:n
}
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macrocode}
\hook_gput_code:nnn { begindocument } { groupthm }
{