Skip to content

Regex features missing readable version #127

@matter123

Description

@matter123

Because of the maximal munch rule lex.pptoken/3.3 The grammar needs a way to mark quantifiers as possessive or lazy.

I had some thoughts for what the call would look like

possessive(oneOrMoreOf(/foo/))
oneOrMoreOf(/foo/).posessive()
oneOrMoreOf(match: /foo/, type: :posessive)
oneOrMoreOfPosessive(/foo/)

Advantages:
1 & 2. minimizes code repetition
3. one of the cleanest looking
4. matches the pattern established by lookarounds

Disadvantages:
1 & 2. requires unwrapping the non-capturing group
2. confusing that .posessive() applies to the preceding element
3. requires specifying match: unlinks the fact that possessive applies to the match not the pattern
4. create a total of 9 functions for qualifiers

@jeff-hykin thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ContributorIssues that users probably don't care about

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions