Skip to content

Commit 290a5e5

Browse files
committed
Add field for checker instantiation
1 parent ecf81e5 commit 290a5e5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

grammar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ const rules = {
23612361

23622362
// *** A.4.1.4 Checker instantiation
23632363
checker_instantiation: $ => prec('checker_instantiation', seq(
2364-
$.ps_checker_identifier,
2364+
field('instance_type', $.ps_checker_identifier),
23652365
$.name_of_instance,
23662366
'(', optional($.list_of_checker_port_connections), ')',
23672367
';'
@@ -2578,6 +2578,7 @@ const rules = {
25782578

25792579
// ** A.5.4 UDP instantiation
25802580
udp_instantiation: $ => seq(
2581+
// field('instance_type', $.udp_identifier), // TODO: For some reason results in parse errors with tree-sitter 0.22.6, in core/instantiation/user_defined_primitives
25812582
$.udp_identifier,
25822583
optional($.drive_strength),
25832584
optional($.delay2),

test/corpus/doulos/125.1_checker_instantiation.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ endmodule : m
7979
(simple_identifier)))
8080
(checker_item
8181
(checker_instantiation
82-
(simple_identifier)
82+
instance_type: (simple_identifier)
8383
(name_of_instance
8484
instance_name: (simple_identifier))
8585
(list_of_checker_port_connections
@@ -117,7 +117,7 @@ endmodule : m
117117
(statement
118118
(statement_item
119119
(checker_instantiation
120-
(simple_identifier)
120+
instance_type: (simple_identifier)
121121
(name_of_instance
122122
instance_name: (simple_identifier))
123123
(list_of_checker_port_connections
@@ -173,7 +173,7 @@ endmodule : m
173173
(statement
174174
(statement_item
175175
(checker_instantiation
176-
(simple_identifier)
176+
instance_type: (simple_identifier)
177177
(name_of_instance
178178
instance_name: (simple_identifier))
179179
(list_of_checker_port_connections

test/corpus/doulos/55.2_instantiation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Counter U123 (.Clock(Clk), .Reset(Rst), .Count(Q));
1717
(statement
1818
(statement_item
1919
(checker_instantiation
20-
(simple_identifier)
20+
instance_type: (simple_identifier)
2121
(name_of_instance
2222
instance_name: (simple_identifier))
2323
(list_of_checker_port_connections

0 commit comments

Comments
 (0)