jgm/peg-markdown

Formal Grammar Discussion

Opened this issue · 2 comments

Hello JGM,

I have been learning about formal grammars (PEG and friends), and have been diving more deeply into them. I want to tackle the problem of PEG grammars for common file specifications, like CommonMark (hard), JSON (easy), XML (easy), etc., and wanted to ask about your two implementations here and in lunamark.

I see in https://talk.commonmark.org/t/commonmark-formal-grammar/46/32, you are unhappy with either of these grammars, and I was wondering if you could point me to why/where are the 'rough edges'. I know it's been a while since you've tackled the subject, but maybe you can point me in the right directions / provide background on what was particularly hard. Feel free to resurrect this if it's like 17 years from now you see the issue.

Note: I have used your Lunamark implementation and adapted it to pure Lua 5.X, but to unsatisfactory results due to the lulpeg replacement, no big deal there, just learning for now.

jgm commented

I'm sorry, it has been so long that I honestly don't remember!

No worries, I'll share back if I ever make a great commonMark PEG parser