[gobject-introspection] Warn about annotations for unknown args
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Warn about annotations for unknown args
- Date: Wed, 28 Apr 2010 12:33:56 +0000 (UTC)
commit 24711bc9ee6073fd77c99f10fa3d90e7e108af24
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date: Wed Apr 28 14:32:14 2010 +0200
Warn about annotations for unknown args
https://bugzilla.gnome.org/show_bug.cgi?id=615890
giscanner/annotationparser.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index c693a97..a4ba6fb 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -496,7 +496,21 @@ class AnnotationApplier(object):
return
field.type.name = self._transformer.resolve_type_name(t.one())
+ def _check_arg_annotations(self, parent, params, block):
+ if block is None:
+ return
+ for tag in block.tags.keys():
+ if tag == TAG_RETURNS:
+ continue
+ for param in params:
+ if param.name == tag:
+ break
+ else:
+ print 'WARNING: annotation for "%s" refers to unknown ' \
+ 'argument "%s"' % (parent.name, tag)
+
def _parse_params(self, parent, params, block):
+ self._check_arg_annotations(parent, params, block)
for param in params:
tag = self._get_tag(block, param.name)
self._parse_param(parent, param, tag)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]