gcalctool r2320 - in branches/gnome-2-24: . gcalctool



Author: rancell
Date: Sat Nov 29 08:57:14 2008
New Revision: 2320
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2320&view=rev

Log:
 Give binary invert operation higher precedence (Sami PietilÃ, Bug #562251)

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

Modified: branches/gnome-2-24/gcalctool/ce_parser.y
==============================================================================
--- branches/gnome-2-24/gcalctool/ce_parser.y	(original)
+++ branches/gnome-2-24/gcalctool/ce_parser.y	Sat Nov 29 08:57:14 2008
@@ -96,6 +96,7 @@
 %left '+' '-'
 %left '*' '/'
 %left MED
+%left LNEG
 %left NEG
 %left POS
 %right '^'
@@ -184,12 +185,6 @@
     }
     calc_xor($1, $3, $$);
 }
-| '~' exp {
-    if (!is_natural($2)) {
-	parser_state.error = -PARSER_ERR_BITWISEOP;
-    }
-    calc_not($2, $$);
-}
 ;
 
 
@@ -201,6 +196,12 @@
 | 'e' '^' term {calc_epowy($3, $$);} 
 | term '!' {calc_factorial($1 ,$$);}
 | term '%' {calc_percent($1, $$);}
+| '~' term %prec LNEG {
+    if (!is_natural($2)) {
+	parser_state.error = -PARSER_ERR_BITWISEOP;
+    }
+    calc_not($2, $$);
+}
 | '-' term %prec NEG {mp_invert_sign($2, $$);}
 | '+' term %prec POS {cp($2, $$);}
 | term '^' term {calc_xpowy($1, $3, $$);}



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