gobject-introspection r771 - trunk/giscanner



Author: tko
Date: Tue Oct 21 16:58:20 2008
New Revision: 771
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=771&view=rev

Log:
Warn if we see annotations for unknown parameters

	* giscanner/transformer.py (_create_parameters): Warn if we see
	annotations for unknown parameters. If .h and .c files name
	parameters differently, the annotations may be lost.

Modified:
   trunk/giscanner/transformer.py

Modified: trunk/giscanner/transformer.py
==============================================================================
--- trunk/giscanner/transformer.py	(original)
+++ trunk/giscanner/transformer.py	Tue Oct 21 16:58:20 2008
@@ -291,6 +291,16 @@
             dirs = {}
         else:
             dirs = directives
+
+        # warn if we see annotations for unknown parameters
+        param_names = set(child.ident for child in base_type.child_list)
+        dirs_for = set(dirs)
+        dirs_for = dirs_for.difference(param_names)
+        dirs_for.discard('return')
+        if dirs_for:
+            print 'Unexpected annotations for %s, parameters are %s' % (
+                list(dirs_for), list(param_names), )
+
         for child in base_type.child_list:
             yield self._create_parameter(
                 child, dirs.get(child.ident, {}))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]