[gobject-introspection] giscanner: expand parse_comment_block() parameters



commit 8d9396f9b3253bff876456ec695bcea7cbbf7a69
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Wed May 15 22:48:42 2013 +0200

    giscanner: expand parse_comment_block() parameters
    
    Makes it consistent with the parse_comment_blocks() and
    _parse_comment_block() methods.

 giscanner/annotationparser.py                 |   14 +++++++-------
 tests/scanner/annotationparser/test_parser.py |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 3b9b90a..40a0140 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 2c8cd6e..adf4f65 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()]
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]