romshark / llparser

A universal LL top-down parser written in Go
BSD 3-Clause "New" or "Revised" License
45 stars 1 forks source link

[FTR] Pattern "Repeated" #10

Closed romshark closed 4 years ago

romshark commented 4 years ago

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:

Repeated {
  Min:     1,
  Max:     10,
  Pattern: Exact{Expectation: []rune(".")}
}

This pattern should replace ZeroOrMore and OneOrMore.