parameters: (cmakefile)
return_statement: return perlasms
docstring: Parses the contents of the CMakeLists.txt file passed as an argument and
    returns a list of all the perlasm() directives found in the file.
docstring_summary: Parses the contents of the CMakeLists.txt file passed as an argument and
    returns a list of all the perlasm() directives found in the file.
docstring_tokens: Parses the contents of the CMakeLists . txt file passed as an argument and returns a list of all the perlasm () directives found in the file .
function: def ExtractPerlAsmFromCMakeFile(cmakefile):
    """Parses the contents of the CMakeLists.txt file passed as an argument and
    returns a list of all the perlasm() directives found in the file."""
    perlasms = []
    with open(cmakefile) as f:
      for line in f:
        line = line.strip()
        if not line.startswith('perlasm('):
          continue
        if not line.endswith(')'):
          raise ValueError('Bad perlasm line in %s' % cmakefile)
        # Remove "perlasm(" from start and ")" from end
        params = line[8:-1].split()
        if len(params) < 2:
          raise ValueError('Bad perlasm line in %s' % cmakefile)
        perlasms.append({
            'extra_args': params[2:],
            'input': os.path.join(os.path.dirname(cmakefile), params[1]),
            'output': os.path.join(os.path.dirname(cmakefile), params[0]),
        })
  
    return perlasms
function_tokens: def ExtractPerlAsmFromCMakeFile ( cmakefile ) : perlasms = [ ] with open ( cmakefile ) as f : for line in f : line = line . strip ( ) if not line . startswith ( 'perlasm(' ) : continue if not line . endswith ( ')' ) : raise ValueError ( 'Bad perlasm line in %s' % cmakefile ) # Remove "perlasm(" from start and ")" from end params = line [ 8 : - 1 ] . split ( ) if len ( params ) < 2 : raise ValueError ( 'Bad perlasm line in %s' % cmakefile ) perlasms . append ( { 'extra_args' : params [ 2 : ] , 'input' : os . path . join ( os . path . dirname ( cmakefile ) , params [ 1 ] ) , 'output' : os . path . join ( os . path . dirname ( cmakefile ) , params [ 0 ] ) , } ) return perlasms