@@ -321,33 +321,33 @@ def ptype(self, t):
321
321
# LoopIR Pretty Printing
322
322
323
323
324
- def _format_code (code ):
324
+ def format_code (code ):
325
325
return FormatCode (code )[0 ].rstrip ("\n " )
326
326
327
327
328
328
@extclass (LoopIR .proc )
329
329
def __str__ (self ):
330
- return _format_code ("\n " .join (_print_proc (self , PrintEnv (), "" )))
330
+ return format_code ("\n " .join (_print_proc (self , PrintEnv (), "" )))
331
331
332
332
333
333
@extclass (LoopIR .fnarg )
334
334
def __str__ (self ):
335
- return _format_code (_print_fnarg (self , PrintEnv ()))
335
+ return format_code (_print_fnarg (self , PrintEnv ()))
336
336
337
337
338
338
@extclass (LoopIR .stmt )
339
339
def __str__ (self ):
340
- return _format_code ("\n " .join (_print_stmt (self , PrintEnv (), "" )))
340
+ return format_code ("\n " .join (_print_stmt (self , PrintEnv (), "" )))
341
341
342
342
343
343
@extclass (LoopIR .expr )
344
344
def __str__ (self ):
345
- return _format_code (_print_expr (self , PrintEnv ()))
345
+ return format_code (_print_expr (self , PrintEnv ()))
346
346
347
347
348
348
@extclass (LoopIR .type )
349
349
def __str__ (self ):
350
- return _format_code (_print_type (self , PrintEnv ()))
350
+ return format_code (_print_type (self , PrintEnv ()))
351
351
352
352
353
353
del __str__
@@ -588,7 +588,7 @@ def _print_cursor(cur):
588
588
589
589
root_cur = cur .root ()
590
590
lines = _print_cursor_proc (root_cur , cur , PrintEnv (), "" )
591
- code = _format_code ("\n " .join (lines ))
591
+ code = format_code ("\n " .join (lines ))
592
592
# need to use "..." for Python parsing, but unquoted ellipses are prettier
593
593
code = code .replace ('"..."' , "..." )
594
594
return code
0 commit comments