diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex index 5e6a7bbc10e..fe86ba6f4a7 100644 --- a/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex +++ b/Master/texmf-dist/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsupp_pgflibraryluamath.code.tex @@ -9,17 +9,17 @@ %%% PGF parts. The copyrights are as they appear in PGF. %%% %%% Note that pgfplots has compatible licenses. -%%% +%%% %%% This copy has been modified in the following ways: %%% - nested \input commands have been updated -%%% +%%% % -% Support for the contents of this file will NOT be done by the PGF/TikZ team. +% Support for the contents of this file will NOT be done by the PGF/TikZ team. % Please contact the author and/or maintainer of pgfplots (Christian Feuersaenger) if you need assistance in conjunction % with the deployment of this patch or partial content of PGF. Note that the author and/or maintainer of pgfplots has no obligation to fix anything: % This file comes without any warranty as the rest of pgfplots; there is no obligation for help. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Date of this copy: Mi 6. Jan 09:15:30 CET 2016 %%% +%%% Date of this copy: Mi 8. Feb 20:49:06 CET 2017 %%% @@ -132,10 +132,31 @@ \let\pgfmathnotifynewdeclarefunction@orig=\pgfmathnotifynewdeclarefunction \def\pgfmathnotifynewdeclarefunction#1#2#3{% \pgfmathnotifynewdeclarefunction@orig{#1}{#2}{#3}% - \directlua{pgfluamathparser.pushLocalExpressionFunction(% - "\pgfutil@luaescapestring{#1}",% - #2,% - "\pgfutil@luaescapestring{#3}")}% + % + % we have to check if '#3' contains control sequences. + % this is highly tricky as it may contain '#1'... + \begingroup + \toks0={#3}% + \xdef\pgf@marshal@glob{\the\toks0 }% + \endgroup + \pgfutil@command@to@string\pgf@marshal@glob\pgf@marshal + \expandafter\pgfutilifcontainsmacro\expandafter{\pgf@marshal}{% + \def\pgf@temp{1}% + }{% + \def\pgf@temp{0}% + }% + \if1\pgf@temp + % let lua produce an error when evaluating this function -- we cannot possibly expand the macro to its current state: + \directlua{pgfluamathparser.pushLocalExpressionFunction(% + "\pgfutil@luaescapestring{#1}",% + #2,% + "functionMustBeEvaluatedInTeX")}% + \else + \directlua{pgfluamathparser.pushLocalExpressionFunction(% + "\pgfutil@luaescapestring{#1}",% + #2,% + "\pgfutil@luaescapestring{#3}")}% + \fi % % ensure that the local function is removed at the end of the % scope. To this end, we maintain a stack on the LUA side. @@ -172,7 +193,7 @@ % LUA (defined only in TeX) % - some special cases which simply haven't been added to the LUA % parser (yet). -% At the time of this writing, this includes +% At the time of this writing, this includes % -- arrays created via '{}' and indexed with '[]' % -- strings with "<str>" % -- 'scalar' function @@ -209,7 +230,7 @@ \ifpgfluamathparseractive \let\pgfmathparse\pgfluamath@pgfmathparse \pgfluamathparseractivefalse - \fi} + \fi} \pgfqkeys{/pgf}{% % Enable lua-side computation of \pgfmathresult @@ -503,7 +524,7 @@ % LUA (defined only in TeX) % - some special cases which simply haven't been added to the LUA % parser (yet). -% At the time of this writing, this includes +% At the time of this writing, this includes % -- arrays created via '{}' and indexed with '[]' % -- strings with "<str>" % -- 'scalar' function @@ -522,8 +543,8 @@ \def\pgfluamathparse#1{% \pgfluamathusedTeXfallbackfalse \pgfutil@directlua{pgfluamathparser.texCallParser( - "\pgfutil@luaescapestring{#1}", - \pgfluamath@outputformat@choice, + "\pgfutil@luaescapestring{#1}", + \pgfluamath@outputformat@choice, \ifpgfluamathshowerrormessage true\else false\fi)% }% \ifx\pgfmathresult\pgfutil@empty |