summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2014-02-19 16:20:56 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2014-02-20 02:07:48 +0100
commitbd4608b6c761209bca8362bd5524e4dbe781e532 (patch)
tree49bbc18a7ee9dae6baec956f89cab7400530fd18 /giscanner/ast.py
parent76316783e3ac56365d0133cd17734b3b41f07360 (diff)
downloadgobject-introspection-bd4608b6c761209bca8362bd5524e4dbe781e532.tar.gz
ast: make sure that all nodes have a namespaces
Include Fields (which are not really Node, but the doctool wants to treat as such) and the methods of Boxed nodes. https://bugzilla.gnome.org/show_bug.cgi?id=724735
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index b5b2ad71..b992c111 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -409,12 +409,15 @@ but adds it to things like ctypes, symbols, and type_names.
self.type_names[node.gtype_name] = node
elif isinstance(node, Function):
self.symbols[node.symbol] = node
- if isinstance(node, (Compound, Class, Interface)):
+ if isinstance(node, (Compound, Class, Interface, Boxed)):
for fn in chain(node.methods, node.static_methods, node.constructors):
if not isinstance(fn, Function):
continue
fn.namespace = self
self.symbols[fn.symbol] = fn
+ if isinstance(node, (Compound, Class, Interface)):
+ for f in node.fields:
+ f.namespace = self
if isinstance(node, (Class, Interface)):
for m in chain(node.signals, node.properties):
m.namespace = self
@@ -916,6 +919,7 @@ class Field(Annotated):
self.bits = bits
self.anonymous_node = anonymous_node
self.private = False
+ self.namespace = None
self.parent = None # a compound
def __cmp__(self, other):