I have created a markup language for which I have a fully working parser and printer. The language includes notation that leverages indentation, and it is designed to never fail parsing, it will just interpret the input as text in that case. The parser and printer now fully implement the semantics I had in mind, however I want to have editor support for when I use the language in CodeMirror, ProseMirror and VSCode, for which I want to support incremental parsing too. That is when I stumbled upon Lezer, which seems to be a great fit in terms of features.
Unfortunately the markup language semantics are not expressible in Lezer’s grammar as far as I am aware: indentation could be externalized like your Python grammar, but the recovery strategy does not match the semantics of the language. Given that Lezer is able to parse Markdown by skipping the standard grammar runtime, then surely my simpler language should be supported too.
Given that the only feature to really drop my parser and rewrite it in Lezer is the incremental parsing and that I only have the Markdown parser source code to base it on, would you suggest me doing this, or might I just as well try to implement my own incremental parsing?
I ask this because it seems this would require me to get in depth knowledge about the internals of Lezer (i.e. high learning curve) and I saw some comments in the Markdown parser about having to improve incremental parsing at some of its indentation state. And given my parser too has some state, I wonder how well incremental parsing would actually preform for my language, or whether I would be better of trying to add my own simplified incremental parsing that leverages my knowledge of the language semantics.