summaryrefslogtreecommitdiff
path: root/giscanner/girparser.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-02-24 03:55:18 -0500
committerColin Walters <walters@verbum.org>2013-02-26 16:25:11 -0500
commitdfeaf33c8a4ae7e25b4a83d0b31c4d435b4ef7de (patch)
tree86776c3fbf1ddb2db7d29125c48d6830d8b5ffc5 /giscanner/girparser.py
parent971d1f98053eec324756429a7966aab2279abd87 (diff)
downloadgobject-introspection-dfeaf33c8a4ae7e25b4a83d0b31c4d435b4ef7de.tar.gz
scanner: internals cleanup: Key more things off Namespace
The .gir format has a weird legacy where stuff like the includes are outside of the <namespace>. But conceptually they're tied together, so let's start reflecting this in the code. This way we can just pass around and look at a Namespace object instead of a 4-tuple of (namespace, includes, c_includes, pkg_config). https://bugzilla.gnome.org/show_bug.cgi?id=694593
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r--giscanner/girparser.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py
index 4cba5065..f2908bff 100644
--- a/giscanner/girparser.py
+++ b/giscanner/girparser.py
@@ -47,7 +47,6 @@ class GIRParser(object):
def __init__(self, types_only=False):
self._types_only = types_only
self._shared_libraries = []
- self._includes = set()
self._pkgconfig_packages = set()
self._namespace = None
self._filename_stack = []
@@ -62,10 +61,10 @@ class GIRParser(object):
self._filename_stack.pop()
def parse_tree(self, tree):
- self._includes.clear()
self._namespace = None
self._shared_libraries = []
self._pkgconfig_packages = set()
+ self._includes = set()
self._c_includes = set()
self._c_prefix = None
self._parse_api(tree.getroot())
@@ -76,9 +75,6 @@ class GIRParser(object):
def get_shared_libraries(self):
return self._shared_libraries
- def get_includes(self):
- return self._includes
-
def get_c_includes(self):
return self._c_includes
@@ -146,6 +142,7 @@ class GIRParser(object):
if 'shared-library' in ns.attrib:
self._shared_libraries.extend(
ns.attrib['shared-library'].split(','))
+ self._namespace.includes = self._includes
parser_methods = {
_corens('alias'): self._parse_alias,