Lines Matching defs:comment
34 <tr><td colspan="4" class="doc" id="%(id)s"><pre>%(comment)s</pre></td></tr>
82 def extract_result_types(comment):
83 """Extracts a list of result types from the given comment.
85 We allow annotations in the comment of the matcher to specify what
94 m = re.search(r"Usable as: Any Matcher[\s\n]*$", comment, re.S)
98 m = re.match(r"^(.*)Matcher<([^>]+)>\s*,?[\s\n]*$", comment, re.S)
100 if re.search(r"Usable as:\s*$", comment):
105 comment = m.group(1)
108 def strip_doxygen(comment):
109 """Returns the given comment without \-escaped words."""
111 comment = re.sub(r"^\\[^\s]+\n", r"", comment, flags=re.M)
115 comment = re.sub(r"\\see", r"See also:", comment)
118 comment = re.sub(r"\\[^\s]+\s+", r"", comment)
119 return comment
143 def add_matcher(result_type, name, args, comment, is_dyncast=False):
163 "comment": esc(strip_doxygen(comment)),
191 def act_on_decl(declaration, comment, allowed_types):
192 """Parse the matcher out of the given declaration and comment.
218 result, name, "Matcher<%s>..." % inner, comment, is_dyncast=True
234 "Type", name, "Matcher<%s>..." % inner, comment, is_dyncast=True
239 # comment, is_dyncast=True)
256 comment_result_types = extract_result_types(comment)
262 add_matcher(result_type, name, "Matcher<Type>", comment)
265 # comment)
296 add_matcher(result_type, name, args, comment)
316 comment += """
322 add_matcher(result_type, name, arg, comment)
348 add_matcher(result, name, args, comment)
381 add_matcher(result_type, name, args, comment)
403 comment += """
410 add_matcher(result_type, name, arg, comment)
422 add_matcher("*", name, "Matcher<*>", comment)
434 add_matcher(result, name, "%s, ..., %s" % (arg, arg), comment)
455 add_matcher(result_type, name, "%s, ..., %s" % (arg, arg), comment)
468 add_matcher("*", name, "Matcher<*>", comment)
471 add_matcher("*", name, "Matcher<*>, ..., Matcher<*>", comment)
482 add_matcher("*", name, "Matcher<*>...Matcher<*>", comment)
523 result_types = extract_result_types(comment)
525 if not comment:
532 add_matcher(result_type, name, args, comment)
559 comment = ""
567 act_on_decl(declaration, comment, allowed_types)
568 comment = ""
578 comment += re.sub(r"^/+\s?", "", line) + "\n"
589 act_on_decl(declaration, comment, allowed_types)
590 comment = ""