Closed retorquere closed 4 years ago
Just a heads-up -- I've made further changes to the grammar because to get verbatim parsing and proper argument consumption right. Some of these changes I figure may not align with how you want to approach things -- for one, my grammar needs to know a lot more about what it's parsing. Some of this could in principle be post-cleaned on a simpler AST (as was produced by the last changes I offered for astrocite) but it was just easier to do inside the grammar. I do think that the current grammar coupled with my post processing is currently best in class outside actually running it through a latex stack. Notable changes in behavior:
\url
would consume all NestedLiterals that followed it. It now consumes exactly one.\frac 1 2
now works (I know, ugly, but actually used)<
has a different meaning depending on whether it's in text mode or math mode, which is now handledurl
and href
parse their arguments in verbatim modeThe changed grammar lives here, and the postprocessor here.
I wouldn't half mind if I could just maintain the bibtex parser in that repo, and have astrocite consume either just the grammar or the grammar + postprocessor. I have a pretty extensive testsuite so I have a vested interest in keeping my parser stable yet updated for new bug reports I get.
master
branchnpm test
locally