mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
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:
parent
74c46c8917
commit
d6a2ecb8b7
13 changed files with 20 additions and 13 deletions
|
|
@ -13,6 +13,10 @@
|
|||
|
||||
; Keywords that mark conditional statements
|
||||
[ "if" "elsif" "unless" "else" ] @conditional
|
||||
(ternary_expression
|
||||
["?" ":"] @conditional.ternary)
|
||||
(ternary_expression_in_hash
|
||||
["?" ":"] @conditional.ternary)
|
||||
|
||||
; Keywords that mark repeating loops
|
||||
[ "while" "until" "for" "foreach" ] @repeat
|
||||
|
|
@ -142,8 +146,6 @@
|
|||
(to_reference)
|
||||
(type_glob)
|
||||
(hash_access_variable)
|
||||
(ternary_expression)
|
||||
(ternary_expression_in_hash)
|
||||
] @operator
|
||||
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue