parameters: (filename, error_handler, source=None)
docstring: Tokenize, run passes, and check the given file.
  
    Args:
      filename: The path of the file to check
      error_handler: The error handler to report errors to.
      source: A file-like object with the file source. If omitted, the file will
        be read from the filename path.
docstring_summary: Tokenize, run passes, and check the given file.
docstring_tokens: Tokenize run passes and check the given file .
function: def Run(filename, error_handler, source=None):
    """Tokenize, run passes, and check the given file.
  
    Args:
      filename: The path of the file to check
      error_handler: The error handler to report errors to.
      source: A file-like object with the file source. If omitted, the file will
        be read from the filename path.
    """
    if not source:
      try:
        source = open(filename)
      except IOError:
        error_handler.HandleFile(filename, None)
        error_handler.HandleError(
            error.Error(errors.FILE_NOT_FOUND, 'File not found'))
        error_handler.FinishFile()
        return
  
    if _IsHtml(filename):
      source_file = htmlutil.GetScriptLines(source)
    else:
      source_file = source
  
    token, tokenizer_mode = _Tokenize(source_file)
  
    error_handler.HandleFile(filename, token)
  
    # If we did not end in the basic mode, this a failed parse.
    if tokenizer_mode is not javascripttokenizer.JavaScriptModes.TEXT_MODE:
      error_handler.HandleError(
          error.Error(errors.FILE_IN_BLOCK,
                      'File ended in mode "%s".' % tokenizer_mode,
                      _GetLastNonWhiteSpaceToken(token)))
  
    # Run the ECMA pass
    error_token = None
  
    ecma_pass = ecmametadatapass.EcmaMetaDataPass()
    error_token = RunMetaDataPass(token, ecma_pass, error_handler, filename)
  
    is_limited_doc_check = (
        _IsLimitedDocCheck(filename, flags.FLAGS.limited_doc_files))
  
    _RunChecker(token, error_handler,
                is_limited_doc_check,
                is_html=_IsHtml(filename),
                stop_token=error_token)
  
    error_handler.FinishFile()
function_tokens: def Run ( filename , error_handler , source = None ) : if not source : try : source = open ( filename ) except IOError : error_handler . HandleFile ( filename , None ) error_handler . HandleError ( error . Error ( errors . FILE_NOT_FOUND , 'File not found' ) ) error_handler . FinishFile ( ) return if _IsHtml ( filename ) : source_file = htmlutil . GetScriptLines ( source ) else : source_file = source token , tokenizer_mode = _Tokenize ( source_file ) error_handler . HandleFile ( filename , token ) # If we did not end in the basic mode, this a failed parse. if tokenizer_mode is not javascripttokenizer . JavaScriptModes . TEXT_MODE : error_handler . HandleError ( error . Error ( errors . FILE_IN_BLOCK , 'File ended in mode "%s".' % tokenizer_mode , _GetLastNonWhiteSpaceToken ( token ) ) ) # Run the ECMA pass error_token = None ecma_pass = ecmametadatapass . EcmaMetaDataPass ( ) error_token = RunMetaDataPass ( token , ecma_pass , error_handler , filename ) is_limited_doc_check = ( _IsLimitedDocCheck ( filename , flags . FLAGS . limited_doc_files ) ) _RunChecker ( token , error_handler , is_limited_doc_check , is_html = _IsHtml ( filename ) , stop_token = error_token ) error_handler . FinishFile ( )