From 1ead8a98eaf4ddbfa11c39ccbb0df9c2c26c86db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=C3=ABl=20Delaval?= Date: Tue, 23 May 2017 22:01:05 +0200 Subject: [PATCH] Correction of unary minus priority To fix: see test minus_pre.ept: node main() = (o,p:int) let o = ~-1 -> pre o + 1; p = -1 fby p + 1 tel --- compiler/heptagon/parsing/hept_parser.mly | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/heptagon/parsing/hept_parser.mly b/compiler/heptagon/parsing/hept_parser.mly index 46ea168..12ee552 100644 --- a/compiler/heptagon/parsing/hept_parser.mly +++ b/compiler/heptagon/parsing/hept_parser.mly @@ -103,11 +103,10 @@ open Hept_parsetree %left STAR INFIX3 %left INFIX4 %right NOT -%right prec_uminus %right FBY %right PRE %left POWER -%right PREFIX +%nonassoc PREFIX @@ -570,7 +569,7 @@ _exp: { mk_op_call $2 [$1; $3] } | PREFIX exp { mk_op_call $1 [$2] } - | SUBTRACTIVE exp %prec prec_uminus + | SUBTRACTIVE exp %prec PREFIX { mk_op_call ("~"^$1) [$2] } | IF exp THEN exp ELSE exp { mk_call Eifthenelse [$2; $4; $6] }