parameters: (clean_lines, linenum, init_prefix)
return_statement: return False
docstring: Find the corresponding < that started a template.
  
    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: Current line number.
      init_prefix: Part of the current line before the initial >.
  
    Returns:
      True if a matching bracket exists.
docstring_summary: Find the corresponding < that started a template.
docstring_tokens: Find the corresponding < that started a template .
function: def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
    """Find the corresponding < that started a template.
  
    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: Current line number.
      init_prefix: Part of the current line before the initial >.
  
    Returns:
      True if a matching bracket exists.
    """
    line = init_prefix
    nesting_stack = ['>']
    while True:
      # Find the previous operator
      match = Search(r'^(.*)([<>(),;\[\]])[^<>(),;\[\]]*$', line)
      if match:
        # Found an operator, update nesting stack
        operator = match.group(2)
        line = match.group(1)
  
        if nesting_stack[-1] == '>':
          # Expecting opening angle bracket
          if operator in ('>', ')', ']'):
            nesting_stack.append(operator)
          elif operator == '<':
            nesting_stack.pop()
            if not nesting_stack:
              # Found matching angle bracket
              return True
          elif operator == ',':
            # Got a comma before a bracket, this is most likely a
            # template argument.  The opening angle bracket is probably
            # there if we look for it, so just return early here.
            return True
          else:
            # Got some other operator.
            return False
  
        else:
          # Expecting opening parenthesis or opening bracket
          if operator in ('>', ')', ']'):
            nesting_stack.append(operator)
          elif operator in ('(', '['):
            nesting_stack.pop()
  
      else:
        # Scan the previous line
        linenum -= 1
        if linenum < 0:
          break
        line = clean_lines.elided[linenum]
  
    # Exhausted all earlier lines and still no matching angle bracket.
    return False
function_tokens: def FindPreviousMatchingAngleBracket ( clean_lines , linenum , init_prefix ) : line = init_prefix nesting_stack = [ '>' ] while True : # Find the previous operator match = Search ( r'^(.*)([<>(),;\[\]])[^<>(),;\[\]]*$' , line ) if match : # Found an operator, update nesting stack operator = match . group ( 2 ) line = match . group ( 1 ) if nesting_stack [ - 1 ] == '>' : # Expecting opening angle bracket if operator in ( '>' , ')' , ']' ) : nesting_stack . append ( operator ) elif operator == '<' : nesting_stack . pop ( ) if not nesting_stack : # Found matching angle bracket return True elif operator == ',' : # Got a comma before a bracket, this is most likely a # template argument.  The opening angle bracket is probably # there if we look for it, so just return early here. return True else : # Got some other operator. return False else : # Expecting opening parenthesis or opening bracket if operator in ( '>' , ')' , ']' ) : nesting_stack . append ( operator ) elif operator in ( '(' , '[' ) : nesting_stack . pop ( ) else : # Scan the previous line linenum -= 1 if linenum < 0 : break line = clean_lines . elided [ linenum ] # Exhausted all earlier lines and still no matching angle bracket. return False