fparser.common.sourceinfo
Provides functions to determine whether a piece of Fortran source is free or fixed format. It also tries to differentiate between strict and “pyf” although I’m not sure what that is.
Attributes
Classes
Describes the nature of a piece of Fortran source. |
Functions
|
Determines the format of Fortran source held in a string. |
|
Determines the format of Fortran source held in a file. |
Module Contents
- class fparser.common.sourceinfo.FortranFormat(is_free, is_strict, enable_f2py=False)[source]
Describes the nature of a piece of Fortran source.
Source can be fixed or free format. It can also be “strict” or “not strict” although it’s not entirely clear what that means. It may refer to the strictness of adherance to fixed format although what that means in the context of free format I don’t know.
- Parameters:
- classmethod from_mode(mode)[source]
Constructs a FortranFormat object from a mode string.
- Arguments:
mode - (String) One of ‘free’, ‘fix’, ‘f77’ or ‘pyf’
- fparser.common.sourceinfo.get_source_info_str(source, ignore_encoding=True)[source]
Determines the format of Fortran source held in a string.
- Parameters:
ignore_encoding (bool) – whether or not to ignore any Python-style encoding information in the first line of the file.
- Returns:
a FortranFormat object.
- Return type: