gcalctool r2319 - in trunk: . gcalctool
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gcalctool r2319 - in trunk: . gcalctool
- Date: Sat, 29 Nov 2008 08:49:43 +0000 (UTC)
Author: rancell
Date: Sat Nov 29 08:49:43 2008
New Revision: 2319
URL: http://svn.gnome.org/viewvc/gcalctool?rev=2319&view=rev
Log:
Give binary invert operation higher precedence (Sami PietilÃ, Bug #562251)
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 Sat Nov 29 08:49:43 2008
@@ -87,6 +87,7 @@
%left '+' '-'
%left '*' '/'
%left MED
+%left LNEG
%left NEG
%left POS
%right '^'
@@ -176,12 +177,6 @@
}
calc_xor($1, $3, $$);
}
-| '~' exp {
- if (!is_natural($2)) {
- parser_state.error = -PARSER_ERR_BITWISEOP;
- }
- calc_not($2, $$);
-}
;
@@ -193,6 +188,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]