aboutsummaryrefslogtreecommitdiffstats
path: root/queries/perl
diff options
context:
space:
mode:
authordelphinus <me@delphinus.dev>2021-08-28 17:16:35 +0900
committerStephan Seitz <stephan.seitz@fau.de>2021-09-21 01:08:32 +0200
commitae9a9d60f155beca8580acf5b52b9da8f428356a (patch)
tree2cc38231661cb881e97fa5c4fe5e522cb6de23f0 /queries/perl
parentSwapping to the correct repo (diff)
downloadnvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar.gz
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar.bz2
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar.lz
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar.xz
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.tar.zst
nvim-treesitter-ae9a9d60f155beca8580acf5b52b9da8f428356a.zip
Add minimum implementation for highlights
Diffstat (limited to 'queries/perl')
-rw-r--r--queries/perl/highlights.scm169
1 files changed, 169 insertions, 0 deletions
diff --git a/queries/perl/highlights.scm b/queries/perl/highlights.scm
new file mode 100644
index 000000000..11eff3aee
--- /dev/null
+++ b/queries/perl/highlights.scm
@@ -0,0 +1,169 @@
+; Variables
+(variable_declaration
+ .
+ (scope) @keyword)
+[
+(single_var_declaration)
+(scalar_variable)
+(array_variable)
+(hash_variable)
+(hash_variable)
+] @variable
+
+
+[
+(package_name)
+(special_variable)
+(special_literal)
+(super)
+] @constant
+
+(
+ [
+ (package_name)
+ (super)
+ ]
+ .
+ ("::" @constant)
+)
+
+(comments) @comment
+(pod_statement) @comment
+
+[
+(use_no_statement)
+(use_no_feature_statement)
+(use_no_if_statement)
+(use_no_version)
+(use_constant_statement)
+(use_parent_statement)
+] @include
+
+(use_constant_statement
+ constant: (identifier) @constant)
+
+[
+"require"
+] @include
+
+(method_invocation
+ .
+ (identifier) @variable)
+
+(method_invocation
+ (arrow_operator)
+ .
+ (identifier) @function)
+(method_invocation
+ function_name: (identifier) @function)
+(named_block_statement
+ function_name: (identifier) @function)
+
+(call_expression
+ function_name: (identifier) @function)
+(function_definition
+ name: (identifier) @function)
+[
+(function)
+(map)
+(grep)
+(bless)
+] @function
+
+[
+"return"
+"sub"
+"package"
+"BEGIN"
+"END"
+] @keyword.function
+
+[
+"("
+")"
+"["
+"]"
+"{"
+"}"
+] @punctuation.bracket
+(standard_input_to_variable) @punctuation.bracket
+
+[
+"=~"
+"or"
+"="
+"=="
+"+"
+"-"
+"."
+"//"
+"||"
+(arrow_operator)
+(hash_arrow_operator)
+(array_dereference)
+(hash_dereference)
+(to_reference)
+(type_glob)
+(hash_access_variable)
+(ternary_expression)
+(ternary_expression_in_hash)
+] @operator
+
+[
+(regex_option)
+(regex_option_for_substitution)
+(regex_option_for_transliteration)
+] @parameter
+
+(type_glob
+ (identifier) @variable)
+(
+ (scalar_variable)
+ .
+ ("->" @operator))
+
+[
+(word_list_qw)
+(command_qx_quoted)
+(string_single_quoted)
+(string_double_quoted)
+(string_qq_quoted)
+(bareword)
+(regex_pattern_qr)
+(patter_matcher_m)
+(substitution_pattern_s)
+(transliteration_tr_or_y)
+] @string
+
+(escape_sequence) @string.escape
+
+[
+","
+(semi_colon)
+(start_delimiter)
+(end_delimiter)
+(ellipsis_statement)
+] @punctuation.delimiter
+
+[
+(integer)
+(floating_point)
+(scientific_notation)
+(hexadecimal)
+] @number
+
+[
+(if_statement)
+(unless_statement)
+(if_simple_statement)
+(unless_simple_statement)
+] @conditional
+
+(foreach_statement) @repeat
+(foreach_statement
+ .
+ (scope) @keyword)
+
+(function_attribute) @field
+
+(function_signature) @type