diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-24 13:50:17 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-24 13:53:36 -0300 |
commit | 818333247787bb1cf51b0fb13276114de9f9bfa2 (patch) | |
tree | 5b1894733fa6b4605333be54c28e5e5a0ae80f4a /giscanner | |
parent | 789321d97207d6989ef77805fe5fb5920b6935cc (diff) | |
download | gobject-introspection-818333247787bb1cf51b0fb13276114de9f9bfa2.tar.gz |
[annotationparser] Allow param less closures
Allow closures without annotations to avoid having
to duplicate the parameter name.
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/annotationparser.py | 6 | ||||
-rw-r--r-- | giscanner/maintransformer.py | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 075f227d..f2bc1d4b 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -207,7 +207,11 @@ class DocTag(object): elif option == OPT_ATTRIBUTE: self._validate_option('attribute', value, n_params=2) elif option == OPT_CLOSURE: - self._validate_option('closure', value, n_params=1) + if value is not None and value.length() > 1: + message.warn( + 'closure takes at maximium 1 value, %d given' % ( + value.length()), self.position) + continue elif option == OPT_DESTROY: self._validate_option('destroy', value, n_params=1) elif option == OPT_ELEMENT_TYPE: diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 0407bbc5..e45ff795 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -600,7 +600,7 @@ usage is void (*_gtk_reserved1)(void);""" # since we don't have a way right now to flag this callback a destroy. destroy_param.scope = ast.PARAM_SCOPE_NOTIFIED closure = options.get(OPT_CLOSURE) - if closure: + if closure and closure.length() == 1: param.closure_name = self._get_validate_parameter_name(parent, closure.one(), param) |