Skip to content

Commit 21b54a6

Browse files
committed
Add default values for ports and generics
1 parent 3ea3709 commit 21b54a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hdlparse/vhdl_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ def parse_vhdl(text):
478478
param_items = []
479479
last_item = generics[-1]
480480

481+
elif action == 'generic_param_default':
482+
last_item.default_value = groups[0]
483+
481484
elif action == 'port_param':
482485
param_items.append(groups[0])
483486
port_param_index += 1
@@ -491,6 +494,9 @@ def parse_vhdl(text):
491494
param_items = []
492495
last_item = ports[-1]
493496

497+
elif action == 'port_param_default':
498+
last_item.default_value = groups[0]
499+
494500
elif action == 'port_array_param_type':
495501
mode, ptype = groups
496502
array_range_start_pos = pos[1]

0 commit comments

Comments
 (0)