Debian Codegraph @

runtime/queries/cmake/highlights.scm

raw symbols SCIP
1 [
2 (quoted_argument)
3 (bracket_argument)
4 ] @string
5
6 (variable) @variable
7
8 [
9 (bracket_comment)
10 (line_comment)
11 ] @comment
12
13 (normal_command (identifier) @function)
14
15 ["ENV" "CACHE"] @string.special.symbol
16 ; `<` `>` (generator-expression delimiters) were dropped upstream with the
17 ; gen_exp node; `$` `{` `}` still delimit variable references.
18 ["$" "{" "}"] @punctuation
19 ["(" ")"] @punctuation.bracket
20
21 [
22 (function)
23 (endfunction)
24 (macro)
25 (endmacro)
26 ] @keyword.function
27
28 ; Scope block (`block()` / `endblock()`, CMake 3.25+).
29 [
30 (block)
31 (endblock)
32 ] @keyword
33
34 [
35 (if)
36 (elseif)
37 (else)
38 (endif)
39 ] @keyword.control.conditional
40
41 [
42 (foreach)
43 (endforeach)
44 (while)
45 (endwhile)
46 ] @keyword.control.repeat
47
48 ; Command arguments are now wrapped in an (argument_list) node, so the
49 ; argument matches nest inside it rather than sitting directly under the command.
50 (function_command
51 (function)
52 (argument_list
53 . (argument) @function
54 (argument)* @variable.parameter))
55
56 (macro_command
57 (macro)
58 (argument_list
59 . (argument) @function.macro
60 (argument)* @variable.parameter))
61
62 (normal_command
63 (identifier) @function.builtin
64 (argument_list . (argument) @variable)
65 (#match? @function.builtin "^(?i)(set)$"))
66
67 (normal_command
68 (identifier) @function.builtin
69 (argument_list
70 . (argument)
71 (argument) @constant)
72 (#match? @constant "^(?:PARENT_SCOPE|CACHE)$")
73 (#match? @function.builtin "^(?i)(unset)$"))
74
75 (normal_command
76 (identifier) @function.builtin
77 (argument_list
78 . (argument)
79 . (argument)
80 (argument) @constant)
81 (#match? @constant "^(?:PARENT_SCOPE|CACHE|FORCE)$")
82 (#match? @function.builtin "^(?i)(set)$")
83 )
84
85 ((argument) @constant.builtin.boolean
86 (#match? @constant.builtin.boolean "^(?i)(?:1|on|yes|true|y|0|off|no|false|n|ignore|notfound|.*-notfound)$")
87 )
88
89 (if_command
90 (if)
91 (argument_list (argument) @operator)
92 (#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)$")
93 )
94
95 (normal_command
96 (identifier) @function.builtin
97 (argument_list
98 . (argument)
99 (argument) @constant)
100 (#match? @constant "^(?:ALL|COMMAND|DEPENDS|BYPRODUCTS|WORKING_DIRECTORY|COMMENT|JOB_POOL|VERBATIM|USES_TERMINAL|COMMAND_EXPAND_LISTS|SOURCES)$")
101 (#match? @function.builtin "^(?i)(add_custom_target)$")
102 )
103
104 (normal_command
105 (identifier) @function.builtin
106 (argument_list (argument) @constant)
107 (#match? @constant "^(?:OUTPUT|COMMAND|MAIN_DEPENDENCY|DEPENDS|BYPRODUCTS|IMPLICIT_DEPENDS|WORKING_DIRECTORY|COMMENT|DEPFILE|JOB_POOL|VERBATIM|APPEND|USES_TERMINAL|COMMAND_EXPAND_LISTS)$")
108 (#match? @function.builtin "^(?i)(add_custom_command)$")
109 )
110