Skip to content

Add f90 alias to the Fortran lexer #2000

@minyez

Description

@minyez

Hi there,

I use pygments through the minted package to highlight source code in LaTeX, thank you very much for the project!
I am wonrdering if "f90" can be added as an alias to the Fortran lexer FortranLexer.

class FortranLexer(RegexLexer):
"""
Lexer for FORTRAN 90 code.
.. versionadded:: 0.10
"""
name = 'Fortran'
aliases = ['fortran']
filenames = ['*.f03', '*.f90', '*.F03', '*.F90']

This request comes from my export of Emacs org-mode source code block to LaTeX minted environment.
In org-mode, the Fortran 90 or free-format Fortran source code block is specified by "f90", which is distinguished from "fortran" for the fixed format. Exporting to tex file and compiling will through out "Error: no lexer for alias 'f90' found".

In my opinion, it would not hurt to add "f90" as an alias for the free-format lexer since Fortran 90 is almost a synonym of free-format Fortran. In fact, I notice that the docstring says that it is for the "Fortran 90 code", so I tend to think "f90" is a straightforward alias.

Regards,
Minye

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions