Mercurial > lcfOS
diff python/astviewer.py @ 216:57c032c5e753
Fixed ast viewer
author | Windel Bouwman |
---|---|
date | Fri, 05 Jul 2013 13:26:51 +0200 |
parents | 8b2f20aae086 |
children | 225f444019b1 |
line wrap: on
line diff
--- a/python/astviewer.py Fri Jul 05 13:00:03 2013 +0200 +++ b/python/astviewer.py Fri Jul 05 13:26:51 2013 +0200 @@ -6,7 +6,6 @@ def __init__(self): self.functionIco = QIcon(QPixmap('icons/functionicon.png').scaled(32, 32)) self.variableIco = QIcon(QPixmap('icons/variableicon.png').scaled(32, 32)) - self.visitor = Visitor(self.p1, self.p2) self.model = QStandardItemModel() self.model.setHorizontalHeaderLabels(['Object', 'Type']) def build(self, pkg): @@ -14,7 +13,8 @@ c = self.model.rowCount() self.model.removeRows(0, c) self.curItem = self.model.invisibleRootItem() - self.visitor.visit(pkg) + visitor = Visitor() + visitor.visit(pkg, self.p1, self.p2) def p1(self, node): if type(node) is astnodes.Variable: i = QStandardItem(self.variableIco, str(node))