parameters: (filename)
docstring: Parse out the bug information from HTML output.
docstring_summary: Parse out the bug information from HTML output.
docstring_tokens: Parse out the bug information from HTML output .
function: def parse_bug_html(filename):
      """ Parse out the bug information from HTML output. """
  
      patterns = [re.compile(r'<!-- BUGTYPE (?P<bug_type>.*) -->$'),
                  re.compile(r'<!-- BUGFILE (?P<bug_file>.*) -->$'),
                  re.compile(r'<!-- BUGPATHLENGTH (?P<bug_path_length>.*) -->$'),
                  re.compile(r'<!-- BUGLINE (?P<bug_line>.*) -->$'),
                  re.compile(r'<!-- BUGCATEGORY (?P<bug_category>.*) -->$'),
                  re.compile(r'<!-- BUGDESC (?P<bug_description>.*) -->$'),
                  re.compile(r'<!-- FUNCTIONNAME (?P<bug_function>.*) -->$')]
      endsign = re.compile(r'<!-- BUGMETAEND -->')
  
      bug = {
          'report_file': filename,
          'bug_function': 'n/a',  # compatibility with < clang-3.5
          'bug_category': 'Other',
          'bug_line': 0,
          'bug_path_length': 1
      }
  
      with open(filename, encoding='utf-8') as handler:
          for line in handler.readlines():
              # do not read the file further
              if endsign.match(line):
                  break
              # search for the right lines
              for regex in patterns:
                  match = regex.match(line.strip())
                  if match:
                      bug.update(match.groupdict())
                      break
  
      encode_value(bug, 'bug_line', int)
      encode_value(bug, 'bug_path_length', int)
  
      yield bug
function_tokens: def parse_bug_html ( filename ) : patterns = [ re . compile ( r'<!-- BUGTYPE (?P<bug_type>.*) -->$' ) , re . compile ( r'<!-- BUGFILE (?P<bug_file>.*) -->$' ) , re . compile ( r'<!-- BUGPATHLENGTH (?P<bug_path_length>.*) -->$' ) , re . compile ( r'<!-- BUGLINE (?P<bug_line>.*) -->$' ) , re . compile ( r'<!-- BUGCATEGORY (?P<bug_category>.*) -->$' ) , re . compile ( r'<!-- BUGDESC (?P<bug_description>.*) -->$' ) , re . compile ( r'<!-- FUNCTIONNAME (?P<bug_function>.*) -->$' ) ] endsign = re . compile ( r'<!-- BUGMETAEND -->' ) bug = { 'report_file' : filename , 'bug_function' : 'n/a' , # compatibility with < clang-3.5 'bug_category' : 'Other' , 'bug_line' : 0 , 'bug_path_length' : 1 } with open ( filename , encoding = 'utf-8' ) as handler : for line in handler . readlines ( ) : # do not read the file further if endsign . match ( line ) : break # search for the right lines for regex in patterns : match = regex . match ( line . strip ( ) ) if match : bug . update ( match . groupdict ( ) ) break encode_value ( bug , 'bug_line' , int ) encode_value ( bug , 'bug_path_length' , int ) yield bug