summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/annotationparser.py14
-rw-r--r--tests/scanner/annotationparser/test_parser.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 3b9b90a9..40a01401 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -841,13 +841,13 @@ class GtkDocCommentBlockParser(object):
comment_blocks = {}
- for comment in comments:
+ for (comment, filename, lineno) in comments:
try:
- comment_block = self.parse_comment_block(comment)
+ comment_block = self.parse_comment_block(comment, filename, lineno)
except Exception:
message.warn('unrecoverable parse error, please file a GObject-Introspection '
'bug report including the complete comment block at the '
- 'indicated location.', message.Position(comment[1], comment[2]))
+ 'indicated location.', message.Position(filename, lineno))
continue
if comment_block is not None:
@@ -866,17 +866,17 @@ class GtkDocCommentBlockParser(object):
return comment_blocks
- def parse_comment_block(self, comment):
+ def parse_comment_block(self, comment, filename, lineno):
'''
Parse a single GTK-Doc comment block.
:param comment: string representing the GTK-Doc comment block including it's
start ("``/**``") and end ("``*/``") tokens.
- :returns: a :class:`DocBlock` object or ``None``
+ :param filename: source file name where the comment block originated from
+ :param lineno: line number in the source file where the comment block starts
+ :returns: a :class:`GtkDocCommentBlock` object or ``None``
'''
- comment, filename, lineno = comment
-
# Assign line numbers to each line of the comment block,
# which will later be used as the offset to calculate the
# real line number in the source file
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py
index 2c8cd6ed..adf4f657 100644
--- a/tests/scanner/annotationparser/test_parser.py
+++ b/tests/scanner/annotationparser/test_parser.py
@@ -83,7 +83,7 @@ class TestCommentBlock(unittest.TestCase):
# Parse GTK-Doc comment block
commentblock = testcase.find(ns('{}input')).text
- parsed_docblock = GtkDocCommentBlockParser().parse_comment_block((commentblock, 'test.c', 1))
+ parsed_docblock = GtkDocCommentBlockParser().parse_comment_block(commentblock, 'test.c', 1)
parsed_tree = self.parsed2tree(parsed_docblock).split('\n')
emitted_messages = [w[w.find(':') + 1:].strip() for w in output.getvalue()]