Skip to content

Commit

Permalink
Use vhdl basic identifier syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nath@laptop committed Oct 12, 2016
1 parent 6e123df commit e443187
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vhdltree.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


EXCLUDES = ["implementation", "testbench"]
BASIC_ID_REGEX = "[a-z][a-z0-9]*(?:_[a-z0-9]+)*"


def _vhdltree(level, filepath, pattern, vhd_files):
Expand Down Expand Up @@ -49,7 +50,9 @@ def find_vhd(proot):


def vhdltree(filepath, proot):
p = re.compile("\s*([^\s:]+)\s*:\s*entity\s*([^\s]+)", re.IGNORECASE)
instantiation_regex = ("\s*({0})\s*:\s*entity\s*({0}(?:\.{0})*)"
.format(BASIC_ID_REGEX))
p = re.compile(instantiation_regex, re.IGNORECASE)
vhd_files = find_vhd(proot)
_vhdltree(0, filepath, p, vhd_files)

Expand Down

0 comments on commit e443187

Please sign in to comment.