[gobject-introspection] scanner: Fix rename-to handling
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] scanner: Fix rename-to handling
- Date: Fri, 3 Sep 2010 22:07:48 +0000 (UTC)
commit c1f4f42be118243549b00ba216314389a2072325
Author: Colin Walters <walters verbum org>
Date: Fri Sep 3 18:07:16 2010 -0400
scanner: Fix rename-to handling
We were writing the attributes backwards. Also actually use
the attribute in the typelib generation.
girepository/girparser.c | 5 +++++
giscanner/maintransformer.py | 4 ++--
tests/scanner/Annotation-1.0-expected.gir | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/girepository/girparser.c b/girepository/girparser.c
index bdb8781..0c022f9 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -774,6 +774,7 @@ start_function (GMarkupParseContext *context,
GError **error)
{
const gchar *name;
+ const gchar *shadows;
const gchar *symbol;
const gchar *deprecated;
const gchar *throws;
@@ -817,6 +818,7 @@ start_function (GMarkupParseContext *context,
ctx->in_embedded_type = in_embedded_type;
name = find_attribute ("name", attribute_names, attribute_values);
+ shadows = find_attribute ("name", attribute_names, attribute_values);
symbol = find_attribute ("c:identifier", attribute_names, attribute_values);
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
throws = find_attribute ("throws", attribute_names, attribute_values);
@@ -832,6 +834,9 @@ start_function (GMarkupParseContext *context,
return FALSE;
}
+ if (shadows)
+ name = shadows;
+
function = (GIrNodeFunction *) g_ir_node_new (G_IR_NODE_FUNCTION,
ctx->current_module);
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 2e1a126..3cb090b 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -142,8 +142,8 @@ class MainTransformer(object):
target.shadows,
rename_to))
else:
- target.shadows = node.symbol
- node.shadowed_by = target.symbol
+ target.shadowed_by = node.symbol
+ node.shadows = target.symbol
def _apply_annotations_function(self, node, chain):
block = self._blocks.get(node.symbol)
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 086f063..3dcd0cb 100644
--- a/tests/scanner/Annotation-1.0-expected.gir
+++ b/tests/scanner/Annotation-1.0-expected.gir
@@ -456,7 +456,7 @@ type.</doc>
</method>
<method name="watch"
c:identifier="annotation_object_watch"
- shadows="annotation_object_watch_full"
+ shadowed-by="annotation_object_watch_full"
introspectable="0">
<doc xml:whitespace="preserve">This is here just for the sake of being overriden by its
annotation_object_watch_full().</doc>
@@ -476,7 +476,7 @@ annotation_object_watch_full().</doc>
</method>
<method name="watch_full"
c:identifier="annotation_object_watch_full"
- shadowed-by="annotation_object_watch">
+ shadows="annotation_object_watch">
<doc xml:whitespace="preserve">Test overriding via the "Rename To" annotation.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]