Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 769 Bytes

File metadata and controls

21 lines (14 loc) · 769 Bytes

Writing a parser

Today I learned the basics of how to write a parser:

I don’t yet get all the patterns and the code seems a bit clunky. The error reporting is all over the place, too. But the test cases pass 😂

Emitting the garbage separately

I got this idea from here:

Somehow I like the concept that the parser only returns groups, and they are not tainted with garbage. If I want to know about the garbage, I need to provide a separate observer during the parsing process.