highlights: create subscoping for ternary operator

After https://github.com/nvim-treesitter/nvim-treesitter/issues/470,
we decided to use `@conditional` for ternary operator instead of
operator despite `@conditional` is documented for keywords only.
A sub-scoping can make it easier for people to highlight this operator
group differently.

Also unify the usage of `@conditional...` across languages.
This commit is contained in:
Stephan Seitz 2022-12-02 20:22:58 +01:00
parent 74c46c8917
commit d6a2ecb8b7
13 changed files with 20 additions and 13 deletions

View file

@ -146,6 +146,7 @@ effect on highlighting. We will work on improving highlighting in the near futur
@keyword.return ; keywords like `return` and `yield`
@conditional ; keywords related to conditionals (e.g. `if` / `else`)
@conditional.ternary ; Ternary operator: condition ? 1 : 2
@repeat ; keywords related to loops (e.g. `for` / `while`)
@debug ; keywords related to debugging
@label ; GOTO and other labels (e.g. `label:` in C)