-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.scm
114 lines (103 loc) · 2.82 KB
/
query.scm
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
(
(declaration
(storage_class_specifier)
type: (_) @function.return
declarator: (function_declarator
declarator: (identifier) @function.name
parameters: (parameter_list) @function.params
)
) @function.decl
) @function
(
(declaration
(storage_class_specifier)
type: (_) @function.return
declarator: (pointer_declarator
declarator: (function_declarator
declarator: (identifier) @function.name
parameters: (parameter_list) @function.params
)
) @function.return_ptr
) @function.decl
) @function
(type_definition
type: (_) @callback.return
declarator: (function_declarator
declarator: (parenthesized_declarator
(pointer_declarator declarator: (_) @callback.name)
)
parameters: (parameter_list) @callback.params
)
) @callback
(type_definition
type: (_) @callback.return
declarator: (pointer_declarator
declarator: (function_declarator
declarator: (parenthesized_declarator
(pointer_declarator declarator: (_) @callback.name)
)
parameters: (parameter_list) @callback.params
)
) @callback.return_ptr
) @callback
(type_definition
type: (struct_specifier !body)
declarator: [
(type_identifier) @opaque.name
(pointer_declarator
(type_identifier) @opaque.name
)
]
) @opaque
(type_definition
type: [
(enum_specifier
name: (type_identifier) @enum.name
body: (enumerator_list) @enum.entries
) @enum
(struct_specifier
name: (type_identifier) @struct.name
body: (field_declaration_list) @struct.members
) @struct
(union_specifier
name: (type_identifier) @union.name
body: (field_declaration_list) @union.members
) @union
]
)
(
(type_definition
type: [
(type_identifier)
(primitive_type)
(sized_type_specifier)
] @bitflag.type
declarator: (type_identifier) @bitflag.name
)
. [
(preproc_function_def)
(preproc_def
name: (_) @flag.name
value: (_) @flag.value
) @flag
]+
) @bitflag
(preproc_function_def
name: (_) @fn_macro.name
parameters: (_) @fn_macro.params
value: (_) @fn_macro.body
) @fn_macro
(type_definition
type: [ (type_identifier) (primitive_type) ] @alias.type
declarator: [
(type_identifier) @alias.name
(pointer_declarator
(type_identifier) @alias.name
) @alias.ptr
]
) @alias
(preproc_def name: (_) @const.name value: (_) @const.value) @const
[
(preproc_if condition: (_) @cond.text)
(preproc_ifdef name: (_) @cond.text)
] @cond