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'
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]+[^(]*\)')
#
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
</parameter>
</parameters>
</function>
+ <function name="space_after_comment_bug631690"
+ c:identifier="annotation_space_after_comment_bug631690">
+ <doc xml:whitespace="preserve">Explicitly test having a space after the ** here.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ </function>
<function name="string_array_length"
c:identifier="annotation_string_array_length">
<return-value transfer-ownership="none">