dlvandenberg / tree-sitter-angular

Tree Sitter Grammar for Angular
MIT License
34 stars 9 forks source link

Alternative way of handling precedence #5

Closed dlvandenberg closed 1 month ago

dlvandenberg commented 8 months ago

Currently the only way to get the parser work with the following Angular syntax:

@if (someCondition) {
  <an-element/>
} @else {
  <some-other-element/>
}

is to use token(prec(2, '} @')) in my grammar. This means that in order to highlight the brackets correctly in e.g. nvim-treesitter, I have to apply the highlight group to "} @" (as it is a token).

There should be a better way of handling this.