summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2012-07-04 09:10:51 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2012-11-28 21:31:23 +0100
commit8f638062fb49866e3a2f632a64eb71d7dbcc75bc (patch)
treee22d393caa0625be9d51d26b5e5d7058add41098
parent079b2c5bf9d73ac47a7bb1c62f176cbd85fb1e2a (diff)
downloadgobject-introspection-8f638062fb49866e3a2f632a64eb71d7dbcc75bc.tar.gz
giscanner: Correctly detect invalid GTK-Doc comment block end markers
https://bugzilla.gnome.org/show_bug.cgi?id=688897
-rw-r--r--giscanner/annotationparser.py3
-rw-r--r--tests/scanner/annotationparser/gi/syntax.xml19
2 files changed, 22 insertions, 0 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 179af86a..57a5433e 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -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)
diff --git a/tests/scanner/annotationparser/gi/syntax.xml b/tests/scanner/annotationparser/gi/syntax.xml
index 67224de5..c97bd5bc 100644
--- a/tests/scanner/annotationparser/gi/syntax.xml
+++ b/tests/scanner/annotationparser/gi/syntax.xml
@@ -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.
-->