Closed digama0 closed 2 years ago
Excellent!
I was rather assuming parsing comments would be done outside the library, and had been parsing those in metamath-web
using regular expressions, but this works very well too.
There is a bunch of careful ordering to get right with comment markup (like how some markup works in some nested contexts but not others), so I thought it important to have a dedicated parser to make it easier to get right.
In order to avoid too many dependent PRs piling up, since the review seems more or less finished, I'm going to merge this now and we can make edits later if necessary.
Sure! Maybe I'll try to make a PR with the API I think would be better (i.e. one without referencing the segments and their buffers directly).
This lets us parse metamath's pseudo-markdown syntax in comments: