parameters: (clean_lines, linenum, pos)
return_statement: return (line, clean_lines.NumLines(), -1)
docstring: If input points to ( or { or [ or <, finds the position that closes it.
  
    If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
    linenum/pos that correspond to the closing of the expression.
  
    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      pos: A position on the line.
  
    Returns:
      A tuple (line, linenum, pos) pointer *past* the closing brace, or
      (line, len(lines), -1) if we never find a close.  Note we ignore
      strings and comments when matching; and the line we return is the
      'cleansed' line at linenum.
docstring_summary: If input points to ( or { or [ or <, finds the position that closes it.
docstring_tokens: If input points to ( or { or [ or < finds the position that closes it .
function: def CloseExpression(clean_lines, linenum, pos):
    """If input points to ( or { or [ or <, finds the position that closes it.
  
    If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
    linenum/pos that correspond to the closing of the expression.
  
    Args:
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      pos: A position on the line.
  
    Returns:
      A tuple (line, linenum, pos) pointer *past* the closing brace, or
      (line, len(lines), -1) if we never find a close.  Note we ignore
      strings and comments when matching; and the line we return is the
      'cleansed' line at linenum.
    """
  
    line = clean_lines.elided[linenum]
    startchar = line[pos]
    if startchar not in '({[<':
      return (line, clean_lines.NumLines(), -1)
    if startchar == '(': endchar = ')'
    if startchar == '[': endchar = ']'
    if startchar == '{': endchar = '}'
    if startchar == '<': endchar = '>'
  
    # Check first line
    (end_pos, num_open) = FindEndOfExpressionInLine(
        line, pos, 0, startchar, endchar)
    if end_pos > -1:
      return (line, linenum, end_pos)
  
    # Continue scanning forward
    while linenum < clean_lines.NumLines() - 1:
      linenum += 1
      line = clean_lines.elided[linenum]
      (end_pos, num_open) = FindEndOfExpressionInLine(
          line, 0, num_open, startchar, endchar)
      if end_pos > -1:
        return (line, linenum, end_pos)
  
    # Did not find endchar before end of file, give up
    return (line, clean_lines.NumLines(), -1)
function_tokens: def CloseExpression ( clean_lines , linenum , pos ) : line = clean_lines . elided [ linenum ] startchar = line [ pos ] if startchar not in '({[<' : return ( line , clean_lines . NumLines ( ) , - 1 ) if startchar == '(' : endchar = ')' if startchar == '[' : endchar = ']' if startchar == '{' : endchar = '}' if startchar == '<' : endchar = '>' # Check first line ( end_pos , num_open ) = FindEndOfExpressionInLine ( line , pos , 0 , startchar , endchar ) if end_pos > - 1 : return ( line , linenum , end_pos ) # Continue scanning forward while linenum < clean_lines . NumLines ( ) - 1 : linenum += 1 line = clean_lines . elided [ linenum ] ( end_pos , num_open ) = FindEndOfExpressionInLine ( line , 0 , num_open , startchar , endchar ) if end_pos > - 1 : return ( line , linenum , end_pos ) # Did not find endchar before end of file, give up return ( line , clean_lines . NumLines ( ) , - 1 )