Skip to content

Elpi lexer has pathological backtracking #2053

@kurtmckee

Description

@kurtmckee

The Elpi lexer has pathological backtracking that can be triggered with the following minimal input:

from pygments.lexers.elpi import ElpiLexer

list(ElpiLexer().get_tokens("a" * 30))

Only lowercase characters trigger pathological backtracking. Uppercase characters and digits will not.

The culprit is at line 62.

@gares I'm not familiar with Elpi, so if you can jump in to address this, great! Otherwise I'll be able to take a crack at it after this weekend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-majorseverity: majorT-bugtype: a bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions