@@ -0,0 +1,311 @@
1+; Keywords
2+
3+[
4+ ; block delimeters
5+ (module_keyword)
6+ "endmodule"
7+ "program"
8+ "endprogram"
9+ "class"
10+ "endclass"
11+ "interface"
12+ "endinterface"
13+ "package"
14+ "endpackage"
15+ "checker"
16+ "endchecker"
17+ "config"
18+ "endconfig"
19+
20+ "pure"
21+ "virtual"
22+ "extends"
23+ "implements"
24+ "super"
25+ (class_item_qualifier)
26+
27+ "parameter"
28+ "localparam"
29+ "defparam"
30+ "assign"
31+ "typedef"
32+ "modport"
33+ "fork"
34+ "join"
35+ "join_none"
36+ "join_any"
37+ "default"
38+ "break"
39+ "assert"
40+ (unique_priority)
41+ "tagged"
42+ "extern"
43+] @keyword
44+
45+[
46+ "function"
47+ "endfunction"
48+
49+ "task"
50+ "endtask"
51+] @keyword.function
52+
53+"return" @keyword.control.return
54+
55+[
56+ "begin"
57+ "end"
58+] @label
59+
60+[
61+ (always_keyword)
62+ "generate"
63+ "for"
64+ "foreach"
65+ "repeat"
66+ "forever"
67+ "initial"
68+ "while"
69+] @keyword.control
70+
71+[
72+ "if"
73+ "else"
74+ (case_keyword)
75+ "endcase"
76+] @keyword.control.conditional
77+
78+(comment) @comment
79+
80+(include_compiler_directive) @keyword.directive
81+(package_import_declaration
82+ "import" @keyword.control.import)
83+
84+(package_import_declaration
85+ (package_import_item
86+ (package_identifier
87+ (simple_identifier) @constant)))
88+
89+(text_macro_identifier
90+ (simple_identifier) @keyword.directive)
91+
92+(package_scope
93+ (package_identifier
94+ (simple_identifier) @constant))
95+
96+(package_declaration
97+ (package_identifier
98+ (simple_identifier) @constant))
99+
100+(parameter_port_list
101+ "#" @constructor)
102+
103+[
104+ "="
105+ "-"
106+ "+"
107+ "/"
108+ "*"
109+ "^"
110+ "&"
111+ "|"
112+ "&&"
113+ "||"
114+ ":"
115+ (unary_operator)
116+ "{"
117+ "}"
118+ "'{"
119+ "<="
120+ "@"
121+ "or"
122+ "and"
123+ "=="
124+ "!="
125+ "==="
126+ "!=="
127+ "-:"
128+ "<"
129+ ">"
130+ ">="
131+ "%"
132+ ">>"
133+ "<<"
134+ "|="
135+ (inc_or_dec_operator)
136+] @keyword.operator
137+
138+(cast
139+ ["'" "(" ")"] @keyword.operator)
140+
141+(edge_identifier) @constant
142+
143+(port_direction) @label
144+(port_identifier
145+ (simple_identifier) @variable)
146+
147+[
148+ (net_type)
149+ (integer_vector_type)
150+ (integer_atom_type)
151+] @type.builtin
152+
153+[
154+ "signed"
155+ "unsigned"
156+] @label
157+
158+(data_type
159+ (simple_identifier) @type)
160+
161+(method_call_body
162+ (method_identifier) @variable.other.member)
163+
164+(interface_identifier
165+ (simple_identifier) @type)
166+
167+(modport_identifier
168+ (modport_identifier
169+ (simple_identifier) @variable.other.member))
170+
171+(net_port_type1
172+ (simple_identifier) @type)
173+
174+[
175+ (double_quoted_string)
176+ (string_literal)
177+] @string
178+
179+[
180+ (include_compiler_directive)
181+ (default_nettype_compiler_directive)
182+ (timescale_compiler_directive)
183+] @keyword.directive
184+
185+; begin/end label
186+(seq_block
187+ (simple_identifier) @comment)
188+
189+[
190+ ";"
191+ "::"
192+ ","
193+ "."
194+] @punctuation.delimiter
195+
196+
197+(default_nettype_compiler_directive
198+ (default_nettype_value) @string)
199+
200+(text_macro_identifier
201+ (simple_identifier) @function.macro)
202+
203+(module_declaration
204+ (module_header
205+ (simple_identifier) @constructor))
206+
207+(class_constructor_declaration
208+ "new" @constructor)
209+
210+(parameter_identifier
211+ (simple_identifier) @variable.parameter)
212+
213+[
214+ (integral_number)
215+ (unsigned_number)
216+ (unbased_unsized_literal)
217+] @constant.numeric
218+
219+(time_unit) @constant
220+
221+(checker_instantiation
222+ (checker_identifier
223+ (simple_identifier) @constructor))
224+
225+(module_instantiation
226+ (simple_identifier) @constructor)
227+
228+(name_of_instance
229+ (instance_identifier
230+ (simple_identifier) @variable))
231+
232+(interface_port_declaration
233+ (interface_identifier
234+ (simple_identifier) @type))
235+
236+(net_declaration
237+ (simple_identifier) @type)
238+
239+(lifetime) @label
240+
241+(function_identifier
242+ (function_identifier
243+ (simple_identifier) @function))
244+
245+(function_subroutine_call
246+ (subroutine_call
247+ (tf_call
248+ (simple_identifier) @function)))
249+
250+(function_subroutine_call
251+ (subroutine_call
252+ (system_tf_call
253+ (system_tf_identifier) @function.builtin)))
254+
255+(task_identifier
256+ (task_identifier
257+ (simple_identifier) @function.method))
258+
259+;;TODO: fixme
260+;(assignment_pattern_expression
261+ ;(assignment_pattern
262+ ;(parameter_identifier) @variable.other.member))
263+
264+(type_declaration
265+ (data_type ["packed"] @label))
266+
267+(struct_union) @type
268+
269+[
270+ "enum"
271+] @type
272+
273+(enum_name_declaration
274+ (enum_identifier
275+ (simple_identifier) @constant))
276+
277+(type_declaration
278+ (simple_identifier) @type)
279+
280+[
281+ (integer_atom_type)
282+ (non_integer_type)
283+ "genvar"
284+] @type.builtin
285+
286+(struct_union_member
287+ (list_of_variable_decl_assignments
288+ (variable_decl_assignment
289+ (simple_identifier) @variable.other.member)))
290+
291+(member_identifier
292+ (simple_identifier) @variable.other.member)
293+
294+(struct_union_member
295+ (data_type_or_void
296+ (data_type
297+ (simple_identifier) @type)))
298+
299+(type_declaration
300+ (simple_identifier) @type)
301+
302+(generate_block_identifier) @comment
303+
304+[
305+ "["
306+ "]"
307+ "("
308+ ")"
309+] @punctuation.bracket
310+
311+(ERROR) @error