aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/cmake/highlights.scm
blob: 71e9b5d9ce520784680e8f2bc63d1c94623d5649 (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
[
  (quoted_argument)
  (bracket_argument)
 ] @string

(variable) @variable

[
  (bracket_comment)
  (line_comment)
 ] @comment

(normal_command (identifier) @function)

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

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

[
  (if)
  (elseif)
  (else)
  (endif)
 ] @keyword.control.conditional

[
  (foreach)
  (endforeach)
  (while)
  (endwhile)
 ] @keyword.control.repeat

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

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

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

(normal_command
  (identifier) @function.builtin
  . (argument)
  (argument) @constant
  (#match? @constant "^(?:PARENT_SCOPE|CACHE)$")
  (#match? @function.builtin "^(?i)(unset)$"))

(normal_command
  (identifier) @function.builtin
  . (argument)
  . (argument)
  (argument) @constant
  (#match? @constant "^(?:PARENT_SCOPE|CACHE|FORCE)$")
  (#match? @function.builtin "^(?i)(set)$")
 )

((argument) @constant.builtin.boolean
   (#match? @constant.builtin.boolean "^(?i)(?:1|on|yes|true|y|0|off|no|false|n|ignore|notfound|.*-notfound)$")
 )

(if_command
   (if)
   (argument) @operator
   (#match? @operator "^(?:NOT|AND|OR|COMMAND|POLICY|TARGET|TEST|DEFINED|IN_LIST|EXISTS|IS_NEWER_THAN|IS_DIRECTORY|IS_SYMLINK|IS_ABSOLUTE|MATCHES|LESS|GREATER|EQUAL|LESS_EQUAL|GREATER_EQUAL|STRLESS|STRGREATER|STREQUAL|STRLESS_EQUAL|STRGREATER_EQUAL|VERSION_LESS|VERSION_GREATER|VERSION_EQUAL|VERSION_LESS_EQUAL|VERSION_GREATER_EQUAL)$")
)

(normal_command
   (identifier) @function.builtin
   . (argument)
   (argument) @constant
   (#match? @constant "^(?:ALL|COMMAND|DEPENDS|BYPRODUCTS|WORKING_DIRECTORY|COMMENT|JOB_POOL|VERBATIM|USES_TERMINAL|COMMAND_EXPAND_LISTS|SOURCES)$")
   (#match? @function.builtin "^(?i)(add_custom_target)$")
 )

(normal_command
   (identifier) @function.builtin
   (argument) @constant
   (#match? @constant "^(?:OUTPUT|COMMAND|MAIN_DEPENDENCY|DEPENDS|BYPRODUCTS|IMPLICIT_DEPENDS|WORKING_DIRECTORY|COMMENT|DEPFILE|JOB_POOL|VERBATIM|APPEND|USES_TERMINAL|COMMAND_EXPAND_LISTS)$")
   (#match? @function.builtin "^(?i)(add_custom_command)$")
 )