Fixed issue allowing to scan dependencies by instance on the VHDL parser

parent a2956203
...@@ -171,10 +171,10 @@ class VHDLParser(DepParser): ...@@ -171,10 +171,10 @@ class VHDLParser(DepParser):
matches as indexed plain strings. It doesn't add any relation matches as indexed plain strings. It doesn't add any relation
to the file""" to the file"""
logging.debug("found component declaration %s", text.group(1)) logging.debug("found component declaration %s", text.group(1))
dep_file.add_relation( #dep_file.add_relation(
DepRelation("%s.%s" % (dep_file.library, text.group(1)), # DepRelation("%s.%s" % (dep_file.library, text.group(1)),
DepRelation.USE, # DepRelation.USE,
DepRelation.ENTITY)) # DepRelation.ENTITY))
return "<hdlmake component %s>" % text.group(1) return "<hdlmake component %s>" % text.group(1)
buf = re.sub(component_pattern, do_component, buf) buf = re.sub(component_pattern, do_component, buf)
...@@ -227,8 +227,7 @@ class VHDLParser(DepParser): ...@@ -227,8 +227,7 @@ 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".*end\s*(|function\s*)(|(?P=name))\s*;",
re.DOTALL | re.MULTILINE | re.IGNORECASE) re.DOTALL | re.MULTILINE | re.IGNORECASE)
def do_function(text): def do_function(text):
...@@ -256,9 +255,9 @@ class VHDLParser(DepParser): ...@@ -256,9 +255,9 @@ class VHDLParser(DepParser):
for lib in libraries: for lib in libraries:
logging.debug("-> instantiates %s.%s as %s", logging.debug("-> instantiates %s.%s as %s",
lib, text.group(2), text.group(1)) lib, text.group(2), text.group(1))
#dep_file.add_relation(DepRelation( dep_file.add_relation(DepRelation(
# "%s.%s" % (lib, text.group(2)), "%s.%s" % (lib, text.group(2)),
# DepRelation.USE, DepRelation.ARCHITECTURE)) DepRelation.USE, DepRelation.ENTITY))
return "<hdlmake instance %s|%s>" % (text.group(1), return "<hdlmake instance %s|%s>" % (text.group(1),
text.group(2)) text.group(2))
buf = re.sub(instance_pattern, do_instance, buf) buf = re.sub(instance_pattern, do_instance, buf)
......
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