pest icon indicating copy to clipboard operation
pest copied to clipboard

[Suggestion] Make PrecClimber::climb panic if it can't find an operator

Open Technohacker opened this issue 2 years ago • 0 comments

While building the expression parser for my grammar, I was stumped on why the climber didn't progress beyond one expression sub-unit. Turns out I had forgot to make my operator catch-all rule silent, which caused the climber to break out on this line

Making this either an explicit panic (for a static operator set) or an Error return (for a dynamic operator set) may make more sense in alerting to a bad grammar, since it's unexpected for the parser to ask for an operator beyond those provided to the climber

This may be a breaking change since the climber is part of the public API

Technohacker avatar Dec 12 '21 17:12 Technohacker