parameters: (result_type, name, args, comment, is_dyncast=False)
docstring: Adds a matcher to one of our categories.
docstring_summary: Adds a matcher to one of our categories.
docstring_tokens: Adds a matcher to one of our categories .
function: def add_matcher(result_type, name, args, comment, is_dyncast=False):
    """Adds a matcher to one of our categories."""
    if name == 'id':
       # FIXME: Figure out whether we want to support the 'id' matcher.
       return
    matcher_id = '%s%d' % (name, ids[name])
    ids[name] += 1
    args = unify_arguments(args)
    matcher_html = TD_TEMPLATE % {
      'result': esc('Matcher<%s>' % result_type),
      'name': name,
      'args': esc(args),
      'comment': esc(strip_doxygen(comment)),
      'id': matcher_id,
    }
    if is_dyncast:
      node_matchers[result_type + name] = matcher_html
    # Use a heuristic to figure out whether a matcher is a narrowing or
    # traversal matcher. By default, matchers that take other matchers as
    # arguments (and are not node matchers) do traversal. We specifically
    # exclude known narrowing matchers that also take other matchers as
    # arguments.
    elif ('Matcher<' not in args or
          name in ['allOf', 'anyOf', 'anything', 'unless']):
      narrowing_matchers[result_type + name + esc(args)] = matcher_html
    else:
      traversal_matchers[result_type + name + esc(args)] = matcher_html
function_tokens: def add_matcher ( result_type , name , args , comment , is_dyncast = False ) : if name == 'id' : # FIXME: Figure out whether we want to support the 'id' matcher. return matcher_id = '%s%d' % ( name , ids [ name ] ) ids [ name ] += 1 args = unify_arguments ( args ) matcher_html = TD_TEMPLATE % { 'result' : esc ( 'Matcher<%s>' % result_type ) , 'name' : name , 'args' : esc ( args ) , 'comment' : esc ( strip_doxygen ( comment ) ) , 'id' : matcher_id , } if is_dyncast : node_matchers [ result_type + name ] = matcher_html # Use a heuristic to figure out whether a matcher is a narrowing or # traversal matcher. By default, matchers that take other matchers as # arguments (and are not node matchers) do traversal. We specifically # exclude known narrowing matchers that also take other matchers as # arguments. elif ( 'Matcher<' not in args or name in [ 'allOf' , 'anyOf' , 'anything' , 'unless' ] ) : narrowing_matchers [ result_type + name + esc ( args ) ] = matcher_html else : traversal_matchers [ result_type + name + esc ( args ) ] = matcher_html