aboutsummaryrefslogtreecommitdiffstats
path: root/queries/cmake/highlights.scm
blob: 9be78c1b0f211d212b2b38e67b0f5435884adbcf (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
[
 (quoted_argument)
 (bracket_argument)
] @string

(variable_ref) @none
(variable) @variable

[
 (bracket_comment)
 (line_comment)
] @comment

(normal_command (identifier) @function)

["ENV" "CACHE"] @symbol
["$" "{" "}" "<" ">"] @punctuation.special
["(" ")"] @punctuation.bracket

[
 (function)
 (endfunction)
 (macro)
 (endmacro)
] @keyword.function

[
 (if)
 (elseif)
 (else)
 (endif)
] @conditional

[
 (foreach)
 (endforeach)
 (while)
 (endwhile)
] @repeat

(function_command
  (function)
  . (argument) @function
  (argument)* @parameter
)

(macro_command
  (macro)
  . (argument) @function.macro
  (argument)* @parameter
)

(normal_command
 (identifier) @function.builtin
 . (argument) @variable
 (#match? @function.builtin "\\c^(set)$"))

(normal_command
 (identifier) @function.builtin
 . (argument)
 . (argument)
 (argument) @constant
 (#any-of? @constant "PARENT_SCOPE" "CACHE" "FORCE")
 (#match? @function.builtin "\\c^(set)$")
)