From 90ae413a94da014dbf7a6a8ab584f7c668483a5a Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 27 Feb 2014 00:01:50 +0000
Subject: pgf 3.0.0

git-svn-id: svn://tug.org/texlive/trunk@33057 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tikz/libraries/tikzlibrarycalc.code.tex        | 101 +++++++++++++++++----
 1 file changed, 83 insertions(+), 18 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex')

diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
index 1a0ea356c24..703494d2a64 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
@@ -7,7 +7,7 @@
 %
 % See the file doc/generic/pgf/licenses/LICENSE for more details.
 
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex,v 1.6 2009/09/04 17:22:59 tantau Exp $
+\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex,v 1.9 2013/07/15 12:05:31 tantau Exp $
 
 %
 %
@@ -48,7 +48,7 @@
     \pgfutil@ifnextchar\n{%
       \tikz@cc@handle@num%
     }{%
-      \PackageError{tikz}{``\string\p'' or ``\string\n'' expected}{}%
+      \tikzerror{``\string\p'' or ``\string\n'' expected}%
     }%
   }%
 }
@@ -112,7 +112,7 @@
       \pgfutil@ifnextchar-{%
         \tikz@cc@sub%
       }{%
-        \PackageError{tikz}{+ or - expected}{}%
+        \tikzerror{+ or - expected}%
         \tikz@cc@end$%$
       }%
     }%
@@ -177,24 +177,52 @@
 % A coordinate can be followed by !...!(...)
 %
 
-\def\tikz@cc@mid@checks{
+\def\tikz@cc@mid@checks{%
+  \ifnum\the\catcode`\!=\active\relax
+    \expandafter\tikz@cc@mid@checks@active
+  \else
+    \expandafter\tikz@cc@mid@checks@nonactive
+  \fi}
+
+\def\tikz@cc@mid@checks@nonactive{%
   \pgfutil@ifnextchar!{%
-    \tikz@cc@mid%
+    \tikz@cc@mid@nonactive%
   }{%
-    \advance\pgf@xa by\tikz@cc@factor\pgf@xb%
-    \advance\pgf@ya by\tikz@cc@factor\pgf@yb%
-    \tikz@cc@parse% continue
+    \advance\pgf@xa by\tikz@cc@factor\pgf@xb
+    \advance\pgf@ya by\tikz@cc@factor\pgf@yb
+    \tikz@cc@parse%
   }%
 }
 
-\def\tikz@cc@mid!{%
+\def\tikz@cc@mid@nonactive!{%
   \pgfutil@ifnextchar({%
     \tikz@scan@one@point\tikz@cc@project%
   }{%
-    \tikz@cc@mid@num%
+    \tikz@cc@mid@num@nonactive%
   }%
 }
 
+\begingroup
+  \catcode`\!=\active
+  \gdef\tikz@cc@mid@checks@active{%
+    \pgfutil@ifnextchar!{%
+      \tikz@cc@mid@active%
+    }{%
+      \advance\pgf@xa by\tikz@cc@factor\pgf@xb
+      \advance\pgf@ya by\tikz@cc@factor\pgf@yb
+      \tikz@cc@parse%
+    }%
+  }
+
+  \gdef\tikz@cc@mid@active!{%
+    \pgfutil@ifnextchar({%
+      \tikz@scan@one@point\tikz@cc@project%
+    }{%
+      \tikz@cc@mid@num@active%
+    }%
+  }
+\endgroup
+
 %
 % Partway case: (coord a)!number!(coord b)
 %
@@ -202,7 +230,15 @@
 % to b. This, (a)!0!(b) is (a), (a)!.5!(b) is the middle and (a)!1!(b)
 % is (b)
 %
-\def\tikz@cc@mid@num#1!{%
+
+\def\tikz@cc@mid@num@nonactive#1!{\tikz@cc@mid@num{#1}}
+
+\begingroup
+  \catcode`\!=\active
+  \gdef\tikz@cc@mid@num@active#1!{\tikz@cc@mid@num{#1}}
+\endgroup
+
+\def\tikz@cc@mid@num#1{%
   \pgfmathparse{#1}%
   \ifpgfmathunitsdeclared%
     \let\tikz@cc@mid@unit=\pgfmathresult%
@@ -253,10 +289,27 @@
   % Save in c
   \pgf@xc=\pgf@x%
   \pgf@yc=\pgf@y%
-  \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@project\tikz@cc@scan@ex%
+  \begingroup
+    \ifnum\the\catcode`\!=\active
+      \def\tikz@next{%
+        \endgroup
+        \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@project
+        \tikz@cc@scan@ex@active}%
+    \else
+      \def\tikz@next{%
+        \endgroup
+        \expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@project
+        \tikz@cc@scan@ex@nonactive}%
+    \fi
+    \tikz@next%
 }
 
-\def\tikz@cc@scan@ex!{}
+\def\tikz@cc@scan@ex@nonactive!{}
+
+\begingroup
+  \catcode`\!=\active
+  \gdef\tikz@cc@scan@ex@active!{}
+\endgroup
 
 \def\tikz@cc@after@project#1{%
   \pgf@process{#1}%
@@ -284,16 +337,28 @@
     \tikz@scan@one@point#1% normal
   }%
   {
-    \def\tikz@cc@scan@rot@cmd{#1}
-    \tikz@cc@scan@one@rot%
+    \def\tikz@cc@scan@rot@cmd{#1}%
+    \ifnum\the\catcode`\:=\active\relax
+      \expandafter\tikz@cc@scan@one@rot@active%
+    \else
+      \expandafter\tikz@cc@scan@one@rot@nonactive%
+    \fi
   }%
 }
 
-\def\tikz@cc@scan@one@rot#1:{%
+\def\tikz@cc@scan@one@rot@nonactive#1:{%
   \def\tikz@cc@scan@rot@angle{#1}%
   \tikz@scan@one@point\tikz@cc@handle@rot%
 }
 
+\begingroup
+  \catcode`\:=\active
+  \gdef\tikz@cc@scan@one@rot@active#1:{%
+    \def\tikz@cc@scan@rot@angle{#1}%
+    \tikz@scan@one@point\tikz@cc@handle@rot%
+  }
+\endgroup
+
 \def\tikz@cc@handle@rot#1{%
   \pgf@process{#1}%
   % Ok, now we need to rotate x/y around xb/xb by ...rot@angle
@@ -328,8 +393,8 @@
 {%
   \tikzset{cs/.cd,#1}%
   \expandafter\ifx\csname tikz@tangent@\tikz@cs@type\endcsname\relax%
-    \PackageError{tikz}{I do not know how to compute the tangent to 
-    a \tikz@cs@type}{}%
+    \tikzerror{I do not know how to compute the tangent to 
+    a \tikz@cs@type}%
     \pgfpointorigin%
   \else%
     \expandafter\tikz@scan@one@point\expandafter\tikz@lib@do@tangent\tikz@cs@point%  
-- 
cgit v1.2.3

