annotate python/c3/astprinter.py @ 284:05184b95fa16
Moved tests to seperate folder
author |
Windel Bouwman |
date |
Fri, 15 Nov 2013 13:43:22 +0100 |
parents |
c1ccb1cb4cef |
children |
|
rev |
line source |
163
|
1 from .visitor import Visitor
|
|
2
|
|
3 class AstPrinter:
|
|
4 def printAst(self, pkg):
|
|
5 self.indent = 0
|
215
|
6 visitor = Visitor()
|
|
7 visitor.visit(pkg, self.print1, self.print2)
|
163
|
8 def print1(self, node):
|
|
9 print(' ' * self.indent + str(node))
|
|
10 self.indent += 2
|
|
11 def print2(self, node):
|
|
12 self.indent -= 2
|
|
13
|