|
104 | 104 | (r'--.*\n', None),
|
105 | 105 | ],
|
106 | 106 | 'generic_param_type': [
|
107 |
| - (r'\s*(\w+)\s*', 'generic_param_type'), |
| 107 | + (r'\s*(\w+)[ \t\r\f\v]*', 'generic_param_type'), |
108 | 108 | (r'\s*;\s*', None, '#pop'),
|
109 | 109 | (r"\s*:=\s*([\w']+)", 'generic_param_default'),
|
| 110 | + (r'\)\s*;\s*--(.*)\n', 'line_comment', '#pop:2'), |
| 111 | + (r'\n\s*\)\s*;\s*--(.*)\n', 'generic_list_comment', '#pop:2'), |
| 112 | + (r'\n\s*', None), |
110 | 113 | (r'\)\s*;', 'end_generic', '#pop:2'),
|
111 | 114 | (r'--#(.*)\n', 'metacomment'),
|
112 | 115 | (r'/\*', 'block_comment', 'block_comment'),
|
|
123 | 126 | ],
|
124 | 127 | 'port_param_type': [
|
125 | 128 | (r'\s*(in|out|inout|buffer)\s+(\w+)\s*\(', 'port_array_param_type', 'array_range'),
|
126 |
| - (r'\s*(in|out|inout|buffer)\s+(\w+)\s*', 'port_param_type'), |
| 129 | + (r'\s*(in|out|inout|buffer)\s+(\w+)[ \t\r\f\v]*', 'port_param_type'), |
127 | 130 | (r'\s*;\s*', None, '#pop'),
|
128 | 131 | (r"\s*:=\s*([\w']+)", 'port_param_default'),
|
129 | 132 | (r'--(.*)\n', 'line_comment'),
|
| 133 | + (r'\)\s*;\s*--(.*)\n', 'line_comment', '#pop:2'), |
| 134 | + (r'\n\s*\)\s*;\s*--(.*)\n', 'port_list_comment', '#pop:2'), |
| 135 | + (r'\n\s*', None), |
130 | 136 | (r'\)\s*;', 'end_port', '#pop:2'),
|
131 | 137 | (r'--#(.*)\n', 'metacomment'),
|
132 | 138 | (r'/\*', 'block_comment', 'block_comment'),
|
@@ -566,7 +572,8 @@ def parse_vhdl(text):
|
566 | 572 |
|
567 | 573 | elif action == 'line_comment':
|
568 | 574 | for i in last_items:
|
569 |
| - i.param_desc = groups[0] |
| 575 | + if not i.param_desc: |
| 576 | + i.param_desc = groups[0] |
570 | 577 |
|
571 | 578 | return objects
|
572 | 579 |
|
@@ -774,8 +781,9 @@ def register_array_types_from_sources(self, source_files):
|
774 | 781 | component acomp is
|
775 | 782 | port (
|
776 | 783 | a,b,c : in std_ulogic; -- no default value
|
777 |
| - f,g,h : inout bit := '1' -- default value '1' |
778 |
| - ); |
| 784 | + f,g,h : inout bit := '1' -- bit ports |
| 785 | + ); -- port list comment |
| 786 | + |
779 | 787 | end component;
|
780 | 788 |
|
781 | 789 | end package;
|
|
0 commit comments