summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-01-30 10:02:41 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 19:19:50 -0500
commitf027b6841164fc5c712236b3c40a90808e1b7428 (patch)
tree7d69b3c9360cee0fd6d2e4dc2961488c198e4cda /giscanner/ast.py
parent55815545eb163b7046fbe226dff946354f3c52d0 (diff)
downloadgobject-introspection-f027b6841164fc5c712236b3c40a90808e1b7428.tar.gz
ast: Track enum/bitfield member parents
We need this for the doctool so that we can link to an enum definition when we reference one of the member values. https://bugzilla.gnome.org/show_bug.cgi?id=693040
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 7076a845..50b0f29e 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -770,6 +770,8 @@ class Enum(Node, Registered):
self.c_symbol_prefix = c_symbol_prefix
self.ctype = ctype
self.members = members
+ for member in members:
+ member.parent = self
# Associated error domain name
self.error_domain = None
self.static_methods = []
@@ -791,6 +793,8 @@ class Bitfield(Node, Registered):
self.ctype = ctype
self.c_symbol_prefix = c_symbol_prefix
self.members = members
+ for member in members:
+ member.parent = self
self.static_methods = []
def _walk(self, callback, chain):
@@ -806,6 +810,7 @@ class Member(Annotated):
self.value = value
self.symbol = symbol
self.nick = nick
+ self.parent = None
def __cmp__(self, other):
return cmp(self.name, other.name)