(clean_lines, line_number, error)
Checks that allocating an instance of a soft-linked class uses alloc[Class]Instance.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      line_number: The number of the line to check.
      error: The function to call with any errors found.
Checks that allocating an instance of a soft-linked class uses alloc[Class]Instance.
Checks that allocating an instance of a soft - linked class uses alloc [ Class ] Instance .
def check_soft_link_class_alloc(clean_lines, line_number, error):
    """Checks that allocating an instance of a soft-linked class uses alloc[Class]Instance.

    Args:
      clean_lines: A CleansedLines instance containing the file.
      line_number: The number of the line to check.
      error: The function to call with any errors found.
    """

    line = clean_lines.elided[line_number]

    matched = search(r'\[get(\w+)Class\(\)\s+alloc\]', line)
    if matched:
        error(line_number, 'runtime/soft-linked-alloc', 4,
              'Using +alloc with a soft-linked class. Use alloc%sInstance() instead.' % matched.group(1))
def check_soft_link_class_alloc ( clean_lines , line_number , error ) : line = clean_lines . elided [ line_number ] matched = search ( r'\[get(\w+)Class\(\)\s+alloc\]' , line ) if matched : error ( line_number , 'runtime/soft-linked-alloc' , 4 , 'Using +alloc with a soft-linked class. Use alloc%sInstance() instead.' % matched . group ( 1 ) )