look up operator precedence when arity does not match what the atom records, don't print brackets around outermost '+' (#629)

This commit is contained in:
Mark Thom
2020-07-17 11:02:58 -06:00
parent 6c691d9223
commit f0c8056334
5 changed files with 59 additions and 23 deletions

View File

@@ -157,9 +157,12 @@ needs_bracketing(Value, Op) :-
current_op(FPrec, _, F)),
_,
false),
( EqPrec < FPrec -> true
; '$quoted_token'(F) -> true
; atom_length(F, 1), graphic_token_char(F) -> true
( EqPrec < FPrec ->
true
; '$quoted_token'(F) ->
true
; FPrec > 0, F == Value, graphic_token_char(F) ->
true
; EqPrec == FPrec,
memberchk(EqSpec, [fx,xfx,yfx])
).