summaryrefslogtreecommitdiff
path: root/giscanner/introspectablepass.py
diff options
context:
space:
mode:
authorJonathan Matthew <jonathan@d14n.org>2010-10-27 19:11:13 +1000
committerJonathan Matthew <jonathan@d14n.org>2010-12-16 07:45:36 +1000
commit24a5ba0dc0be57146f6504679adf2527ed4a2802 (patch)
treef270f24231da3557c9a9e5e56bbb19dbe77419bf /giscanner/introspectablepass.py
parent112100a47956effefc07ed594fb921cf941fd828 (diff)
downloadgobject-introspection-24a5ba0dc0be57146f6504679adf2527ed4a2802.tar.gz
scanner: support typedefs for container types
Inside an alias definition, we only need the name of the alias target type. Add a method to GIRWriter to write out a type reference rather than full type definition and use it when writing out an alias. Determine introspectableness of aliases in IntrospectablePass so functions using aliases can be marked not-introspectable if the alias itself is not. https://bugzilla.gnome.org/show_bug.cgi?id=629682
Diffstat (limited to 'giscanner/introspectablepass.py')
-rw-r--r--giscanner/introspectablepass.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index 8aa7f8d3..4b35f7d9 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -31,6 +31,7 @@ class IntrospectablePass(object):
# Public API
def validate(self):
+ self._namespace.walk(self._introspectable_alias_analysis)
self._namespace.walk(self._propagate_callable_skips)
self._namespace.walk(self._analyze_node)
self._namespace.walk(self._introspectable_callable_analysis)
@@ -166,6 +167,12 @@ class IntrospectablePass(object):
if target.skip:
parent.skip = True
+ def _introspectable_alias_analysis(self, obj, stack):
+ if isinstance(obj, ast.Alias):
+ if not self._type_is_introspectable(obj.target):
+ obj.introspectable = False
+ return True
+
def _propagate_callable_skips(self, obj, stack):
if isinstance(obj, ast.Callable):
for param in obj.parameters: