summaryrefslogtreecommitdiff
path: root/runtime/queries/perl/highlights.scm
blob: 961ff5ea399cb1e73f154592e3f6f85430290701 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[
  "use" "no" "require" "package"
] @keyword.control.import

[
  "sub"
] @keyword.function

[
  "if" "elsif" "else" "unless"
] @keyword.control.conditional

[
  "while" "until"
  "for" "foreach"
  "do"
] @keyword.control.repeat

[
  "my" "our" "local"
] @keyword.storage.modifier

[
  "last" "next" "redo" "goto" "return"
] @keyword.control.return

[
  "undef"
] @constant.builtin

(phaser_statement phase: _ @keyword.directive)

[
  "or" "and"
  "eq" "ne" "cmp" "lt" "le" "ge" "gt"
  "isa"
] @keyword.operator

(comment) @comment

(eof_marker) @keyword.directive
(data_section) @comment

(pod) @comment.block.documentation

(number) @constant.numeric
(version) @constant

(string_literal) @string
(interpolated_string_literal) @string
(quoted_word_list) @string
(command_string) @string
[(heredoc_token) (command_heredoc_token)] @string.special
(heredoc_content) @string
(heredoc_end) @string.special
[(escape_sequence) (escaped_delimiter)] @constant.character.escape

[(quoted_regexp) (match_regexp)] @string.regexp

(autoquoted_bareword _?) @string.special

[(scalar) (arraylen)] @variable
(scalar_deref_expression ["->" "$" "*"] @variable)
(array) @variable
(array_deref_expression ["->" "@" "*"] @variable)
(hash) @variable
(hash_deref_expression ["->" "%" "*"] @variable)

(array_element_expression [array:(_) "->" "[" "]"] @variable)
(slice_expression [array:(_) "->" "[" "]"] @variable)
(keyval_expression [array:(_) "->" "[" "]"] @variable)

(hash_element_expression [hash:(_) "->" "{" "}"] @variable)
(slice_expression [hash:(_) "->" "[" "]"] @variable)
(keyval_expression [hash:(_) "->" "[" "]"] @variable)

(hash_element_expression key: (bareword) @string.special)

(use_statement (package) @type)
(package_statement (package) @type)
(require_expression (bareword) @type)

(subroutine_declaration_statement name: (_) @function)
(attrlist (attribute) @attribute)

(goto_expression (label) @label)
(loopex_expression (label) @label)

(statement_label label: _ @label)

(relational_expression operator: "isa" right: (bareword) @type)

(function_call_expression (function) @function)
(method_call_expression (method) @function.method)
(method_call_expression invocant: (bareword) @type)

(func0op_call_expression function: _ @function.builtin)
(func1op_call_expression function: _ @function.builtin)

(function) @function