parameters: (stream)
docstring: Parse clang -analyzer-checker-help output.
  
      Below the line 'CHECKERS:' are there the name description pairs.
      Many of them are in one line, but some long named checker has the
      name and the description in separate lines.
  
      The checker name is always prefixed with two space character. The
      name contains no whitespaces. Then followed by newline (if it's
      too long) or other space characters comes the description of the
      checker. The description ends with a newline character.
  
      :param stream:  list of lines to parse
      :return:        generator of tuples
  
      (<checker name>, <checker description>)
docstring_summary: Parse clang -analyzer-checker-help output.
docstring_tokens: Parse clang - analyzer - checker - help output .
function: def parse_checkers(stream):
      """ Parse clang -analyzer-checker-help output.
  
      Below the line 'CHECKERS:' are there the name description pairs.
      Many of them are in one line, but some long named checker has the
      name and the description in separate lines.
  
      The checker name is always prefixed with two space character. The
      name contains no whitespaces. Then followed by newline (if it's
      too long) or other space characters comes the description of the
      checker. The description ends with a newline character.
  
      :param stream:  list of lines to parse
      :return:        generator of tuples
  
      (<checker name>, <checker description>) """
  
      lines = iter(stream)
      # find checkers header
      for line in lines:
          if re.match(r'^CHECKERS:', line):
              break
      # find entries
      state = None
      for line in lines:
          if state and not re.match(r'^\s\s\S', line):
              yield (state, line.strip())
              state = None
          elif re.match(r'^\s\s\S+$', line.rstrip()):
              state = line.strip()
          else:
              pattern = re.compile(r'^\s\s(?P<key>\S*)\s*(?P<value>.*)')
              match = pattern.match(line.rstrip())
              if match:
                  current = match.groupdict()
                  yield (current['key'], current['value'])
function_tokens: def parse_checkers ( stream ) : lines = iter ( stream ) # find checkers header for line in lines : if re . match ( r'^CHECKERS:' , line ) : break # find entries state = None for line in lines : if state and not re . match ( r'^\s\s\S' , line ) : yield ( state , line . strip ( ) ) state = None elif re . match ( r'^\s\s\S+$' , line . rstrip ( ) ) : state = line . strip ( ) else : pattern = re . compile ( r'^\s\s(?P<key>\S*)\s*(?P<value>.*)' ) match = pattern . match ( line . rstrip ( ) ) if match : current = match . groupdict ( ) yield ( current [ 'key' ] , current [ 'value' ] )