Skip to content

Commit 48dfe3c

Browse files
committed
Add field for udp_identifier, clean code
1 parent 6f1cec9 commit 48dfe3c

File tree

7 files changed

+37
-27
lines changed

7 files changed

+37
-27
lines changed

grammar.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,8 +2603,7 @@ const rules = {
26032603

26042604
// ** A.5.4 UDP instantiation
26052605
udp_instantiation: $ => seq(
2606-
// 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
2607-
$.udp_identifier,
2606+
field('instance_type', $.udp_identifier),
26082607
optional($.drive_strength),
26092608
optional($.delay2),
26102609
prec.dynamic(-1, commaSep1($.udp_instance)), // Give $.hierarchical_instance and $.module_instantiation higher priority
@@ -4002,7 +4001,7 @@ const rules = {
40024001
$.cast,
40034002
$.assignment_pattern_expression,
40044003
$.streaming_concatenation,
4005-
// $.sequence_method_call, // TODO: Remove temporarily to narrow conflicts
4004+
// $.sequence_method_call, // Remove to narrow conflicts
40064005
'this',
40074006
'$',
40084007
'null',

src/grammar.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 16 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser.c

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/corpus/core/instantiation/user_defined_primitives.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ endmodule
7777
(hierarchical_identifier
7878
(simple_identifier))))))))
7979
(udp_instantiation
80-
(simple_identifier)
80+
instance_type: (simple_identifier)
8181
(udp_instance
8282
(output_terminal
8383
(net_lvalue
@@ -93,7 +93,7 @@ endmodule
9393
(hierarchical_identifier
9494
(simple_identifier)))))))
9595
(udp_instantiation
96-
(simple_identifier)
96+
instance_type: (simple_identifier)
9797
(drive_strength
9898
(strength0)
9999
(strength1))

test/corpus/core/instantiation/user_defined_primitives_tf_call.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endmodule
2020
(module_keyword)
2121
name: (simple_identifier))
2222
(udp_instantiation
23-
(simple_identifier)
23+
instance_type: (simple_identifier)
2424
(udp_instance
2525
(output_terminal
2626
(net_lvalue
@@ -36,7 +36,7 @@ endmodule
3636
(hierarchical_identifier
3737
(simple_identifier)))))))
3838
(udp_instantiation
39-
(simple_identifier)
39+
instance_type: (simple_identifier)
4040
(drive_strength
4141
(strength0)
4242
(strength1))

test/corpus/doulos/55.1_instantiation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endmodule
2020
(module_keyword)
2121
name: (simple_identifier))
2222
(udp_instantiation
23-
(simple_identifier)
23+
instance_type: (simple_identifier)
2424
(drive_strength
2525
(strength1)
2626
(strength0))

0 commit comments

Comments
 (0)