parameters: (self, c_file)
return_statement: return code_lines
docstring: Parse a C file and extract all source file lines that generated executable code.
docstring_summary: Parse a C file and extract all source file lines that generated executable code.
docstring_tokens: Parse a C file and extract all source file lines that generated executable code .
function: def _parse_cfile_lines(self, c_file):
          """
          Parse a C file and extract all source file lines that generated executable code.
          """
          match_source_path_line = re.compile(r' */[*] +"(.*)":([0-9]+)$').match
          match_current_code_line = re.compile(r' *[*] (.*) # <<<<<<+$').match
          match_comment_end = re.compile(r' *[*]/$').match
          match_trace_line = re.compile(r' *__Pyx_TraceLine\(([0-9]+),').match
          not_executable = re.compile(
              r'\s*c(?:type)?def\s+'
              r'(?:(?:public|external)\s+)?'
              r'(?:struct|union|enum|class)'
              r'(\s+[^:]+|)\s*:'
          ).match
  
          code_lines = defaultdict(dict)
          executable_lines = defaultdict(set)
          current_filename = None
  
          with OpenFile(c_file) as lines:
              lines = iter(lines)
              for line in lines:
                  match = match_source_path_line(line)
                  if not match:
                      if '__Pyx_TraceLine(' in line and current_filename is not None:
                          trace_line = match_trace_line(line)
                          if trace_line:
                              executable_lines[current_filename].add(int(trace_line.group(1)))
                      continue
                  filename, lineno = match.groups()
                  current_filename = filename
                  lineno = int(lineno)
                  for comment_line in lines:
                      match = match_current_code_line(comment_line)
                      if match:
                          code_line = match.group(1).rstrip()
                          if not_executable(code_line):
                              break
                          code_lines[filename][lineno] = code_line
                          break
                      elif match_comment_end(comment_line):
                          # unexpected comment format - false positive?
                          break
  
          # Remove lines that generated code but are not traceable.
          for filename, lines in code_lines.items():
              dead_lines = set(lines).difference(executable_lines.get(filename, ()))
              for lineno in dead_lines:
                  del lines[lineno]
          return code_lines
function_tokens: def _parse_cfile_lines ( self , c_file ) : match_source_path_line = re . compile ( r' */[*] +"(.*)":([0-9]+)$' ) . match match_current_code_line = re . compile ( r' *[*] (.*) # <<<<<<+$' ) . match match_comment_end = re . compile ( r' *[*]/$' ) . match match_trace_line = re . compile ( r' *__Pyx_TraceLine\(([0-9]+),' ) . match not_executable = re . compile ( r'\s*c(?:type)?def\s+' r'(?:(?:public|external)\s+)?' r'(?:struct|union|enum|class)' r'(\s+[^:]+|)\s*:' ) . match code_lines = defaultdict ( dict ) executable_lines = defaultdict ( set ) current_filename = None with OpenFile ( c_file ) as lines : lines = iter ( lines ) for line in lines : match = match_source_path_line ( line ) if not match : if '__Pyx_TraceLine(' in line and current_filename is not None : trace_line = match_trace_line ( line ) if trace_line : executable_lines [ current_filename ] . add ( int ( trace_line . group ( 1 ) ) ) continue filename , lineno = match . groups ( ) current_filename = filename lineno = int ( lineno ) for comment_line in lines : match = match_current_code_line ( comment_line ) if match : code_line = match . group ( 1 ) . rstrip ( ) if not_executable ( code_line ) : break code_lines [ filename ] [ lineno ] = code_line break elif match_comment_end ( comment_line ) : # unexpected comment format - false positive? break # Remove lines that generated code but are not traceable. for filename , lines in code_lines . items ( ) : dead_lines = set ( lines ) . difference ( executable_lines . get ( filename , ( ) ) ) for lineno in dead_lines : del lines [ lineno ] return code_lines