Commit e8c1f12c authored by Will Kamp's avatar Will Kamp

Recognise entire VHDL functions and entity instanciations as instances.

Gobble entire VHDL function to avoid input parameters being recognised as instances.
Entity instanciations recognised as instances as well - borrowed from rjen's commit d0ba0268 on feat_svn_ise branch.
parent 40d23369
...@@ -227,7 +227,11 @@ class VHDLParser(DepParser): ...@@ -227,7 +227,11 @@ class VHDLParser(DepParser):
# function declaration # function declaration
function_pattern = re.compile( function_pattern = re.compile(
r"^\s*function\s+(?P<name>\w+)", r"^\s*function\s+(?P<name>\w+)"
r".*?" # gobble arguments if any.
r"return\s+\w+"
r"(\s+is.*?end\s+function.*?)?" # gobble body if any.
r"\s*;",
re.DOTALL | re.MULTILINE | re.IGNORECASE) re.DOTALL | re.MULTILINE | re.IGNORECASE)
def do_function(text): def do_function(text):
...@@ -243,8 +247,7 @@ class VHDLParser(DepParser): ...@@ -243,8 +247,7 @@ class VHDLParser(DepParser):
# instantions # instantions
libraries = set([dep_file.library]) libraries = set([dep_file.library])
instance_pattern = re.compile( instance_pattern = re.compile(
r"^\s*(\w+)\s*\:\s*(\w+)\s*(?:port\s+map.*?;" r"^\s*(\w+)\s*:\s*(?:entity\s+\w+\.)?(\w+)\s*(?:port\s+map.*?|generic\s+map.*?)",
r"|generic\s+map.*?;|\s*;)",
re.DOTALL | re.MULTILINE | re.IGNORECASE) re.DOTALL | re.MULTILINE | re.IGNORECASE)
def do_instance(text): def do_instance(text):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment