Highlight nonterminals

Is it possible to highlight nonterminals? Highlight is working for terminals only…

I’m writing a language pack for spreadsheet functions. The parser is working and finds the nodes correctly.

But at the time of highlighting the tags, only terminals work…

The code snip of the grammar:

ReferenceItem { 
  CellToken 
  | NameToken 
  | VerticalRangeToken 
  | HorizontalRangeToken
  | RefErrorToken
}

@tokens {
  column { $[$]? @asciiLetter @asciiLetter? @asciiLetter? }
  row { $[$]? @digit+ }
  CellToken { column row }
}

The code snip of the parser:

styleTags({
                ReferenceItem: tags.tagName, --> does not work
                //CellToken: tags.tagName, --> it works
            })

Am I missing something?

Highlighting doesn’t distinguish between the two, but when multiple nodes covering a given piece of code define highlighting styles, the innermost takes precedence. Using the /... syntax, you can define styles that should be added to all content in a node, even that which defines its own styling.

Excellent, it worked!

It’s well documented, my fault for not paying attention. Thank you