summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/tikz.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/tex/tikz.code.tex')
-rw-r--r--graphics/pgf/base/tex/tikz.code.tex157
1 files changed, 37 insertions, 120 deletions
diff --git a/graphics/pgf/base/tex/tikz.code.tex b/graphics/pgf/base/tex/tikz.code.tex
index f848487e70..d5244e9e85 100644
--- a/graphics/pgf/base/tex/tikz.code.tex
+++ b/graphics/pgf/base/tex/tikz.code.tex
@@ -2105,7 +2105,7 @@
\tikz@snakedfalse%
\tikz@decoratepathfalse%
\tikz@node@is@a@labelfalse%
- \tikz@expandcount=100\relax%
+ \tikz@resetexpandcount
\pgf@path@lastx=0pt%
\pgf@path@lasty=0pt%
\tikz@lastx=0pt%
@@ -2123,125 +2123,42 @@
\afterassignment\tikz@handle\let\pgf@let@token=%
}%
\newcount\tikz@expandcount
+\def\tikz@resetexpandcount{\tikz@expandcount=100\relax}
\let\tikz@collected@onpath=\pgfutil@empty%
+\edef\tikz@frozen@relax@token{\ifnum0=0\fi}
+
% Central dispatcher for commands
\def\tikz@handle{%
- \let\pgfutil@next=\tikz@expand%
- \ifx\pgf@let@token(%)
- \let\pgfutil@next=\tikz@movetoabs%
- \else%
- \ifx\pgf@let@token+%
- \let\pgfutil@next=\tikz@movetorel%
- \else%
- \ifx\pgf@let@token-%
- \let\pgfutil@next=\tikz@lineto%
- \else%
- \ifx\pgf@let@token.%
- \let\pgfutil@next=\tikz@dot%
- \else%
- \ifx\pgf@let@token r%
- \let\pgfutil@next=\tikz@rect%
- \else%
- \ifx\pgf@let@token n%
- \let\pgfutil@next=\tikz@fig%
- \else%
- \ifx\pgf@let@token[%]
- \let\pgfutil@next=\tikz@parse@options%
- \else%
- \ifx\pgf@let@token c%
- \let\pgfutil@next=\tikz@cchar%
- \else%
- \ifx\pgf@let@token\bgroup%
- \let\pgfutil@next=\tikz@beginscope%
- \else%
- \ifx\pgf@let@token\egroup%
- \let\pgfutil@next=\tikz@endscope%
- \else%
- \ifx\pgf@let@token;%
- \let\pgfutil@next=\tikz@finish%
- \else%
- \let\pgfutil@next=\tikz@handle@more%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfutil@next%
-}%
-
-% Continued...
-\def\tikz@handle@more{%
- \ifx\pgf@let@token a%
- \let\pgfutil@next=\tikz@a@char%
- \else%
- \ifx\pgf@let@token e%
- \let\pgfutil@next=\tikz@e@char%
- \else%
- \ifx\pgf@let@token g%
- \let\pgfutil@next=\tikz@g@char%
- \else%
- \ifx\pgf@let@token s%
- \let\pgfutil@next=\tikz@schar%
- \else%
- \ifx\pgf@let@token |%
- \let\pgfutil@next=\tikz@vh@lineto%
- \else%
- \ifx\pgf@let@token p%
- \let\pgfutil@next=\tikz@pchar%
- \pgfsetmovetofirstplotpoint%
- \else%
- \ifx\pgf@let@token t%
- \let\pgfutil@next=\tikz@to%
- \else%
- \ifx\pgf@let@token\pgfextra%
- \let\pgfutil@next=\tikz@extra%
- \else%
- \ifx\pgf@let@token\foreach%
- \let\pgfutil@next=\tikz@foreach%
- \else%
- \ifx\pgf@let@token f%
- \let\pgfutil@next=\tikz@fchar%
- \else%
- \ifx\pgf@let@token\pgf@stop%
- \let\pgfutil@next=\relax%
- \else%
- \ifx\pgf@let@token\par%
- \let\pgfutil@next=\tikz@scan@next@command%
- \else%
- \ifx\pgf@let@token d%
- \let\pgfutil@next=\tikz@decoration%
- \else%
- \ifx\pgf@let@token l%
- \let\pgfutil@next=\tikz@l@char%
- \else%
- \ifx\pgf@let@token:%
- \let\pgfutil@next=\tikz@colon@char%
- \else%
- \let\pgfutil@next=\tikz@expand%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \ifx\pgfutil@next\tikz@expand\else\tikz@expandcount=100\relax\fi%
- \pgfutil@next%
+ \pgfutil@switch\pgfutil@ifx\pgf@let@token{%
+ {(}{\let\pgfutil@next\tikz@movetoabs}%)
+ {+}{\let\pgfutil@next\tikz@movetorel}%
+ {-}{\let\pgfutil@next\tikz@lineto}%
+ {.}{\let\pgfutil@next\tikz@dot}%
+ {r}{\let\pgfutil@next\tikz@rect}%
+ {n}{\let\pgfutil@next\tikz@fig}%
+ {[}{\let\pgfutil@next\tikz@parse@options}%]
+ {c}{\let\pgfutil@next\tikz@cchar}%
+ {\bgroup}{\let\pgfutil@next\tikz@beginscope}%
+ {\egroup}{\let\pgfutil@next\tikz@endscope}%
+ {;}{\let\pgfutil@next\tikz@finish}%
+ {a}{\let\pgfutil@next\tikz@a@char}%
+ {e}{\let\pgfutil@next\tikz@e@char}%
+ {g}{\let\pgfutil@next\tikz@g@char}%
+ {s}{\let\pgfutil@next\tikz@schar}%
+ {|}{\let\pgfutil@next\tikz@vh@lineto}%
+ {p}{\pgfsetmovetofirstplotpoint\let\pgfutil@next\tikz@pchar}%
+ {t}{\let\pgfutil@next\tikz@to}%
+ {\pgfextra}{\let\pgfutil@next\tikz@extra}%
+ {\foreach}{\let\pgfutil@next\tikz@foreach}%
+ {f}{\let\pgfutil@next\tikz@fchar}%
+ {\pgf@stop}{\let\pgfutil@next\relax}%
+ {\par}{\let\pgfutil@next\tikz@scan@next@command}%
+ {d}{\let\pgfutil@next\tikz@decoration}%
+ {l}{\let\pgfutil@next\tikz@l@char}%
+ {:}{\let\pgfutil@next\tikz@colon@char}%
+ {\relax}{\relax\let\pgfutil@next\tikz@scan@next@command}%
+ }{\tikz@resetexpandcount\pgfutil@next}{\tikz@expand}%
}%
\def\tikz@l@char{%
@@ -4093,7 +4010,7 @@
\pgfutil@for\pgf@temp:=\tikz@common@matrix@code@styleorder\do{%
\toks0=\expandafter{\romannumeral-`0\expandafter\pgfutil@trimspaces\expandafter{\pgf@temp}}%
\def\pgf@marshal{}%
- \pgfutil@ifempty\pgf@temp{}{%
+ \pgfutil@ifxempty\pgf@temp{}{%
\edef\pgf@marshal{\noexpand\tikzset{matrix/inner style/.cd,\the\toks0}}%
}%
\pgf@marshal
@@ -4754,8 +4671,8 @@
\expandafter\expandafter\expandafter\tikz@parse@child@node%
\fi%
}%
-\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@expandcount=100\relax\def\tikz@child@node@rest{#1}}%
-\def\tikz@parse@child@node@c c{\tikz@expandcount=100\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}%
+\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@resetexpandcount\def\tikz@child@node@rest{#1}}%
+\def\tikz@parse@child@node@c c{\tikz@resetexpandcount\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}%
\def\tikz@parse@child@node@co o{\pgfutil@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}}%
\def\tikz@parse@child@node@coordinate ordinate{%
\pgfutil@ifnextchar ({\tikz@@parse@child@node@coordinate}{%
@@ -4777,7 +4694,7 @@
\expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text@pre\tikz@marshal}%
\tikz@parse@child@node@rest%
}%
-\def\tikz@parse@child@node@n node{\tikz@expandcount=100%
+\def\tikz@parse@child@node@n node{\tikz@resetexpandcount%
\let\tikz@child@node@text=\pgfutil@empty%
\tikz@p@c@s}%
\def\tikz@p@c@s{%