summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index d4163fae..bf276c06 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -215,6 +215,8 @@ usage is void (*_gtk_reserved1)(void);"""
if isinstance(node, (ast.Class, ast.Interface, ast.Union, ast.Enum,
ast.Bitfield, ast.Callback)):
self._apply_annotations_annotated(node, self._get_block(node))
+ if isinstance(node, (ast.Enum, ast.Bitfield)):
+ self._apply_annotations_enum_members(node, self._get_block(node))
if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union)):
block = self._get_block(node)
for field in node.fields:
@@ -820,6 +822,15 @@ usage is void (*_gtk_reserved1)(void);"""
if tag:
node.value = tag.value
+ def _apply_annotations_enum_members(self, node, block):
+ if block is None:
+ return
+
+ for m in node.members:
+ tag = block.params.get(m.symbol, None)
+ if tag is not None:
+ m.doc = tag.comment
+
def _pass_read_annotations2(self, node, chain):
if isinstance(node, ast.Function):
self._apply_annotations2_function(node, chain)