summaryrefslogtreecommitdiff
path: root/giscanner/introspectablepass.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-24 18:22:35 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-24 18:22:35 -0300
commit096a5c5f9c0936c3b03a79c35497fb24c57da149 (patch)
treeb1405e75b060b247b27d42f0844c9901c7930be2 /giscanner/introspectablepass.py
parent7e081e3117912310e6f9fc208f96ba3642143eaa (diff)
downloadgobject-introspection-096a5c5f9c0936c3b03a79c35497fb24c57da149.tar.gz
Use tag position if available
Diffstat (limited to 'giscanner/introspectablepass.py')
-rw-r--r--giscanner/introspectablepass.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index 7de9b929..ef2ddf76 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -19,6 +19,7 @@
from . import ast
from . import message
+from .annotationparser import TAG_RETURNS
class IntrospectablePass(object):
@@ -50,6 +51,7 @@ class IntrospectablePass(object):
if isinstance(parent, (ast.VFunction, ast.Callback)):
return
+ block = None
if hasattr(parent, 'symbol'):
prefix = '%s: ' % (parent.symbol, )
block = self._blocks.get(parent.symbol)
@@ -61,6 +63,10 @@ class IntrospectablePass(object):
context = "argument %s: " % (param.argname, )
else:
context = "return value: "
+ if block:
+ return_tag = block.get(TAG_RETURNS)
+ if return_tag:
+ position = return_tag.position
message.warn_node(parent, prefix + context + text,
positions=position)