diff options
author | David Zeuthen <davidz@redhat.com> | 2010-06-15 11:01:37 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2010-06-24 11:53:18 -0400 |
commit | 11cfe386c37ced44a8e3efb5556bde3a43a11171 (patch) | |
tree | a01903a4e4596ca80c79abbc8d35c33dc665e526 /girepository/girparser.c | |
parent | 751ffa016e410a031028282e63f98a94cc444b7b (diff) | |
download | gobject-introspection-11cfe386c37ced44a8e3efb5556bde3a43a11171.tar.gz |
Allow attributes on parameters and return values
Any annotation where the key has a dot in the name will go into the
attribute list. For example
* @arg: (foo.bar baz): some arg
the parameter @arg will get the attribute with key foo.bar and value
baz. This also works for.
* Returns: (foo.bar2 baz2): the return value
Also add tests for this new feature.
See https://bugzilla.gnome.org/show_bug.cgi?id=571548
Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r-- | girepository/girparser.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c index 2713bb46..5efe7fde 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -1990,7 +1990,14 @@ start_attribute (GMarkupParseContext *context, curnode = CURRENT_NODE (ctx); - g_hash_table_insert (curnode->attributes, g_strdup (name), g_strdup (value)); + if (ctx->current_typed && ctx->current_typed->type == G_IR_NODE_PARAM) + { + g_hash_table_insert (ctx->current_typed->attributes, g_strdup (name), g_strdup (value)); + } + else + { + g_hash_table_insert (curnode->attributes, g_strdup (name), g_strdup (value)); + } return TRUE; } |