From 8f638062fb49866e3a2f632a64eb71d7dbcc75bc Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 4 Jul 2012 09:10:51 +0200 Subject: [PATCH] giscanner: Correctly detect invalid GTK-Doc comment block end markers https://bugzilla.gnome.org/show_bug.cgi?id=688897 --- giscanner/annotationparser.py | 3 +++ tests/scanner/annotationparser/gi/syntax.xml | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 179af86..57a5433 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 67224de..c97bd5b 100644 --- a/tests/scanner/annotationparser/gi/syntax.xml +++ b/tests/scanner/annotationparser/gi/syntax.xml @@ -71,6 +71,25 @@ something */ + /** +Test +something */ + + + + + /** +Test +something **/ + + + + + -- 2.7.4