|
26 | 26 | "interface"
|
27 | 27 | "is"
|
28 | 28 | "limited"
|
29 |
| - "null" |
30 | 29 | "of"
|
31 | 30 | "others"
|
32 | 31 | "out"
|
|
40 | 39 | "until"
|
41 | 40 | "when"
|
42 | 41 | ] @keyword
|
| 42 | +[ |
| 43 | + "null" |
| 44 | +] @constant.builtin |
43 | 45 | [
|
44 | 46 | "aliased"
|
45 | 47 | "constant"
|
46 | 48 | "renames"
|
47 |
| -] @storageclass |
| 49 | +] @keyword.storage |
48 | 50 | [
|
49 | 51 | "mod"
|
50 | 52 | "new"
|
51 | 53 | "protected"
|
52 | 54 | "record"
|
53 | 55 | "subtype"
|
54 | 56 | "type"
|
55 |
| -] @keyword.type |
| 57 | +] @type.builtin |
56 | 58 | [
|
57 | 59 | "with"
|
58 | 60 | "use"
|
59 |
| -] @include |
| 61 | +] @keyword.control.import |
60 | 62 | [
|
61 | 63 | "body"
|
62 | 64 | "function"
|
|
71 | 73 | "not"
|
72 | 74 | "or"
|
73 | 75 | "xor"
|
74 |
| -] @keyword.operator |
| 76 | +] @operator |
75 | 77 | [
|
76 | 78 | "while"
|
77 | 79 | "loop"
|
78 | 80 | "for"
|
79 | 81 | "parallel"
|
80 | 82 | "reverse"
|
81 | 83 | "some"
|
82 |
| -] @repeat |
| 84 | +] @kewyord.control.repeat |
83 | 85 | [
|
84 | 86 | "return"
|
85 |
| -] @keyword.return |
| 87 | +] @keyword.control.return |
86 | 88 | [
|
87 | 89 | "case"
|
88 | 90 | "if"
|
89 | 91 | "else"
|
90 | 92 | "then"
|
91 | 93 | "elsif"
|
92 | 94 | "select"
|
93 |
| -] @conditional |
| 95 | +] @keyword.control.conditional |
94 | 96 | [
|
95 | 97 | "exception"
|
96 | 98 | "raise"
|
97 |
| -] @exception |
98 |
| -(comment) @comment @spell |
99 |
| -(string_literal) @string |
| 99 | +] @keyword.control.exception |
| 100 | +(comment) @comment |
| 101 | +(string_literal) @string |
100 | 102 | (character_literal) @string
|
101 |
| -(numeric_literal) @number |
| 103 | +(numeric_literal) @constant.numeric |
102 | 104 |
|
103 | 105 | ;; Highlight the name of subprograms
|
104 |
| -(procedure_specification name: (_) @function) |
105 |
| -(function_specification name: (_) @function) |
106 |
| -(package_declaration name: (_) @function) |
107 |
| -(package_body name: (_) @function) |
108 |
| -(generic_instantiation name: (_) @function) |
109 |
| -(entry_declaration . (identifier) @function) |
| 106 | +(procedure_specification name: (_) @function.builtin) |
| 107 | +(function_specification name: (_) @function.builtin) |
| 108 | +(package_declaration name: (_) @function.builtin) |
| 109 | +(package_body name: (_) @function.builtin) |
| 110 | +(generic_instantiation name: (_) @function.builtin) |
| 111 | +(entry_declaration . (identifier) @function.builtin) |
110 | 112 |
|
111 | 113 | ;; Some keywords should take different categories depending on the context
|
112 |
| -(use_clause "use" @include "type" @include) |
113 |
| -(with_clause "private" @include) |
114 |
| -(with_clause "limited" @include) |
| 114 | +(use_clause "use" @keyword.control.import "type" @keyword.control.import) |
| 115 | +(with_clause "private" @keyword.control.import) |
| 116 | +(with_clause "limited" @keyword.control.import) |
115 | 117 | (use_clause (_) @namespace)
|
116 | 118 | (with_clause (_) @namespace)
|
117 | 119 |
|
118 |
| -(loop_statement "end" @keyword.repeat) |
119 |
| -(if_statement "end" @conditional) |
120 |
| -(loop_parameter_specification "in" @keyword.repeat) |
121 |
| -(loop_parameter_specification "in" @keyword.repeat) |
122 |
| -(iterator_specification ["in" "of"] @keyword.repeat) |
123 |
| -(range_attribute_designator "range" @keyword.repeat) |
| 120 | +(loop_statement "end" @keyword.control.repeat) |
| 121 | +(if_statement "end" @keyword.control.conditional) |
| 122 | +(loop_parameter_specification "in" @keyword.control.repeat) |
| 123 | +(loop_parameter_specification "in" @keyword.control.repeat) |
| 124 | +(iterator_specification ["in" "of"] @keyword.control.repeat) |
| 125 | +(range_attribute_designator "range" @keyword.control.repeat) |
124 | 126 |
|
125 |
| -(raise_statement "with" @exception) |
| 127 | +(raise_statement "with" @keyword.control.exception) |
126 | 128 |
|
127 |
| -(gnatprep_declarative_if_statement) @preproc |
128 |
| -(gnatprep_if_statement) @preproc |
129 |
| -(gnatprep_identifier) @preproc |
| 129 | +(gnatprep_declarative_if_statement) @keyword.directive |
| 130 | +(gnatprep_if_statement) @keyword.directive |
| 131 | +(gnatprep_identifier) @keyword.directive |
130 | 132 |
|
131 | 133 | (subprogram_declaration "is" @keyword.function "abstract" @keyword.function)
|
132 | 134 | (aspect_specification "with" @keyword.function)
|
133 | 135 |
|
134 |
| -(full_type_declaration "is" @keyword.type) |
135 |
| -(subtype_declaration "is" @keyword.type) |
136 |
| -(record_definition "end" @keyword.type) |
137 |
| -(full_type_declaration (_ "access" @keyword.type)) |
138 |
| -(array_type_definition "array" @keyword.type "of" @keyword.type) |
139 |
| -(access_to_object_definition "access" @keyword.type) |
140 |
| -(access_to_object_definition "access" @keyword.type |
| 136 | +(full_type_declaration "is" @type.builtin) |
| 137 | +(subtype_declaration "is" @type.builtin) |
| 138 | +(record_definition "end" @type.builtin) |
| 139 | +(full_type_declaration (_ "access" @type.builtin)) |
| 140 | +(array_type_definition "array" @type.builtin "of" @type.builtin) |
| 141 | +(access_to_object_definition "access" @type.builtin) |
| 142 | +(access_to_object_definition "access" @type.builtin |
141 | 143 | [
|
142 |
| - (general_access_modifier "constant" @keyword.type) |
143 |
| - (general_access_modifier "all" @keyword.type) |
| 144 | + (general_access_modifier "constant" @type.builtin) |
| 145 | + (general_access_modifier "all" @type.builtin) |
144 | 146 | ]
|
145 | 147 | )
|
146 |
| -(range_constraint "range" @keyword.type) |
147 |
| -(signed_integer_type_definition "range" @keyword.type) |
148 |
| -(index_subtype_definition "range" @keyword.type) |
149 |
| -(record_type_definition "abstract" @keyword.type) |
150 |
| -(record_type_definition "tagged" @keyword.type) |
151 |
| -(record_type_definition "limited" @keyword.type) |
152 |
| -(record_type_definition (record_definition "null" @keyword.type)) |
153 |
| -(private_type_declaration "is" @keyword.type "private" @keyword.type) |
154 |
| -(private_type_declaration "tagged" @keyword.type) |
155 |
| -(private_type_declaration "limited" @keyword.type) |
156 |
| -(task_type_declaration "task" @keyword.type "is" @keyword.type) |
| 148 | +(range_constraint "range" @type.builtin) |
| 149 | +(signed_integer_type_definition "range" @type.builtin) |
| 150 | +(index_subtype_definition "range" @type.builtin) |
| 151 | +(record_type_definition "abstract" @type.builtin) |
| 152 | +(record_type_definition "tagged" @type.builtin) |
| 153 | +(record_type_definition "limited" @type.builtin) |
| 154 | +(record_type_definition (record_definition "null" @type.builtin)) |
| 155 | +(private_type_declaration "is" @type.builtin "private" @type.builtin) |
| 156 | +(private_type_declaration "tagged" @type.builtin) |
| 157 | +(private_type_declaration "limited" @type.builtin) |
| 158 | +(task_type_declaration "task" @type.builtin "is" @type.builtin) |
157 | 159 |
|
158 | 160 | ;; Gray the body of expression functions
|
159 | 161 | (expression_function_declaration
|
|
164 | 166 | (subprogram_declaration (aspect_specification) @attribute)
|
165 | 167 |
|
166 | 168 | ;; Highlight full subprogram specifications
|
167 |
| -;(subprogram_body |
168 |
| -; [ |
169 |
| -; (procedure_specification) |
170 |
| -; (function_specification) |
171 |
| -; ] @function.spec |
172 |
| -;) |
173 |
| - |
174 |
| -((comment) @comment.documentation |
175 |
| - . [ |
176 |
| - (entry_declaration) |
177 |
| - (subprogram_declaration) |
178 |
| - (parameter_specification) |
179 |
| - ]) |
180 |
| - |
181 |
| -(compilation_unit |
182 |
| - . (comment) @comment.documentation) |
183 |
| - |
184 |
| -(component_list |
185 |
| - (component_declaration) |
186 |
| - . (comment) @comment.documentation) |
187 |
| - |
188 |
| -(enumeration_type_definition |
189 |
| - (identifier) |
190 |
| - . (comment) @comment.documentation) |
| 169 | +; (subprogram_body |
| 170 | +; [ |
| 171 | +; (procedure_specification) |
| 172 | +; (function_specification) |
| 173 | +; ] @function.builtin.spec |
| 174 | +; ) |
191 | 175 |
|
192 |
| -;; Highlight errors in red. This is not very useful in practice, as text will |
193 |
| -;; be highlighted as user types, and the error could be elsewhere in the code. |
194 |
| -;; This also requires defining :hi @error guifg=Red for instance. |
195 |
| -(ERROR) @error |
196 | 176 |
|
0 commit comments