diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-05-28 17:20:49 +0200 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-10-08 20:54:59 +0200 |
commit | cc96177ec877153e7e5e55e6af270829da546015 (patch) | |
tree | c316058a23302adf9e63b3227d92853af692096c /giscanner/annotationparser.py | |
parent | 4d1972cedd20bb51b8c67ec030339d5d4dce12a9 (diff) | |
download | gobject-introspection-cc96177ec877153e7e5e55e6af270829da546015.tar.gz |
giscanner: give pointer to original comment block...
...when complaining about multiple comment blocks
documenting the same identifier.
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r-- | giscanner/annotationparser.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index f5205a57..d5da84cf 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -105,6 +105,7 @@ Refer to the `GTK-Doc manual`_ for more detailed usage information. ''' +import os import re from . import message @@ -856,15 +857,16 @@ class GtkDocCommentBlockParser(object): continue if comment_block is not None: - # Note: previous versions of this parser did not check - # if an identifier was already stored in comment_blocks, - # so when multiple comment blocks where encountered documenting - # the same identifier the last one seen "wins". - # Keep this behavior for backwards compatibility, but - # emit a warning. + # Note: previous versions of this parser did not check if an identifier was + # already stored in comment_blocks, so when different comment blocks where + # encountered documenting the same identifier the last comment block seen + # "wins". Keep this behavior for backwards compatibility, but emit a warning. if comment_block.name in comment_blocks: - message.warn("multiple comment blocks documenting '%s:' identifier." % - (comment_block.name, ), + firstseen = comment_blocks[comment_block.name] + path = os.path.dirname(firstseen.position.filename) + message.warn('multiple comment blocks documenting \'%s:\' identifier ' + '(already seen at %s).' % + (comment_block.name, firstseen.position.format(path)), comment_block.position) comment_blocks[comment_block.name] = comment_block |