summaryrefslogtreecommitdiff
path: root/giscanner/annotationparser.py
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2011-07-22 16:46:10 -0400
committerJasper St. Pierre <jstpierre@mecheye.net>2011-07-22 17:17:11 -0400
commiteda7d98cb70de1445239955a99b44e128802dcc9 (patch)
tree29fa16b5d1f63ec25930cc1219859a170f683122 /giscanner/annotationparser.py
parent834f928f2032434fa8f54f68c51cc40fa8271733 (diff)
downloadgobject-introspection-eda7d98cb70de1445239955a99b44e128802dcc9.tar.gz
giscanner: Make comments starting with tab characters work
https://bugzilla.gnome.org/show_bug.cgi?id=655149
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r--giscanner/annotationparser.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 2a22ece3..ac6430d6 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -413,7 +413,8 @@ class DocOption(object):
class AnnotationParser(object):
- COMMENT_HEADER_RE = re.compile(r'^\*[ \t]*\n ')
+ COMMENT_HEADER_RE = re.compile(r'^\*[ \t]*\n[\t ]')
+ COMMENT_HEADER_START_RE = re.compile(r'\n[\t ]')
WHITESPACE_RE = re.compile(r'^\s*$')
ASCII_TEXT_RE = re.compile(r'\s*[A-Za-z]+')
OPTION_RE = re.compile(r'\([A-Za-z]+[^(]*\)')
@@ -451,9 +452,10 @@ class AnnotationParser(object):
return
comment = comment[2:]
- pos = comment.find('\n ')
- if pos == -1:
+ match = self.COMMENT_HEADER_START_RE.search(comment)
+ if match is None:
return
+ pos = match.start()
block_header = comment[:pos]
block_header = block_header.strip()
cpos = block_header.find(': ')