blob: 789bf9395d953e7cc16fca215b5ff292f79ac06a (
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
|
; C highlights, from tree-sitter/tree-sitter-c v0.24.2 queries/highlights.scm
; (MIT). Reordered for later-patterns-win, capture names mapped onto zed syntax
; keys (preprocessor directives get @preproc rather than upstream's @keyword,
; which zed themes colour separately). Also loaded ahead of cpp.scm, the way
; upstream composes the C++ highlights.
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
[";" "," "."] @punctuation.delimiter
["--" "-" "-=" "->" "=" "!=" "*" "&" "&&" "+" "++" "+=" "<" "==" ">"
"||"] @operator
["break" "case" "const" "continue" "default" "do" "else" "enum" "extern"
"for" "if" "inline" "return" "sizeof" "static" "struct" "switch" "typedef"
"union" "volatile" "while"] @keyword
["#define" "#elif" "#else" "#endif" "#if" "#ifdef" "#ifndef"
"#include"] @preproc
(preproc_directive) @preproc
[(type_identifier) (primitive_type) (sized_type_specifier)] @type
(field_identifier) @property
(statement_identifier) @label
((identifier) @constant
(#match? @constant "^[A-Z][A-Z0-9_]*$"))
(call_expression function: (identifier) @function)
(call_expression function: (field_expression
field: (field_identifier) @function.method))
(function_declarator declarator: (identifier) @function)
(preproc_function_def name: (identifier) @function)
(number_literal) @number
(null) @constant
[(string_literal) (char_literal) (system_lib_string)] @string
(escape_sequence) @string.escape
(comment) @comment
|