parameters: (file)
return_statement: return result
docstring: Check if file is in free format Fortran.
docstring_summary: Check if file is in free format Fortran.
docstring_tokens: Check if file is in free format Fortran .
function: def is_free_format(file):
      """Check if file is in free format Fortran."""
      # f90 allows both fixed and free format, assuming fixed unless
      # signs of free format are detected.
      result = 0
      f = open(file,'r')
      line = f.readline()
      n = 15 # the number of non-comment lines to scan for hints
      if _has_f_header(line):
          n = 0
      elif _has_f90_header(line):
          n = 0
          result = 1
      while n>0 and line:
          if line[0]!='!' and line.strip():
              n -= 1
              if (line[0]!='\t' and _free_f90_start(line[:5])) or line[-2:-1]=='&':
                  result = 1
                  break
          line = f.readline()
      f.close()
      return result
function_tokens: def is_free_format ( file ) : # f90 allows both fixed and free format, assuming fixed unless # signs of free format are detected. result = 0 f = open ( file , 'r' ) line = f . readline ( ) n = 15 # the number of non-comment lines to scan for hints if _has_f_header ( line ) : n = 0 elif _has_f90_header ( line ) : n = 0 result = 1 while n > 0 and line : if line [ 0 ] != '!' and line . strip ( ) : n -= 1 if ( line [ 0 ] != '\t' and _free_f90_start ( line [ : 5 ] ) ) or line [ - 2 : - 1 ] == '&' : result = 1 break line = f . readline ( ) f . close ( ) return result