diff --git a/compiler/nodes.py b/compiler/nodes.py index f0288a7..b73363e 100644 --- a/compiler/nodes.py +++ b/compiler/nodes.py @@ -45,7 +45,10 @@ class Node: return f"{self.__class__.__name__}({vals})" def pprint(self, depth: int | None = None, indent: str = "\t"): - print("\n".join(self._pprint(depth=depth, indent=indent))) + print(self._pretty(depth, indent)) + + def _pretty(self, depth: int | None = None, indent: str = "\t") -> str: + return "\n".join(self._pprint(depth=depth, indent=indent)) def _pprint(self, depth: int | None, indent: str, _depth: int = 0) -> list[str]: if depth is not None and _depth >= depth: