Skip to content

Commit 99b18da

Browse files
committed
fix: comment in parameters list
1 parent bfe0642 commit 99b18da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hdlparse/verilog_parser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
'''Verilog documentation parser'''
1111

1212
verilog_tokens = {
13+
# state
1314
'root': [
15+
# patterns
16+
# pattern, action, new_state
1417
(r'\bmodule\s+(\w+)\s*', 'module', 'module'),
1518
(r'/\*', 'block_comment', 'block_comment'),
1619
(r'//#+(.*)\n', 'metacomment'),
@@ -29,6 +32,7 @@
2932
(r'\s*(\w+)\s*=\s*((?:(?!\/\/|[,)]).)*)', 'param_item'),
3033
(r'//#+(.*)\n', 'metacomment'),
3134
(r',', None),
35+
(r'//.*\n', None),
3236
(r'[);]', None, '#pop'),
3337
],
3438
'module_port': [
@@ -133,6 +137,9 @@ def parse_verilog(text):
133137
objects = []
134138

135139
for pos, action, groups in lex.run(text):
140+
141+
print (pos, action, groups)
142+
136143
if action == 'metacomment':
137144
comment = groups[0].strip()
138145
if last_item is None:

0 commit comments

Comments
 (0)