Skip to content

MojoLexer's analyse_text should not have higher priority for "import " than PythonLexer #2771

@dlazin

Description

@dlazin

The analyse_text method for MojoLexer in https://github.com/pygments/pygments/blob/master/pygments/lexers/mojo.py#L701 is a near-copy of that from PythonLexer in https://github.com/pygments/pygments/blob/master/pygments/lexers/python.py#L408.

A code sample that contains import foo thus evaluates as Mojo rather than Python. Python is more likely, so Mojo should have a lower priority.

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