-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I think it should be possible to generate a textual description of each parser. This will help when debugging, since you can print the description together with an error, and it can also be used to pretty print the parsers and generally understanding what’s happening in a complex program.
I was planning on doing this using emojis like in the README. I think they do a good job of separating different parts of the description visually.
The 🍕 emoji would indicate a building block parser (I think it’s a cute joke, and I couldn’t find anything better), and ⚙️ might indicate combinators. Then an arrow ➜ could be used to further separate combinator inputs.
The idea is not to have a parseable format, just a way of pretty printing. So humans should be able to figure it out, but it can be a little ambiguous.
I wasn’t able to develop the format fully and I don’t know how it will look for complex parsers.
In fact, ideally, there should be several formats.
A full format which prints the whole structure of the parser.
A concise single-like format.
This came up in the discussion in #64 (comment)