summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-09-03 18:09:35 -0400
committerColin Walters <walters@verbum.org>2010-09-03 18:17:28 -0400
commit25d7a4dc44e3a9c211ac8f82925063e638c202c6 (patch)
treeb81483d129dd3b42a334824ed4df509e6e09458c
parentc1f4f42be118243549b00ba216314389a2072325 (diff)
downloadgobject-introspection-25d7a4dc44e3a9c211ac8f82925063e638c202c6.tar.gz
scanner: Fix previous rename-to handling commit
-rw-r--r--girepository/girparser.c2
-rw-r--r--giscanner/maintransformer.py10
-rw-r--r--tests/scanner/Annotation-1.0-expected.gir4
3 files changed, 9 insertions, 7 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 0c022f92..53f1c415 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -818,7 +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);
+ shadows = find_attribute ("shadows", 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);
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 3cb090b2..dc09ae22 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -142,13 +142,12 @@ class MainTransformer(object):
target.shadows,
rename_to))
else:
- target.shadowed_by = node.symbol
- node.shadows = target.symbol
+ target.shadowed_by = node.name
+ node.shadows = target.name
def _apply_annotations_function(self, node, chain):
block = self._blocks.get(node.symbol)
self._apply_annotations_callable(node, chain, block)
- self._apply_annotation_rename_to(node, chain, block)
def _pass_callable_defaults(self, node, chain):
if isinstance(node, (ast.Callable, glibast.GLibSignal)):
@@ -607,9 +606,12 @@ class MainTransformer(object):
return True
def _apply_annotations2_function(self, node, chain):
+ block = self._blocks.get(node.symbol)
+
+ self._apply_annotation_rename_to(node, chain, block)
+
# Handle virtual invokers
parent = chain[-1] if chain else None
- block = self._blocks.get(node.symbol)
if not (block and parent):
return
virtual = block.get(TAG_VFUNC)
diff --git a/tests/scanner/Annotation-1.0-expected.gir b/tests/scanner/Annotation-1.0-expected.gir
index 3dcd0cb1..6d72dd4f 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"
- shadowed-by="annotation_object_watch_full"
+ shadowed-by="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"
- shadows="annotation_object_watch">
+ shadows="watch">
<doc xml:whitespace="preserve">Test overriding via the "Rename To" annotation.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>