summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-03-18 19:59:51 +0000
committerKarl Berry <karl@freefriends.org>2024-03-18 19:59:51 +0000
commit766a17b21b04d06ba7a41899213bced74b62cc52 (patch)
tree1c3c1f2b3ebbc54d31ff49f124041bb1aa7cceca /Master/texmf-dist/tex/context
parent5e8d8cae840358328c7e78b0dbde730a00729679 (diff)
memoize (18mar24)
git-svn-id: svn://tug.org/texlive/trunk@70690 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context')
-rw-r--r--Master/texmf-dist/tex/context/third/memoize/t-memoizable.tex4
-rw-r--r--Master/texmf-dist/tex/context/third/memoize/t-memoize.tex97
-rw-r--r--Master/texmf-dist/tex/context/third/memoize/t-nomemoize.tex4
3 files changed, 65 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/context/third/memoize/t-memoizable.tex b/Master/texmf-dist/tex/context/third/memoize/t-memoizable.tex
index d0dcf206a0f..b2ed2532fcb 100644
--- a/Master/texmf-dist/tex/context/third/memoize/t-memoizable.tex
+++ b/Master/texmf-dist/tex/context/third/memoize/t-memoizable.tex
@@ -26,11 +26,11 @@
%% (<texmf>/doc/generic/memoize/)FILES.
%D \module[
%D file=t-memoizable.tex,
-%D version=1.1.2,
+%D version=1.2.0,
%D title=Memoizable,
%D subtitle=A programmer's stub for Memoize,
%D author=Saso Zivanovic,
-%D date=2024-01-21,
+%D date=2024-03-15,
%D copyright=Saso Zivanovic,
%D license=LPPL,
%D ]
diff --git a/Master/texmf-dist/tex/context/third/memoize/t-memoize.tex b/Master/texmf-dist/tex/context/third/memoize/t-memoize.tex
index b5059aaf6ef..c8ab3876049 100644
--- a/Master/texmf-dist/tex/context/third/memoize/t-memoize.tex
+++ b/Master/texmf-dist/tex/context/third/memoize/t-memoize.tex
@@ -26,11 +26,11 @@
%% (<texmf>/doc/generic/memoize/)FILES.
%D \module[
%D file=t-memoize.tex,
-%D version=1.1.2,
+%D version=1.2.0,
%D title=Memoize,
%D subtitle=Fast and flexible externalization,
%D author=Saso Zivanovic,
-%D date=2024-01-21,
+%D date=2024-03-15,
%D copyright=Saso Zivanovic,
%D license=LPPL,
%D ]
@@ -119,7 +119,7 @@
\ifmmz@loadstatus{1}{\endinput}{}%
\def\mmz@loadstatus{1}%
\def\filetotoks#1#2{%
- \immediate\mmz@openin0{#2}%
+ \immediate\openin0{#2}%
#1={}%
\loop
\unless\ifeof0
@@ -128,8 +128,6 @@
\repeat
\immediate\closein0
}
-\let\mmz@openin\openin
-\let\mmz@openout\openout
\newif\ifmmz@temp
\newtoks\mmz@temptoks
\newbox\mmz@box
@@ -217,9 +215,9 @@
}
\def\mmz@remove@quotes@i{%
\CollectArgumentsRaw
- {\collargsBraceCollectedfalse
+ {\collargsReturnPlain
\collargsNoDelimiterstrue
- \collargsAppendPostwrap{{##1}}%
+ \collargsAppendExpandablePostprocessor{{\the\collargsArg}}%
}%
{u"u\mmz@eov}%
\mmz@remove@quotes@ii
@@ -315,7 +313,7 @@
\expandonce\mmzRawCollectorOptions
\ifmmz@verbatim\mmz@verbatim@fix\fi
}%
- }{&&{\collargsAppendPostwrap{}}!t{ }+b{memoize}}{\mmz@do}%
+ }{&&{\collargsAppendExpandablePostprocessor{}}!t{ }+b{memoize}}{\mmz@do}%
}%
\protected\def\nommz#1#{%
\afterassignment\nommz@i
@@ -702,7 +700,7 @@
\newif\ifmmz@include@source
\mmz@include@sourcetrue
\def\mmz@write@cmemo{%
- \immediate\mmz@openout\mmz@out{\mmz@cmemo@path}%
+ \immediate\openout\mmz@out{\mmz@cmemo@path}%
\immediate\write\mmz@out{\noexpand\mmzMemo}%
\immediate\write\mmz@out{%
\global\mmzContextExtra{\the\mmzContextExtra}\collargs@percentchar
@@ -757,7 +755,7 @@
direct ccmemo input/.is if=mmz@direct@ccmemo@input,
}
\def\mmz@write@ccmemo{%
- \immediate\mmz@openout\mmz@out{\mmz@ccmemo@path}%
+ \immediate\openout\mmz@out{\mmz@ccmemo@path}%
\begingroup
\the\mmz@ccmemo@resources
\endgroup
@@ -1078,7 +1076,7 @@
}
\def\mmz@clear@extraction@log{%
\begingroup
- \immediate\mmz@openout0{\jobname.mmz.log}%
+ \immediate\openout0{\jobname.mmz.log}%
\immediate\closeout0
\endgroup
}
@@ -1135,7 +1133,7 @@
\mmzset{
record/mmz/begin/.code={%
\newwrite\mmz@mmzout
- \immediate\mmz@openout\mmz@mmzout{\jobname.mmz}%
+ \immediate\openout\mmz@mmzout{\jobname.mmz}%
},
record/mmz/prefix/.code={%
\immediate\write\mmz@mmzout{\noexpand\mmzPrefix{#1}}%
@@ -1170,7 +1168,7 @@
bat=memoize-extract.\jobname.bat,
record/sh/begin/.code={%
\newwrite\mmz@shout
- \immediate\mmz@openout\mmz@shout{\mmz@shname}%
+ \immediate\openout\mmz@shout{\mmz@shname}%
},
record/sh/new extern/.code={%
\begingroup
@@ -1182,7 +1180,7 @@
},
record/bat/begin/.code={%
\newwrite\mmz@batout
- \immediate\mmz@openout\mmz@batout{\mmz@batname}%
+ \immediate\openout\mmz@batout{\mmz@batname}%
},
record/bat/new extern/.code={%
\begingroup
@@ -1203,7 +1201,7 @@
record/makefile/begin/.code={%
\newwrite\mmz@makefileout
\newtoks\mmz@makefile@externs
- \immediate\mmz@openout\mmz@makefileout{\mmz@makefilename}%
+ \immediate\openout\mmz@makefileout{\mmz@makefilename}%
\immediate\write\mmz@makefileout{.DEFAULT_GOAL = externs}%
\immediate\write\mmz@makefileout{.PHONY: externs}%
},
@@ -1408,33 +1406,60 @@
\pgfeov
\AdviceOriginal
}
-\mmzset{
- begindocument/before/.append code={%
- \ifdefined\tikz
- \input advice-tikz.code.tex
- \fi
- \mmzset{%
- auto/memoize tikz/.style={
- memoize,
- at begin memoization=\edef\mmz@pgfpictureid{%
- \the\pgf@picture@serial@count
- },
- at end memoization=\xtoksapp\mmzCCMemo{%
- \normalunexpanded{%
- \global\expandafter\advance\csname pgf@picture@serial@count\endcsname
- }%
- \the\numexpr\pgf@picture@serial@count-\mmz@pgfpictureid\relax\relax
- },
- },
- auto=\tikz{memoize tikz, collector=\AdviceCollectTikZArguments},
- auto={tikzpicture}{memoize tikz},
+\def\mmz@if@package@loaded#1#2#3{%
+ \mmzset{%
+ begindocument/before/.append code={%
+ \ifdefined#2%
+ #3%
+ \fi
}%
- },
+ }%
+}
+\mmz@if@package@loaded{pgf}{%
+ \startpgfpicture
+}{%
+ \def\mmzPgfAtBeginMemoization{%
+ \edef\mmz@pgfpictureid{%
+ \the\pgf@picture@serial@count
+ }%
+ }%
+ \def\mmzPgfAtEndMemoization{%
+ \edef\mmz@temp{%
+ \the\numexpr\pgf@picture@serial@count-\mmz@pgfpictureid\relax
+ }%
+ \ifx\mmz@temp=0
+ \else
+ \xtoksapp\mmzCCMemo{%
+ \normalunexpanded{%
+ \global\expandafter\advance\csname pgf@picture@serial@count\endcsname
+ }%
+ \mmz@temp
+ }%
+ \fi
+ }%
+ \mmzset{%
+ at begin memoization=\mmzPgfAtBeginMemoization,
+ at end memoization=\mmzPgfAtEndMemoization,
+ }%
+}
+\mmz@if@package@loaded{tikz}{\tikz}{%
+ \input advice-tikz.code.tex
+ \mmzset{%
+ auto={tikzpicture}{memoize},
+ auto=\tikz{memoize, collector=\AdviceCollectTikZArguments},
+ }%
}
\mmzset{
begin document/.style={begindocument/before, begindocument, begindocument/end},
end document/.style={enddocument/afterlastpage},
}
+\mmzset{
+ begindocument/end/.append style={
+ begindocument/before/.code={},
+ begindocument/.code={},
+ begindocument/end/.code={},
+ }
+}
\mmzset{extract/no/.code={}}
\InputIfFileExists{memoize.cfg}{}{}
\let\mmz@initial@extraction@method\mmz@extraction@method
diff --git a/Master/texmf-dist/tex/context/third/memoize/t-nomemoize.tex b/Master/texmf-dist/tex/context/third/memoize/t-nomemoize.tex
index 365677ff34e..4f956208551 100644
--- a/Master/texmf-dist/tex/context/third/memoize/t-nomemoize.tex
+++ b/Master/texmf-dist/tex/context/third/memoize/t-nomemoize.tex
@@ -26,11 +26,11 @@
%% (<texmf>/doc/generic/memoize/)FILES.
%D \module[
%D file=t-nomemoize.tex,
-%D version=1.1.2,
+%D version=1.2.0,
%D title=Memoize,
%D subtitle=A no-op stub for Memoize,
%D author=Saso Zivanovic,
-%D date=2024-01-21,
+%D date=2024-03-15,
%D copyright=Saso Zivanovic,
%D license=LPPL,
%D ]