ggrossetie / asciidoctor-inline-parser

15 stars 4 forks source link

Eliminate runtime dependency on treetop (and polyglot) #7

Open mojavelinux opened 6 years ago

mojavelinux commented 6 years ago

We need to figure out a way to avoid the runtime dependency on treetop. We definitely want to use treetop to generate the grammar parser, but after that treetop should move out of the way.

This may require adding stubs for the types the parser relies on at runtime, or we can simply import those types into the project to avoid the runtime dependency.

What we definitely want to avoid is using the runtime generator. It's possible to compile the grammar statically. This eliminates the dependency on polyglot. See Asciidoctor PDF for an example.

ggrossetie commented 6 years ago

I've removed polyglot in https://github.com/Mogztter/asciidoctor-inline-parser/pull/1/files and I think we are "just" using https://github.com/nathansobo/treetop/blob/master/lib/treetop/runtime/syntax_node.rb from the Treetop at runtime.

mojavelinux commented 6 years ago

:pray: hopefully stubbing in will be that easy.

mojavelinux commented 6 years ago

I don't think we need to worry about this just yet. It's just something we'll need to complete before folding the parser into core. But it doesn't hurt to do some experimentation while working on the parser to understand what it's going to take. (It might also make a good article one day).