diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex index f9afe04d72d..0ede2314cfe 100644 --- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex @@ -24,7 +24,7 @@ \fi \pgfmath@parse@next} -\def\pgfmath@catcodes{% Maybe unnecessary. +\def\pgfmath@catcodes{% Maybe unecessary. \catcode`\==12 % \catcode`\,=12 % \catcode`\|=12 % @@ -36,23 +36,23 @@ \pgfmath@catcodes \pgfmath@quickparsetrue \pgfmathparse@} - + \def\pgfmathparse@#1{% - % No (math) units yet. + % No (math) units yet. \global\pgfmathunitsdeclaredfalse \global\pgfmathmathunitsdeclaredfalse - % Expand expression so any remaining CSs are registers + % Expand expression so any reamining CSs are registers % or box dimensions (i.e. |\wd|, |\ht|, |\dp|). \edef\pgfmath@expression{#1}% - % - \expandafter\pgfmathparse@trynumber@loop\pgfmath@expression\pgfmath@parse@stop - % - % this here is the _real_ parser. it is invoked by - % \pgfmathparse@trynumber@loop if that says "this is no number" - %\pgfmathparse@@\pgfmath@parse@stop% + % + \expandafter\pgfmathparse@trynumber@loop\pgfmath@expression\pgfmath@parse@stop + % + % this here is the _real_ parser. it is invoked by + % \pgfmathparse@trynumber@loop if that says "this is no number" + %\pgfmathparse@@\pgfmath@parse@stop% } -\def\pgfmath@parse@stop{\pgfmath@parse@stop}% equals only itself +\def\pgfmath@parse@stop{\pgfmath@parse@stop}% equals only itsself \def\pgfmathparse@trynumber@token{numeric} \begingroup @@ -66,52 +66,52 @@ % % #1 a single token \def\pgfmathparse@trynumber@loop{% - \futurelet\pgfmath@token@let\pgfmathparse@trynumber@loop@ + \futurelet\pgfmath@token@let\pgfmathparse@trynumber@loop@ }% \def\pgfmathparse@trynumber@loop@#1{% - \ifx\pgfmath@token@let\pgf@let@space@token - % Hm. we found a white space... and we have no support for - % trimming. That means we have to assume that the white space - % occurred somewhere in the middle - and fall back to the - % expensive method. - \def\pgfmath@parse@next{\pgfmathparse@@#1}% - \else - \ifx\pgfmath@token@let\bgroup% - % oh! We found '{' #1. - % Well, these braces appear to be special; fall back to - % the complicated routine... - \let\pgfmath@parse@next=\pgfmathparse@@ - \else - \ifx\pgfmath@token@let\pgfmath@parse@stop - % Ah: we have passed the check! The expression consists only - % of 0123456789. , so do not parse anything and return it - % as-is! - \let\pgfmath@parse@next=\pgfmathparse@expression@is@number - \else - \expandafter\ifx\csname pgfmath@token@\pgfmathparse@trynumber@token @\string#1\endcsname\relax% - % hm. It is none of 0123456789. - \let\pgfmath@parse@next=\pgfmathparse@@ - \else - % continue... we only found one of 0123456789. so - % far... - \let\pgfmath@parse@next=\pgfmathparse@trynumber@loop - \fi - \fi - \fi - \fi - \pgfmath@parse@next + \ifx\pgfmath@token@let\pgf@let@space@token + % Hm. we found a white space... and we have no support for + % trimming. That means we have to assume that the white space + % occurred somewhere in the middle - and fall back to the + % expensive method. + \def\pgfmath@parse@next{\pgfmathparse@@#1}% + \else + \ifx\pgfmath@token@let\bgroup% + % oh! We found '{' #1. + % Well, these braces appear to be special; fall back to + % the complicated routine... + \let\pgfmath@parse@next=\pgfmathparse@@ + \else + \ifx\pgfmath@token@let\pgfmath@parse@stop + % Ah: we have passed the check! The expression consists only + % of 0123456789. , so do not parse anything and return it + % as-is! + \let\pgfmath@parse@next=\pgfmathparse@expression@is@number + \else + \expandafter\ifx\csname pgfmath@token@\pgfmathparse@trynumber@token @\string#1\endcsname\relax% + % hm. It is none of 0123456789. + \let\pgfmath@parse@next=\pgfmathparse@@ + \else + % continue... we only found one of 0123456789. so + % far... + \let\pgfmath@parse@next=\pgfmathparse@trynumber@loop + \fi + \fi + \fi + \fi + \pgfmath@parse@next }% \def\pgfmathparse@expression@is@number{% - \let\pgfmathresult=\pgfmath@expression + \let\pgfmathresult=\pgfmath@expression \pgfmath@smuggleone\pgfmathresult% \endgroup \ignorespaces }% \def\pgfmathparse@@#1\pgfmath@parse@stop{% % We are inside a group (opened in |\pgfmathparse| or - % |\pgfmathqparse|). - % Stuff for calc compatibility. + % |\pgfmathqparse|). + % Stuff for calc compatiability. \let\real=\pgfmath@calc@real \let\minof=\pgfmath@calc@minof \let\maxof=\pgfmath@calc@maxof @@ -141,7 +141,7 @@ \let\pgfmathpostparse=\relax -% For compatibility with older version. +% For compatiability with older version. % \def\pgfmathscaleresult{% \ifpgfmathunitsdeclared @@ -178,7 +178,7 @@ \pgfmath@next% }% -% Stuff for computability with the calc package. +% Stuff for compatability with the calc package. % \def\pgfmath@calc@real#1{#1} \def\pgfmath@calc@minof#1#2{min(#1,#2)} @@ -208,14 +208,14 @@ \edef\pgfmath@char@hash{\the\pgfmath@toks} \def\pgfmath@tokens@make#1#2{% - % Defines for each token or balanced text in |#2| a control sequence + % Defines for each token or balenced text in |#2| a control sequence % |\pgfmath@token@<#1>@\string<one token from #2>| and stores |#2| % in it. \def\pgfmath@prefix{#1}% % Note the empty group |{}| at the end that ends the loop in % |\pgfmath@token@@make|. \expandafter\pgfmath@tokens@@make#2{}} - + \def\pgfmath@tokens@@make#1{% \def\pgfmath@token{#1}% \ifx\pgfmath@token\pgfmath@empty @@ -265,7 +265,7 @@ \let\pgfmath@parse@nobgroup@after=#2% \futurelet\pgfmath@token@let% \pgfmath@parse@@ifbgroup} - + \def\pgfmath@parse@@ifbgroup{% \ifx\pgfmath@token@let\bgroup \let\pgfmath@parse@next=\pgfmath@parse@@@ifbgroup @@ -305,9 +305,9 @@ \def\pgfmath@parse@@operand{% \pgfmath@parse@ifbgroup{\pgfmath@parse@@operand}{\pgfmath@parse@@operand@}} -% An operand is +% An operand is % * |+| (unary plus), -% * |-| (unary minus), +% * |-| (unary minus), % * a prefix operator \def\pgfmath@parse@@operand@#1{% \def\pgfmath@token{#1}% @@ -396,8 +396,8 @@ % 4. A box dimension (e.g., \wd\mybox). % 5. A box dimension preceded by a number or a count register. % 6. Scientific notation (e.g., 1.234567e-10). -% 7. A binary, hexadecimal, or octal number. -% +% 7. A binary, hexadeciaml, or octal number. +% \def\pgfmath@parse@number{\pgfmath@parse@ifbgroup{\pgfmath@parse@number}{\pgfmath@parse@number@}} \def\pgfmath@parse@number@#1{% \let\pgfmath@token=\pgfmath@token@next% @@ -430,7 +430,7 @@ \pgfmath@count=\pgfmath@token% \expandafter\def\expandafter\pgfmath@number\expandafter{\the\pgfmath@count}% \expandafter\ifcat\pgfmath@token@next\relax% - % A CS following a count register should be \wd, \ht or \dp. + % A CS following a count register should be \wd, \ht or \dp. \let\pgfmath@parse@next=\pgfmath@parse@number% \else% \let\pgfmathresult=\pgfmath@number% @@ -464,7 +464,7 @@ \expandafter\ifx\csname pgfmath@token@mathunit@\pgfmath@token\expandafter\string\pgfmath@token@next\endcsname\relax% % ...none of the above... \ifx\pgfmath@base\pgfmath@empty% - \let\pgfmathresult=\pgfmath@number% + \let\pgfmathresult=\pgfmath@number% \else% \ifx\pgfmath@number\pgfmath@char@zero% \let\pgfmathresult=\pgfmath@number% @@ -491,7 +491,7 @@ \let\pgfmath@parse@next=\pgfmath@parse@base% \fi% \else% ... and here, it is the exponent characters. - \let\pgfmath@parse@next=\pgfmath@parse@exponent% + \let\pgfmath@parse@next=\pgfmath@parse@exponent% \fi% \else% ...but here it is units. \global\pgfmathunitsdeclaredtrue% @@ -555,7 +555,7 @@ \expandafter\def\expandafter\pgfmath@number\expandafter{\the\pgfmath@count}% \def\pgfmath@token@next{#1}% \expandafter\ifcat\pgfmath@token@next\relax% - % A CS following a count register should be \wd, \ht or \dp. + % A CS following a count register should be \wd, \ht or \dp. \let\pgfmath@parse@next=\pgfmath@parse@number% \else% \let\pgfmathresult=\pgfmath@number% @@ -579,7 +579,7 @@ \pgfmath@parse@@operator% } -% Parse binary or hexadecimal numbers (octal numbers done elsewhere). +% Parse binary or hexadecimal numbers (octal numbers done elsehwere). % \def\pgfmath@parse@base{% \ifnum\pgfmath@base=2\relax% @@ -596,7 +596,7 @@ \let\pgfmath@number=\pgfmath@empty% \expandafter\pgfmath@parse@next\pgfmath@token@next% } - + \def\pgfmath@parse@binary#1{% \expandafter\ifx\csname pgfmath@token@binary@#1\endcsname\relax% \expandafter\pgfmathbasetobase\expandafter\pgfmathresult\expandafter{\pgfmath@number}{2}{10}% @@ -622,7 +622,7 @@ \fi% \pgfmath@parse@next% } - + % Parse a function. % \def\pgfmath@parse@function{\pgfmath@parse@ifbgroup{\pgfmath@parse@function}{\pgfmath@parse@@function}} @@ -645,7 +645,7 @@ \expandafter\def\expandafter\pgfmath@function\expandafter{\pgfmath@function#1}% \let\pgfmath@parse@next=\pgfmath@parse@function@% \fi% - \else% It is from A-Z, a-z, or _. + \else% It is from from A-Z, a-z, or _. \edef\pgfmath@function{\pgfmath@function#1}% \let\pgfmath@parse@next=\pgfmath@parse@function@% \fi% @@ -683,7 +683,7 @@ \pgfmath@parse@ifbgroup{\pgfmath@parse@@operator@@}{\pgfmath@parse@@operator@@}}% \def\pgfmath@parse@@operator@@#1{% ...and second token. \def\pgfmath@token@next{#1}% - \pgfmath@parse@@@operator} + \pgfmath@parse@@@operator} \def\pgfmath@parse@@@operator{% \expandafter\ifx\csname pgfmath@operator@\pgfmath@token\expandafter\string\pgfmath@token@next\endcsname\relax% @@ -770,10 +770,10 @@ % \def\pgfmath@operator@@@process{% Process an operator. \pgfmath@stack@pop@operation\pgfmath@@operator% - \pgfmath@stack@pop@operand\pgfmath@operand@a% + \pgfmath@stack@pop@operand\pgfmath@operand@a% \ifcase\csname pgfmath@operation@\pgfmath@@operator @arity\endcsname\relax% % Zero arity operators (!). - \or% + \or% \pgfmath@operator@@@@process{\pgfmath@operand@a}% \or% \pgfmath@stack@pop@operand\pgfmath@operand@b% @@ -781,7 +781,7 @@ \or% \pgfmath@stack@pop@operand\pgfmath@operand@b% \expandafter\pgfmath@operator@@@@process\expandafter% - {\expandafter\pgfmath@operand@b\expandafter}\pgfmath@operand@a% + {\expandafter\pgfmath@operand@b\expandafter}\pgfmath@operand@a% \else% % No operators with more than tenary arity. \fi% @@ -807,7 +807,7 @@ \else% \expandafter\pgfmath@function@@@@process\expandafter{\pgfmath@@operand}% \fi% - \fi% + \fi% } \def\pgfmath@function@@@@process{\csname pgfmath\pgfmath@@function @\endcsname} @@ -834,7 +834,7 @@ \def\pgfmath@stack@pop@operation#1{% \pgfmath@stack@pop\pgfmath@stack@operation{#1}% \let\pgfmath@stack@operation@top=\pgfmath@stack@top} - + % REMARK: This method will be overwritten by the FPU library. Please % keep any changes consistent. \def\pgfmath@stack@push@operand#1{% @@ -844,11 +844,11 @@ \def\pgfmath@stack@pop@operand#1{% \pgfmath@stack@pop\pgfmath@stack@operand{#1}% \let\pgfmath@stack@operand@top=\pgfmath@stack@top} - + % Declare an operator for the parser. % -% It is not recommended that new operators be created as +% It is not recommended that new operators be created as % the parser is not fully robust for arbitrary operators. % \def\pgfmathdeclareoperator#1#2#3#4#5{% @@ -896,7 +896,7 @@ \pgfmathdeclareoperator{)}{@endgroup} {0}{postfix}{4} \pgfmathdeclareoperator{\pgfmath@bgroup}{@startarray}{1}{prefix} {3} -\pgfmathdeclareoperator{\pgfmath@egroup}{@endarray} {1}{postfix}{2}% +\pgfmathdeclareoperator{\pgfmath@egroup}{@endarray} {1}{postfix}{2}% % Special operators. \pgfmathdeclareoperator{"}{}{1}{prefix}{1} |