summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex51
1 files changed, 34 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
index 3ef113dc154..f01db1e2cee 100644
--- a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
@@ -425,14 +425,14 @@
}%
\def\pgfmanual@pretty@collectpoint{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectpoint
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanual@pretty@collectargs@finish@collectpoint
\expandafter\pgfmanualprettyprintercollectupto\pgfmanual@pretty@rroundbrace
{\afterpgfmanual@pretty@collectpoint}%
}
{
\catcode`\:=12
-\gdef\pgfmanual@pretty@collectargs@finish@collectpoint#1{%
+\gdef\pgfmanual@pretty@collectargs@finish@collectpoint#1#2{%
\expandafter\pgfutil@in@\pgfmanual@pretty@colon{#1}%
\ifpgfutil@in@
\def\pgfmanual@pretty@collectpoint@getcoordsystem##1:##2\relax{%
@@ -449,14 +449,14 @@
\expandafter\def\expandafter\pgfmanual@loc@TMPa\expandafter{\expandafter{\pgfmanual@pretty@glob@TMPa}{##2}}%
\expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa\pgfeov
}%
- \ifpgfmanualprettyprinterfoundterminator
+ \if1#2%
\pgfmanual@pretty@collectpoint@getcoordsystem#1)\relax
\else
\pgfmanual@pretty@collectpoint@getcoordsystem#1\relax
\fi
\else
\def\pgfmanual@loc@TMPb{\pgfkeysvalueof{/codeexample/prettyprint/point/.@cmd}}%
- \ifpgfmanualprettyprinterfoundterminator
+ \if1#2%
\pgfmanual@loc@TMPb(#1)\pgfeov
\else
\pgfmanual@loc@TMPb(#1\pgfeov
@@ -477,7 +477,7 @@
% a csname may only use letters. And: only letters have a
% positive lcccode!
\ifnum\lccode`#1=0
- \ifx\pgfmanual@loc@TMPb @%
+ \ifx\pgfmanual@loc@TMPb\pgfmanual@attext%
% ok, we may also accept an `@':
\edef\pgfmanual@loc@TMPa{\pgfmanual@loc@TMPa #1}%
\else
@@ -492,6 +492,7 @@
\pgfmanual@pretty@collectcs@loop@NEXT
}%
\def\afterpgfmanual@pretty@cs{\pgfmanual@pretty@mainloop}%
+\def\pgfmanual@attext{@}
\def\pgfmanual@pretty@collectcs@loop@END{%
\pgfkeysifdefined{/codeexample/prettyprint/cs arguments/\pgfmanual@loc@TMPa}{%
@@ -703,12 +704,25 @@
\newif\ifpgfmanualprettyprinterfoundterminator
+\def\pgfmanualprettyprinterhandlecollectedargsVtwo@default#1#2{%
+ \if1#2%
+ \pgfmanualprettyprinterfoundterminatortrue
+ \else
+ \pgfmanualprettyprinterfoundterminatorfalse
+ \fi
+ \pgfmanualprettyprinterhandlecollectedargs{#1}%
+}%
+\def\pgfmanualprettyprintercollectupto@restore@callback{%
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanualprettyprinterhandlecollectedargsVtwo@default
+}%
+\pgfmanualprettyprintercollectupto@restore@callback
+
% Collects tokens inside of a token list up to a single delimiting token, dealing with nested
% catcode-12-braces.
%
% #1: is the end token, the delimiter. It won't be collected.
% #2: is code to invoke after
-% \pgfmanualprettyprinterhandlecollectedargs has been invoked.
+% \pgfmanualprettyprinterhandlecollectedargsVtwo has been invoked.
%
% PRECONDITION:
% there is a large token list following
@@ -717,17 +731,17 @@
% POSTCONDITION:
% - the arguments will be collected as
% '<result> := <token list>'
-% and then, \pgfmanualprettyprinterhandlecollectedargs{<result>} will be
-% invoked. Just define \pgfmanualprettyprinterhandlecollectedargs
+% and then,
+% \pgfmanualprettyprinterhandlecollectedargsVtwo{<result>}{<found terminator>? 1 : 0} will be
+% invoked. Just define
+% \pgfmanualprettyprinterhandlecollectedargsVtwo
% properly.
% Then, #2 will be invoked.
-% - The boolean \ifpgfmanualprettyprinterfoundterminator will be set to true if and only if '#1' has been found.
%
% @see \pgfmanualprettyprintercollectargcount for more details.
%
\def\pgfmanualprettyprintercollectupto#1#2{%
\pgfmanualprettyprinterarghasunmatchedbracesfalse
- \pgfmanualprettyprinterfoundterminatortrue
\begingroup
\def\pgfmanual@loc@delimittoken{#1}%
\toksdef\t@afterpgfmanualprettyprinterhandlecollected=10
@@ -756,8 +770,8 @@
\ifnum\c@pgfmanual@pretty@openbracecount>0
\noexpand\pgfmanualprettyprinterarghasunmatchedbracestrue
\fi
- \noexpand\pgfmanualprettyprinterfoundterminatorfalse
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
+ \noexpand\pgfmanualprettyprinterhandlecollectedargsVtwo{\the\t@pgfmanual@currentarg}{0}%
+ \noexpand\pgfmanualprettyprintercollectupto@restore@callback
\the\t@afterpgfmanualprettyprinterhandlecollected
\noexpand\pgfmanual@EOI% <- put this token back into token list!
}%
@@ -785,7 +799,8 @@
% do NOT include the delimit token.
\edef\pgfmanual@pretty@collectupto@loop@NEXT{%
\noexpand\endgroup
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
+ \noexpand\pgfmanualprettyprinterhandlecollectedargsVtwo{\the\t@pgfmanual@currentarg}{1}%
+ \noexpand\pgfmanualprettyprintercollectupto@restore@callback
\the\t@afterpgfmanualprettyprinterhandlecollected
}%
\else
@@ -854,13 +869,15 @@
}
\def\pgfmanual@pretty@pgfkeys{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@pgfkeys@start
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanual@pretty@pgfkeys@start
\pgfmanualprettyprintercollectupto]{\pgfmanual@pretty@mainloop}%%
}%
-\long\def\pgfmanual@pretty@pgfkeys@start#1{%
+\long\def\pgfmanual@pretty@pgfkeys@start#1#2{%
[%
\pgfmanual@pretty@pgfkeys@loop#1\pgfmanual@EOI
- ]%
+ \if1#2%
+ ]%
+ \fi
}%
% iterates through single tokens, detecting key names and values while
% it goes.
@@ -1034,7 +1051,7 @@
\fi
\fi
\if\pgfmanual@pretty@isconsumed0%
- \def\pgfmanualprettyprinterhandlecollectedargs##1{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately.
+ \def\pgfmanualprettyprinterhandlecollectedargsVtwo##1##2{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately.
\def\pgfmanual@pretty@pgfkeys@collectvalue@next{%
\pgfmanualprettyprintercollectupto,{\afterpgfmanual@pretty@collectargs@finish@value}#1%
}%