summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-23 17:13:29 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-23 17:25:47 -0300
commite2b95cdb39d6e5f287e23dbf30a04031b49a230f (patch)
treeb3d36b0a28cf358dc1ce40459d57e4638eb965b1 /giscanner/maintransformer.py
parent2525786185e0f9025f88c00769d948d2b83d646d (diff)
downloadgobject-introspection-e2b95cdb39d6e5f287e23dbf30a04031b49a230f.tar.gz
[scanner] Warn for invalid scanner annotations
Warn for invalid annotations. Change so that custom attributes have to use the annotation keyword.
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index a50951a3..605c5d35 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -25,8 +25,8 @@ from .annotationparser import (TAG_VFUNC, TAG_SINCE, TAG_DEPRECATED, TAG_RETURNS
TAG_ATTRIBUTES, TAG_RENAME_TO, TAG_TYPE, TAG_TRANSFER,
TAG_UNREF_FUNC, TAG_REF_FUNC, TAG_SET_VALUE_FUNC,
TAG_GET_VALUE_FUNC)
-from .annotationparser import (OPT_ALLOW_NONE,
- OPT_ARRAY, OPT_ELEMENT_TYPE, OPT_IN, OPT_INOUT,
+from .annotationparser import (OPT_ALLOW_NONE, OPT_ARRAY, OPT_ATTRIBUTE,
+ OPT_ELEMENT_TYPE, OPT_IN, OPT_INOUT,
OPT_INOUT_ALT, OPT_OUT, OPT_SCOPE,
OPT_TYPE, OPT_CLOSURE, OPT_DESTROY, OPT_SKIP,
OPT_FOREIGN, OPT_ARRAY_FIXED_SIZE,
@@ -114,6 +114,8 @@ usage is void (*_gtk_reserved1)(void);"""
ast.Record, ast.Union)):
return True
for field in node.fields:
+ if field is None:
+ continue
if (field.name.startswith('_')
and field.anonymous_node is not None
and isinstance(field.anonymous_node, ast.Callback)):
@@ -506,11 +508,9 @@ usage is void (*_gtk_reserved1)(void);"""
if tag is not None and tag.comment is not None:
node.doc = tag.comment
- for key in options:
- if '.' in key:
- value = options.get(key)
- if value:
- node.attributes.append((key, value.one()))
+ if options:
+ for attribute in options.getall(OPT_ATTRIBUTE):
+ node.attributes.append(attribute.flat())
def _apply_annotations_annotated(self, node, block):
if block is None: