We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff9a590 commit 0bc0755Copy full SHA for 0bc0755
1 file changed
devito/ir/cgen/printer.py
@@ -281,6 +281,13 @@ def _print_BitwiseNot(self, expr):
281
282
def _print_BitwiseBinaryOp(self, expr):
283
arg0, arg1 = expr.args
284
+
285
+ prec = precedence(expr)
286
+ if not arg0.is_Atom:
287
+ arg0 = self.parenthesize(arg0, prec)
288
+ if not arg1.is_Atom:
289
+ arg1 = self.parenthesize(arg1, prec)
290
291
return f'{self._print(arg0)} {expr.op} {self._print(arg1)}'
292
293
def _print_Add(self, expr, order=None):
0 commit comments