lezer-parser / lezer

Dev utils and issues for the Lezer core packages
33 stars 1 forks source link

Extending a predefined grammar. #4

Open s0kil opened 3 years ago

s0kil commented 3 years ago

Is it possible to extend a predefined such as the html grammar?

I'm trying to parse this:

fun render : Html {
  <div>
    <{ "Hello" }>
  </div>
}

The function allows html inside the block, and inside the html, it also allows <{ getSomeText() }> referencing language specific variables, literals, etc. Could you point me towards parsing the <{ }> part?

marijnh commented 3 years ago

This isn't possible yet. I do have plans to add support for this but there's no concrete timeline.