blob: 13a12279029e360553427a1034fb6fc62cca6476 (
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
|
; Functions definitions
(function_declarator
declarator: (identifier) @local.definition.function)
(preproc_function_def
name: (identifier) @local.definition.macro) @local.scope
(preproc_def
name: (identifier) @local.definition.macro)
(pointer_declarator
declarator: (identifier) @local.definition.var)
(parameter_declaration
declarator: (identifier) @local.definition.parameter)
(init_declarator
declarator: (identifier) @local.definition.var)
(array_declarator
declarator: (identifier) @local.definition.var)
(declaration
declarator: (identifier) @local.definition.var)
(enum_specifier
name: (_) @local.definition.type
(enumerator_list
(enumerator
name: (identifier) @local.definition.var)))
; Type / Struct / Enum
(field_declaration
declarator: (field_identifier) @local.definition.field)
(type_definition
declarator: (type_identifier) @local.definition.type)
(struct_specifier
name: (type_identifier) @local.definition.type)
; goto
(labeled_statement
(statement_identifier) @local.definition)
; References
(identifier) @local.reference
((field_identifier) @local.reference
(#set! reference.kind "field"))
((type_identifier) @local.reference
(#set! reference.kind "type"))
(goto_statement
(statement_identifier) @local.reference)
; Scope
[
(for_statement)
(if_statement)
(while_statement)
(translation_unit)
(function_definition)
(compound_statement) ; a block in curly braces
(struct_specifier)
] @local.scope
|