Closed romshark closed 4 years ago
Introduce a new pattern Repeated to allow grammars to specify a repetitive sequence of a particular pattern with a minimum and a maximum number of repetitions:
Repeated
Repeated { Min: 1, Max: 10, Pattern: Exact{Expectation: []rune(".")} }
Max: 1
Min > Max
Max: 0
This pattern should replace ZeroOrMore and OneOrMore.
ZeroOrMore
OneOrMore
Proposal
Introduce a new pattern
Repeated
to allow grammars to specify a repetitive sequence of a particular pattern with a minimum and a maximum number of repetitions:Max: 1
andMax: 1
should be considered illegal.Min > Max
should also be considered illegal.Max: 0
should be equal to unlimited.This pattern should replace
ZeroOrMore
andOneOrMore
.