aboutsummaryrefslogtreecommitdiffstats
path: root/queries/perl
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-12-02 20:22:58 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-12-02 21:42:11 +0100
commitd6a2ecb8b7093d6f6673cb6748bce9214a5099d3 (patch)
tree787aaf8f5e4b9079bacbdac6e0e8bcb935d5b199 /queries/perl
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar.gz
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar.bz2
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar.lz
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar.xz
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.tar.zst
nvim-treesitter-d6a2ecb8b7093d6f6673cb6748bce9214a5099d3.zip
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.
Diffstat (limited to 'queries/perl')
-rw-r--r--queries/perl/highlights.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/queries/perl/highlights.scm b/queries/perl/highlights.scm
index 56ed3ee8a..c6b2c4ee4 100644
--- a/queries/perl/highlights.scm
+++ b/queries/perl/highlights.scm
@@ -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
[