@@ -235,6 +235,17 @@ def to_string(self):
235
235
return "BinaryOp[{}]" .format (strip_namespace (self .val ["_op" ]))
236
236
237
237
238
+ class NaryOpPrinter (DynamicArityNodePrinter ):
239
+ """Pretty-printer for NaryOp."""
240
+
241
+ def __init__ (self , val ):
242
+ """Initialize NaryOpPrinter."""
243
+ super ().__init__ (val , 0 , "NaryOp" )
244
+
245
+ def to_string (self ):
246
+ return "NaryOp[{}]" .format (strip_namespace (self .val ["_op" ]))
247
+
248
+
238
249
class BlackholePrinter (FixedArityNodePrinter ):
239
250
"""Pretty-printer for Blackhole."""
240
251
@@ -259,6 +270,14 @@ def __init__(self, val):
259
270
super ().__init__ (val , 2 , "Let" )
260
271
261
272
273
+ class MultiLetPrinter (DynamicArityNodePrinter ):
274
+ """Pretty-printer for MultiLet."""
275
+
276
+ def __init__ (self , val ):
277
+ """Initialize MultiLetPrinter."""
278
+ super ().__init__ (val , 0 , "MultiLet" )
279
+
280
+
262
281
class LambdaAbstractionPrinter (FixedArityNodePrinter ):
263
282
"""Pretty-printer for LambdaAbstraction."""
264
283
@@ -286,6 +305,14 @@ def __init__(self, val):
286
305
super ().__init__ (val , 0 , "Source" )
287
306
288
307
308
+ class SwitchPrinter (DynamicArityNodePrinter ):
309
+ """Pretty-printer for Switch."""
310
+
311
+ def __init__ (self , val ):
312
+ """Initialize SwitchPrinter."""
313
+ super ().__init__ (val , 0 , "Switch" )
314
+
315
+
289
316
class ReferencesPrinter (DynamicArityNodePrinter ):
290
317
"""Pretty-printer for References."""
291
318
@@ -376,12 +403,15 @@ def register_optimizer_printers(pp):
376
403
"Variable" ,
377
404
"UnaryOp" ,
378
405
"BinaryOp" ,
406
+ "NaryOp" ,
379
407
"If" ,
380
408
"Let" ,
409
+ "MultiLet" ,
381
410
"LambdaAbstraction" ,
382
411
"LambdaApplication" ,
383
412
"FunctionCall" ,
384
413
"Source" ,
414
+ "Switch" ,
385
415
"References" ,
386
416
"ExpressionBinder" ,
387
417
]
0 commit comments