summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex')
-rw-r--r--graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex45
1 files changed, 19 insertions, 26 deletions
diff --git a/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex b/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex
index 56b671fb85..c8b96250dd 100644
--- a/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex
+++ b/graphics/pgf/contrib/yquant/tex/yquant-langhelper.tex
@@ -52,40 +52,33 @@
% we need to capture every non-attribute (which means filtering them out).
\expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/attrs/}{%
% the key is in /yquant/attrs. Does it actually exist (but not as a handler, which would define non-existing keys)?
- \if\pgfkeyscasenumber1%
- \pgfkeysfiltercontinuetrue%
- \else%
- \if\pgfkeyscasenumber2%
+ \ifnum\pgfkeyscasenumber=3 % handler
+ % handlers are tricky. The existence does not rely on the question whether the key itself exists, but the handler. This is not what we want for attributes. We strip the handler (the handler is in \pgfkeyscurrentname, while the original key is fully contained in \pgfkeyscurrentpath) and check whether it existed (think of handlers such as .expanded, which for sure should be valid, while we don't want to define new arguments).
+ \pgfkeysifassignable{\pgfkeyscurrentkey}{%
+ % case 1 and 2
\pgfkeysfiltercontinuetrue%
- \else%
- % 0 or 3 for our case means non-existing - now we need to check whether we can find it in the global attributes.
- \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}{%
+ }{%
+ % don't have to worry about option 3, so this is 0. But maybe this was actually a global attribute? Again, we have to discard our handler. Note that this change to the current-macros will affect further processing!
+ \edef\pgfkeyscurrentkey{/yquant/global attrs/\pgfkeyscurrentkeyRAW}%
+ \pgfkeyssplitpath%
+ \pgfkeysifassignable{\pgfkeyscurrentpath}{%
\pgfkeysfiltercontinuetrue%
}{%
- % it is not, so it is not a known attribute for this operator. Filter.
\pgfkeysfiltercontinuefalse%
}%
- \fi%
- \fi%
- }{%
- % the key is not in /yquant/attrs. Is it a global attribute (usually, the user should not access this explicitly, but let's be tolerant here)?
- \expandafter\ifyquant@beginswith\expandafter{\pgfkeyscurrentkey}{/yquant/global attrs/}{%
- % the key is in /yquant/global attrs. Does it actually exist?
- \if\pgfkeyscasenumber1%
- \pgfkeysfiltercontinuetrue%
- \else%
- \if\pgfkeyscasenumber2%
+ }%
+ \else%
+ \ifnum\pgfkeyscasenumber=0 % unknown
+ % non-existing - now we need to check whether we can find it in the global attributes.
+ \pgfkeysifassignable{/yquant/global attrs/\pgfkeyscurrentkeyRAW}%
\pgfkeysfiltercontinuetrue%
- \else%
- % no - that's it.
+ % it is not, so it is not a known attribute for this operator. Filter.
\pgfkeysfiltercontinuefalse%
- \fi%
+ \else% command key or contains value
+ \pgfkeysfiltercontinuetrue%
\fi%
- }{%
- % the key is no known attribute
- \pgfkeysfiltercontinuefalse%
- }%
- }%
+ \fi%
+ }\relax%
},%
/yquant/attr filter/.style={%
/pgf/key filters/attr filter/.install key filter,%