projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
575a450
)
print node position in PrintTree
author
Stefan Behnel
<scoder@users.berlios.de>
Sun, 15 Mar 2009 14:42:40 +0000
(15:42 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sun, 15 Mar 2009 14:42:40 +0000
(15:42 +0100)
Cython/Compiler/Visitor.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Visitor.py
b/Cython/Compiler/Visitor.py
index 034a2e67ef2942552efb3863c8601c1f7a46d26e..c7739f8d6554efb7ecab1007366657e430f8c739 100644
(file)
--- a/
Cython/Compiler/Visitor.py
+++ b/
Cython/Compiler/Visitor.py
@@
-342,7
+342,15
@@
class PrintTree(TreeVisitor):
elif isinstance(node, ExprNodes.ExprNode):
t = node.type
result += "(type=%s)" % repr(t)
-
+ elif node.pos:
+ pos = node.pos
+ path = pos[0].get_description()
+ if '/' in path:
+ path = path.split('/')[-1]
+ if '\\' in path:
+ path = path.split('\\')[-1]
+ result += "(pos=(%s:%s:%s))" % (path, pos[1], pos[2])
+
return result
if __name__ == "__main__":