Lines Matching defs:comment

21 <tr><td colspan="4" class="doc" id="%(id)s"><pre>%(comment)s</pre></td></tr>
60 def extract_result_types(comment):
61 """Extracts a list of result types from the given comment.
63 We allow annotations in the comment of the matcher to specify what
72 m = re.search(r'Usable as: Any Matcher[\s\n]*$', comment, re.S)
76 m = re.match(r'^(.*)Matcher<([^>]+)>\s*,?[\s\n]*$', comment, re.S)
78 if re.search(r'Usable as:\s*$', comment):
83 comment = m.group(1)
85 def strip_doxygen(comment):
86 """Returns the given comment without \-escaped words."""
88 comment = re.sub(r'^\\[^\s]+\n', r'', comment, flags=re.M)
92 comment = re.sub(r'\\see', r'See also:', comment)
95 comment = re.sub(r'\\[^\s]+\s+', r'', comment)
96 return comment
113 def add_matcher(result_type, name, args, comment, is_dyncast=False):
133 'comment': esc(strip_doxygen(comment)),
155 def act_on_decl(declaration, comment, allowed_types):
156 """Parse the matcher out of the given declaration and comment.
177 comment, is_dyncast=True)
188 comment, is_dyncast=True)
192 # comment, is_dyncast=True)
205 comment_result_types = extract_result_types(comment)
210 add_matcher(result_type, name, 'Matcher<Type>', comment)
213 # comment)
237 add_matcher(result_type, name, args, comment)
253 comment += """
259 add_matcher(result_type, name, arg, comment)
278 add_matcher(result, name, args, comment)
304 add_matcher(result_type, name, args, comment)
322 comment += """
329 add_matcher(result_type, name, arg, comment)
339 add_matcher('*', name, 'Matcher<*>', comment)
349 add_matcher(result, name, '%s, ..., %s' % (arg, arg), comment)
368 add_matcher(result_type, name, '%s, ..., %s' % (arg, arg), comment)
380 add_matcher('*', name, 'Matcher<*>', comment)
383 add_matcher('*', name, 'Matcher<*>, ..., Matcher<*>', comment)
392 add_matcher('*', name, 'Matcher<*>...Matcher<*>', comment)
419 result_types = extract_result_types(comment)
421 if not comment:
428 add_matcher(result_type, name, args, comment)
451 comment = ''
459 act_on_decl(declaration, comment, allowed_types)
460 comment = ''
470 comment += re.sub(r'^/+\s?', '', line) + '\n'
479 act_on_decl(declaration, comment, allowed_types)
480 comment = ''