3 ms·
Awesome, thanks! It's the first time I've seen example PEGs explained so nicely. I've let myself add a few small comments with some additional suggestions. Som
by akavel 10y ago
Awesome, thanks! It's the first time I've seen example PEGs explained so nicely. I've let myself add a few small comments with some additional suggestions.
Some additional comments I didn't know how to add on github:
- in load_data(), you should most probably use `local` on l.99 and 103;
- in load_data() l.99, you could consider using the idiom:
local f = assert(io.open(file, "rb"))
though arguably it's clearer as it is now.
Other than that, it would be even cooler if you could also add some examples in the repo of how to deal with parsing errors, as you showed in another comment!
- sebcat 10y agoThank you for the feedback. The commented_expressions branch looks a lot better than master now, I'll probably merge it. I added the code from the comment to README.md.