Closed nrinaudo closed 8 years ago
This should be really easy to add to https://github.com/lihaoyi/fastparse/blob/master/fastparse/shared/src/main/scala/fastparse/parsers/Combinators.scala#L333-L358 if anyone wants to pick this up. We even already keep count of how many iterations we've had, so it's a simple matter of bailing out early if we hit the target
It's currently possible to specify a minimum number of repetitions for repeated sequences. It'd be great to also have a maximum number of repetitions.
My use case is parsing HTTP grammar, where for example language tags are defined as:
I haven't yet found a sane way to express that with fastparse, but maybe I'm missing something?