Skip to content

Commit

Permalink
Ignore verilog comments when processing gpio default settings in user…
Browse files Browse the repository at this point in the history
…_defines.v
  • Loading branch information
d-m-bailey committed May 3, 2024
1 parent e770336 commit 17cec19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/gen_gpio_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def usage():

if os.path.isfile(user_defines_path):
with open(user_defines_path, 'r') as ifile:
infolines = ifile.read().splitlines()
for line in infolines:
raw_data = ifile.read()
comment_pattern = r'//.*|/\*[\s\S]*?\*/'
data_without_comments = re.sub(comment_pattern, '', raw_data)
for line in data_without_comments.splitlines():
tokens = line.split()
if len(tokens) >= 3:
if tokens[0] == '`define':
Expand Down

0 comments on commit 17cec19

Please sign in to comment.