-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
ContributorIssues that users probably don't care aboutIssues that users probably don't care about
Description
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
Labels
ContributorIssues that users probably don't care aboutIssues that users probably don't care about