elm / parser

A parsing library, focused on simplicity and great error messages
https://package.elm-lang.org/packages/elm/parser/latest
BSD 3-Clause "New" or "Revised" License
230 stars 46 forks source link

Add dead end clarification to chompIf doc #19

Open neurodynamic opened 6 years ago

neurodynamic commented 6 years ago

Just a suggestion here. I think because of how "if" and "while" usually work in programming languages, I assumed chompIf was like a "parse one or move on" rather than a "parse one or dead end"-type thing, and spent a bit trying to figure out how to do a chompOne function before realizing my mistake. I figure this might prevent others from possibly making the same error.

For me, at least, I think chompOne might be a clearer name, even though I can totally see how chompIf makes sense.