summaryrefslogtreecommitdiff
path: root/giscanner/annotationparser.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-10-19 08:45:13 -0400
committerColin Walters <walters@verbum.org>2010-10-19 08:45:13 -0400
commit2e8e7530fc66b3222525a236a395b8d24eecf404 (patch)
tree1fd8ecaa781bc480c8abe1bf3dd9e30934e38a06 /giscanner/annotationparser.py
parentf97cc8687469f25752f7927545ad4daecef8ab44 (diff)
downloadgobject-introspection-2e8e7530fc66b3222525a236a395b8d24eecf404.tar.gz
Accept trailing whitespace at the start of a comment block
Might as well be liberal here, as long as we have a test case. https://bugzilla.gnome.org/show_bug.cgi?id=631690
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r--giscanner/annotationparser.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 5e45e5dc..03a88832 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -25,9 +25,6 @@ import re
from . import message
from .odict import odict
-# All gtk-doc comments needs to start with this:
-_COMMENT_HEADER = '*\n '
-
# Tags - annotations applyed to comment blocks
TAG_VFUNC = 'virtual'
TAG_SINCE = 'since'
@@ -405,6 +402,7 @@ class DocOption(object):
class AnnotationParser(object):
+ COMMENT_HEADER_RE = re.compile(r'^\*[ \t]*\n ')
WHITESPACE_RE = re.compile(r'^\s*$')
ASCII_TEXT_RE = re.compile(r'\s*[A-Za-z]+')
OPTION_RE = re.compile(r'\([A-Za-z]+[^(]*\)')
@@ -434,9 +432,9 @@ class AnnotationParser(object):
#
comment, filename, lineno = cmt
comment = comment.lstrip()
- if not comment.startswith(_COMMENT_HEADER):
+ if not self.COMMENT_HEADER_RE.search(comment):
return
- comment = comment[len(_COMMENT_HEADER):]
+ comment = self.COMMENT_HEADER_RE.sub('', comment, count=1)
comment = comment.strip()
if not comment.startswith('* '):
return