giscanner: Correctly detect invalid GTK-Doc comment block end markers
authorDieter Verfaillie <dieterv@optionexplicit.be>
Wed, 4 Jul 2012 07:10:51 +0000 (09:10 +0200)
committerDieter Verfaillie <dieterv@optionexplicit.be>
Wed, 28 Nov 2012 20:31:23 +0000 (21:31 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=688897

giscanner/annotationparser.py
tests/scanner/annotationparser/gi/syntax.xml

index 179af86..57a5433 100644 (file)
@@ -790,6 +790,9 @@ class AnnotationParser(object):
         # Check for the end the comment block.
         if COMMENT_END_RE.match(comment_lines[-1][1]):
             del comment_lines[-1]
+        else:
+            # Not a GTK-Doc comment block.
+            return None
 
         # If we get this far, we are inside a GTK-Doc comment block.
         return self._parse_comment_block(comment_lines, filename, lineno)
index 67224de..c97bd5b 100644 (file)
@@ -71,6 +71,25 @@ something */</commentblock>
 
 <test>
   <!--
+  Not GTK-Doc
+  -->
+  <commentblock>/**
+Test
+something */</commentblock>
+</test>
+
+<test>
+  <!--
+  Not GTK-Doc
+  -->
+  <commentblock>/**
+Test
+something **/</commentblock>
+</test>
+
+
+<test>
+  <!--
   Broken comment block, signal the start of the comment block description followed
   by a parameter instead.
   -->