kschiess / parslet

A small PEG based parser library. See the Hacking page in the Wiki as well.
kschiess.github.com/parslet
MIT License
805 stars 95 forks source link

Add the ability to ignore a parse result #157

Closed chrismwendt closed 8 years ago

chrismwendt commented 8 years ago

This adds the ability to ignore a parse result to the core DSL. It's useful for ignoring the \ which precedes escaped characters in string literals (e.g. "Kevin \"PPMD\" Nanney") by obviating the need for a post-processing step that strips the \s out of the strings.

This essentially achieves the same result #61, but the approach follows example/ignore.rb and the suggestion by @kschiess of making ignore part of the DSL.

kschiess commented 8 years ago

Apart from the one small comment, this looks good to me. I'll worry about updating the website past merge. Can you fix the one line and give me a ping? We'll release this just after the merge.

Good PR, Thank you!

chrismwendt commented 8 years ago

@kschiess: I fixed the cascading ? issue. Thanks for the review :smiley: