diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-31 21:42:32 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-01 19:20:35 -0500 |
commit | 0f5f94ed8a86355003533452a2d6cc8077d27535 (patch) | |
tree | b3551d2692fe51336223659db0f886a01a032eed /giscanner/maintransformer.py | |
parent | f027b6841164fc5c712236b3c40a90808e1b7428 (diff) | |
download | gobject-introspection-0f5f94ed8a86355003533452a2d6cc8077d27535.tar.gz |
giscanner: Apply standard annotations to constant values
While there's no particular reason I need to do this, there
really isn't any reason to not do this, and it helps with doctool
or whatever in the future if we want to document when a constant
showed up. g-ir-compiler also keeps track of constant deprecations,
so this fixes constants not ever being deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=693040
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r-- | giscanner/maintransformer.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 67168d6b..d149f30a 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -192,7 +192,7 @@ usage is void (*_gtk_reserved1)(void);""" def _get_annotation_name(self, node): if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Enum, ast.Bitfield, - ast.Callback, ast.Alias)): + ast.Callback, ast.Alias, ast.Constant)): if node.ctype is not None: return node.ctype elif isinstance(node, ast.Registered) and node.gtype_name is not None: @@ -815,9 +815,12 @@ usage is void (*_gtk_reserved1)(void);""" self._apply_annotations_return(signal, signal.retval, block) def _apply_annotations_constant(self, node): - block = self._blocks.get(node.ctype) - if not block: + block = self._get_block(node) + if block is None: return + + self._apply_annotations_annotated(node, block) + tag = block.get_tag(TAG_VALUE) if tag: node.value = tag.value |