summaryrefslogtreecommitdiff
path: root/giscanner/girparser.py
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-12 20:11:44 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-12 20:11:44 +0000
commit7dbbda9abea9882d2c98726f382a905fa8738706 (patch)
treebdf438fc921de19ddee90d7f2c5972cf76fec48f /giscanner/girparser.py
parentba4ee2e606545ac703941698aa25e6d865e6976f (diff)
downloadgobject-introspection-7dbbda9abea9882d2c98726f382a905fa8738706.tar.gz
Bug 563794 - Redo annotation parsing & applying
2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563794 - Redo annotation parsing & applying Thanks to Colin for helping out considerably in landing this. * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/dumper.py: * giscanner/girparser.py: * giscanner/giscannermodule.c (pygi_source_scanner_get_comments), (calc_attrs_length), (pygi_collect_attributes), (init_giscanner): * giscanner/glibtransformer.py: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c (gi_source_symbol_unref), (gi_source_scanner_new), (gi_source_scanner_free), (gi_source_scanner_get_comments): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/xmlwriter.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: * tools/g-ir-scanner: This commit merges the annotation parser rewrite branch. It'll change the annotation parsing to be done completely in python code which will make it easier to do further annotation parsing easier. svn path=/trunk/; revision=1017
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r--giscanner/girparser.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py
index 17f53521..3e2432ed 100644
--- a/giscanner/girparser.py
+++ b/giscanner/girparser.py
@@ -53,6 +53,7 @@ class GIRParser(object):
self._namespace = None
# Public API
+
def parse(self, filename):
tree = parse(filename)
self.parse_tree(tree)
@@ -79,6 +80,7 @@ class GIRParser(object):
self._include_parsing = include_parsing
# Private
+
def _add_node(self, node):
self._namespace.nodes.append(node)
@@ -152,7 +154,9 @@ class GIRParser(object):
for iface in node.findall(_corens('prerequisites')):
obj.prerequisities.append(iface.attrib['name'])
for method in node.findall(_corens('method')):
- obj.methods.append(self._parse_function_common(method, Function))
+ func = self._parse_function_common(method, Function)
+ func.is_method = True
+ obj.methods.append(func)
for ctor in node.findall(_corens('constructor')):
obj.constructors.append(
self._parse_function_common(ctor, Function))
@@ -284,8 +288,9 @@ class GIRParser(object):
if self._include_parsing:
return
for method in node.findall(_corens('method')):
- obj.methods.append(
- self._parse_function_common(method, Function))
+ func = self._parse_function_common(method, Function)
+ func.is_method = True
+ obj.methods.append(func)
for ctor in node.findall(_corens('constructor')):
obj.constructors.append(
self._parse_function_common(ctor, Function))