Skip to content

Recognize cases where rascal is greedy instead of non-greedy #11

@DavyLandman

Description

@DavyLandman

I see a pattern where rascal's greedy matches (a+ !>> a) are mapped to non greedy regexes with a follow guard. a+? (?!a).

We could optimize this as: a+ in regex.

Some heuristics on when A+ or A* is greedy:

  • it's followed by a non optional literal that does not match A. example: [0-9]+ "e"
  • it has a a follow restriction with same chars as itself: example: [0-9]+ !>> [0-9]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions