From: Eshel Yaron Date: Sat, 7 Oct 2023 12:24:30 +0000 (+0200) Subject: ; Fix precedence calculation for unary operator arguments X-Git-Tag: V9.1.16-sweep-0.25.3~7 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38d1326feec6689f47cdff407097cdc36672abbd;p=sweep.git ; Fix precedence calculation for unary operator arguments --- diff --git a/sweep.pl b/sweep.pl index abe7cfe..c14f6bc 100644 --- a/sweep.pl +++ b/sweep.pl @@ -1315,8 +1315,8 @@ sweep_replace_term_r(term_position(From, To, _, _, ArgsPos), Term, FileName, Mod ( xref_op(FileName, op(Precedence0, Assoc, Functor)) ; current_op(Precedence0, Assoc, Functor) ), - memberchk(Assoc, [fx,fy]) - -> ( Assoc == fx + memberchk(Assoc, [xf,yf]) + -> ( Assoc == xf -> Precedence is Precedence0 - 1 ; Precedence = Precedence0 ) @@ -1324,8 +1324,8 @@ sweep_replace_term_r(term_position(From, To, _, _, ArgsPos), Term, FileName, Mod ( xref_op(FileName, op(Precedence0, Assoc, Functor)) ; current_op(Precedence0, Assoc, Functor) ), - memberchk(Assoc, [xf,yf]) - -> ( Assoc == xf + memberchk(Assoc, [fx,fy]) + -> ( Assoc == fx -> Precedence is Precedence0 - 1 ; Precedence = Precedence0 )