diff options
author | Johan Dahlin <johan@src.gnome.org> | 2008-05-08 23:41:07 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-05-08 23:41:07 +0000 |
commit | af9a71b6e03415bcbc82febc2a969046d9e962ae (patch) | |
tree | 3f6dc2fde617f70986ded3fdaf978b259b817bd4 /giscanner/ast.py | |
parent | d63401a69a8bc5391ff6898c5278ddfa8da5f512 (diff) | |
download | gobject-introspection-af9a71b6e03415bcbc82febc2a969046d9e962ae.tar.gz |
Improve repr() for ast nodes
svn path=/trunk/; revision=270
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r-- | giscanner/ast.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 2bd5f27c..91333e1d 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -77,12 +77,18 @@ class Node(object): def __init__(self, name=None): self.name = name + def __repr__(self): + return '%s(%r)' % (self.__class__.__name__, self.name) + class Namespace(Node): def __init__(self, name): Node.__init__(self, name) self.nodes = [] + def __repr__(self): + return '%s(%r, %r)' % (self.__class__.__name__, self.name, + self.nodes) class Function(Node): def __init__(self, name, retval, parameters, symbol): @@ -106,9 +112,6 @@ class Type(Node): Node.__init__(self, name) self.ctype = name - def __repr__(self): - return 'Type(%r)' % (self.name,) - class Parameter(Node): def __init__(self, name, typenode): @@ -146,9 +149,6 @@ class Struct(Node): self.fields = [] self.symbol = symbol - def __repr__(self): - return 'Struct(%r)' % (self.name,) - class Return(Node): def __init__(self, type_name): |