summaryrefslogtreecommitdiff
path: root/runtime/queries/rego/highlights.scm
blob: 0ff6de552f78a86cf0f1345265609d7b55ed2e48 (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
[
  (import)
] @keyword.control.import

[
  (package)
] @namespace

[
  (with)
  (as)
  (every)
  (some)
  (in)
  (default)
  "null"
] @keyword.control

[
  (not)
  (if)
  (contains)
  (else)
] @keyword.control.conditional

[
  (boolean)
] @constant.builtin.boolean

[
  (assignment_operator)
  (bool_operator)
  (arith_operator)
  (bin_operator)
] @operator

[
  (string)
  (raw_string)
] @string

(term (ref (var))) @variable

(comment) @comment.line

(number) @constant.numeric.integer

(expr_call func_name: (fn_name (var) @function .))

(expr_call func_arguments: (fn_args (expr) @variable.parameter))

(rule_args (term) @variable.parameter)

[
  (open_paren)
  (close_paren)
  (open_bracket)
  (close_bracket)
  (open_curly)
  (close_curly)
] @punctuation.bracket

(rule (rule_head (var) @function.method))

(rule
  (rule_head (term (ref (var) @namespace)))
  (rule_body (query (literal (expr (expr_infix (expr (term (ref (var)) @_output)))))) (#eq? @_output @namespace))
)