]> Repositorios git - scryer-prolog.git/commitdiff
shorten needs_bracketing/2
authorMarkus Triska <[email protected]>
Fri, 30 Jun 2023 16:01:54 +0000 (18:01 +0200)
committerMarkus Triska <[email protected]>
Fri, 30 Jun 2023 16:01:54 +0000 (18:01 +0200)
src/toplevel.pl

index d61e324ff4af44b3aea8b9b94d078287c89418a0..7d1e256917b1d1c2655f99e567d6a44c21842e7a 100644 (file)
@@ -211,16 +211,12 @@ needs_bracketing(Value, Op) :-
     current_op(FPrec, FSpec, F),
     current_op(EqPrec, EqSpec, Op),
     arity_specifier(Arity, FSpec),
-    (  Arity =:= 0 ->
-       true
-    ;  EqPrec < FPrec ->
-       true
-    ;  FPrec > 0, F == Value, graphic_token_char(F) ->
-       true
-    ;  F \== '.', '$quoted_token'(F) ->
-       true
-    ;  EqPrec == FPrec,
-       memberchk(EqSpec, [fx,xfx,yfx])
+    (  Arity =:= 0
+    ;  EqPrec < FPrec
+    ;  FPrec > 0, F == Value, graphic_token_char(F)
+    ;  F \== '.', '$quoted_token'(F)
+    ;  EqPrec =:= FPrec,
+       member(EqSpec, [fx,xfx,yfx])
     ).
 
 arity_specifier(0, _).