block_name, block_options = block_header, {}
block = DocBlock(block_name, block_options)
comment_lines = []
+ parse_parameters = True
+ canon_name = ''
for line in comment[pos+1:].split('\n'):
line = line.lstrip()
line = line[2:].strip() # Skip ' *'
if not line:
+ if parse_parameters:
+ parse_parameters = False
continue
if line.startswith('@'):
line = line[1:]
elif not ': ' in line:
- comment_lines.append(line)
+ if parse_parameters and line:
+ if canon_name != '' and canon_name in block.tags:
+ block.tags[canon_name].comment += ' ' + line
+ else:
+ comment_lines.append(line)
continue
tag_name, value = self._split_tag_namevalue(line)
canon_name = tag_name.lower()
tag.value = value
options, rest = self._parse_options(tag.value)
tag.options = options
- tag.comment = rest
+ tag.comment = rest or ''
return tag
def _parse_options(self, value):
<parameters>
<parameter name="nums"
transfer-ownership="none"
- doc="Sequence of numbers">
+ doc="Sequence of numbers that are zero-terminated">
<array zero-terminated="0" length="2" c:type="int*">
<type name="int"/>
</array>
<parameters>
<parameter name="nums"
transfer-ownership="none"
- doc="Sequence of numbers">
+ doc="Sequence of numbers that are zero-terminated">
<array length="2" c:type="int*">
<type name="int"/>
</array>
/**
* annotation_object_compute_sum_n:
* @object: a #GObject
- * @nums: (array length=n_nums zero-terminated=0): Sequence of numbers
+ * @nums: (array length=n_nums zero-terminated=0): Sequence of
+ * numbers that are zero-terminated
* @n_nums: Length of number array
*
* Test taking an array with length parameter
/**
* annotation_object_compute_sum_nz:
* @object: a #AnnotationObject
- * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers
+ * @nums: (array length=n_nums zero-terminated=1): Sequence of numbers that
+ * are zero-terminated
* @n_nums: Length of number array
*
* Test taking a zero-terminated array with length parameter