diff options
author | Johan Dahlin <jdahlin@async.com.br> | 2008-11-21 02:53:28 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-11-21 02:53:28 +0000 |
commit | df5c5f82fc1f37624b766ed31ac9830aad3c6b47 (patch) | |
tree | c1f5d99b422887092adbf503851f9cb81eacb71a /giscanner/transformer.py | |
parent | 9811af9447b21bfb96ea3acc008e10f0dbb05db1 (diff) | |
download | gobject-introspection-df5c5f82fc1f37624b766ed31ac9830aad3c6b47.tar.gz |
Bug 561617 – Return value array annotations
2008-11-21 Johan Dahlin <jdahlin@async.com.br>
Bug 561617 – Return value array annotations
* giscanner/transformer.py:
* tests/scanner/annotation.c (annotation_return_array):
* tests/scanner/annotation.h:
Add support for (array) for return value annotations as well.
svn path=/trunk/; revision=957
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r-- | giscanner/transformer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index c60ec622..70a08498 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -249,7 +249,7 @@ class Transformer(object): raise ValueError("Unmatched length parameter name %r"\ % (target_name, )) - def _pair_annotations(self, params): + def _pair_annotations(self, params, return_): names = {} for param in params: if param.name in names: @@ -259,6 +259,9 @@ class Transformer(object): if isinstance(param.type, Array): self._pair_array(params, param) + if isinstance(return_.type, Array): + self._pair_array(params, return_) + # We take the annotations from the parser as strings; here we # want to split them into components, so: # (transfer full) -> {'transfer' : [ 'full' ]} @@ -275,9 +278,9 @@ class Transformer(object): directives = symbol.directives() parameters = list(self._create_parameters( symbol.base_type, directives)) - self._pair_annotations(parameters) return_ = self._create_return(symbol.base_type.base_type, directives.get('return', {})) + self._pair_annotations(parameters, return_) name = self._strip_namespace_func(symbol.ident) func = Function(name, return_, parameters, symbol.ident) self._parse_deprecated(func, directives) @@ -595,6 +598,8 @@ class Transformer(object): if option in ('transfer', 'transfer-inferred', 'element-type', 'out'): pass + elif option.startswith(('element-type', 'array')): + pass else: print 'Unhandled return type annotation option: %r' % ( option, ) |