gcalctool r2059 - in branches/gnome-2-22: . gcalctool



Author: rancell
Date: Thu Apr 10 00:38:26 2008
New Revision: 2059
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2059&view=rev

Log:
Change parser precedence to perform negation after power operation (Bug #526094)



Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/gcalctool/ce_parser.y

Modified: branches/gnome-2-22/gcalctool/ce_parser.y
==============================================================================
--- branches/gnome-2-22/gcalctool/ce_parser.y	(original)
+++ branches/gnome-2-22/gcalctool/ce_parser.y	Thu Apr 10 00:38:26 2008
@@ -97,10 +97,12 @@
 %start statement
 %left '+' '-'
 %left '*' '/'
-%right '^'
 %left MED
 %left NEG
 %left POS
+%right '^'
+%right '!'
+%right '%'
 %left HIGH
 
 %%
@@ -200,12 +202,12 @@
 | rcl {cp($1, $$);}
 | term '/' term {mpdiv($1, $3, $$);}
 | term '*' term {mpmul($1, $3, $$);}
-| term '^' term {calc_xpowy($1, $3, $$);}
 | 'e' '^' term {calc_epowy($3, $$);} 
 | term '!' {do_factorial($1 ,$$);}
 | term '%' {calc_percent($1, $$);}
 | '-' term %prec NEG {mpneg($2, $$);}
 | '+' term %prec POS {cp($2, $$);}
+| term '^' term {calc_xpowy($1, $3, $$);}
 
 | func {cp($1, $$);}
 | reg {cp($1, $$);}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]