gcalctool r2060 - in trunk: . gcalctool
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2060 - in trunk: . gcalctool
- Date: Thu, 10 Apr 2008 00:38:34 +0100 (BST)
Author: rancell
Date: Thu Apr 10 00:38:33 2008
New Revision: 2060
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2060&view=rev
Log:
Change parser precedence to perform negation after power operation (Bug #526094)
Modified:
trunk/ChangeLog
trunk/gcalctool/ce_parser.y
Modified: trunk/gcalctool/ce_parser.y
==============================================================================
--- trunk/gcalctool/ce_parser.y (original)
+++ trunk/gcalctool/ce_parser.y Thu Apr 10 00:38:33 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]