Skip to content

Support legacy mode constructs but in free form lexing (Fortran 90) #307

Open
@dorchard

Description

@dorchard

Currently Fortran 77 supports 'extended' and 'legacy' mode, which mostly effects lexing, see e.g.,: https://github.com/camfort/fortran-src/blob/main/src/Language/Fortran/Parser/Fixed/Lexer.x#L467-L471

However, for users who want to handle such constructs, but in free form lexing (i.e., Fortran 90) there is currently no support.

We want to extend free form lexing mode to support legacy extensions. This would likely require modifying the free form lexer along the lines of what is supported in the fixed form. This probably needs to adds parsers to https://github.com/camfort/fortran-src/blob/main/src/Language/Fortran/Parser.hs

This would be essentially a 'Fortran 90 legacy' mode (free form), e.g., adding f90lStmtNoTransform, etc. for each existing f90* parsing form. We should also extend then the FortranVersion (https://github.com/camfort/fortran-src/blob/main/src/Language/Fortran/Version.hs#L22-L30) to have Fortran90Legacy.

We can use tests like this: https://github.com/camfort/fortran-src/blob/main/test/Language/Fortran/Parser/Fixed/Fortran77/ParserSpec.hs#L246-L267 but transferred to Fortran 90 (legacy)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions