diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-30 12:46:41 +0100 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2022-12-30 12:46:41 +0100 |
commit | 4d95dd3c74785a8ac5d2a6af112d9fb12dd36b48 (patch) | |
tree | fcd6561b74c8c626fb4f180d2861301667442a83 /pyGHDL/dom | |
parent | a32e651834af5745c7b1c709ff81a685af379970 (diff) | |
download | ghdl-4d95dd3c74785a8ac5d2a6af112d9fb12dd36b48.tar.gz ghdl-4d95dd3c74785a8ac5d2a6af112d9fb12dd36b48.tar.bz2 ghdl-4d95dd3c74785a8ac5d2a6af112d9fb12dd36b48.zip |
Fixed handling of Use clauses in packages.
Diffstat (limited to 'pyGHDL/dom')
-rw-r--r-- | pyGHDL/dom/_Utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pyGHDL/dom/_Utils.py b/pyGHDL/dom/_Utils.py index 20171b45c..bc1841990 100644 --- a/pyGHDL/dom/_Utils.py +++ b/pyGHDL/dom/_Utils.py @@ -156,21 +156,24 @@ def GetLibrarySymbol(node: Iir) -> LibraryReferenceSymbol: def GetPackageSymbol(node: Iir) -> PackageReferenceSymbol: kind = GetIirKindOfNode(node) + name = GetNameOfNode(node) if kind == nodes.Iir_Kind.Selected_Name: - name = GetNameOfNode(node) prefixName = GetLibrarySymbol(nodes.Get_Prefix(node)) return PackageReferenceSymbol(node, name, prefixName) + elif kind == nodes.Iir_Kind.Simple_Name: + return PackageReferenceSymbol(node, name, None) else: raise DOMException(f"{kind.name} at {Position.parse(node)}") -def GetPackageMemberSymbol(node: Iir) -> Union[PackageMembersReferenceSymbol, AllPackageMembersReferenceSymbol]: +def GetPackageMemberSymbol(node: Iir) -> Union[PackageReferenceSymbol, PackageMembersReferenceSymbol, AllPackageMembersReferenceSymbol]: kind = GetIirKindOfNode(node) prefixName = GetPackageSymbol(nodes.Get_Prefix(node)) if kind == nodes.Iir_Kind.Selected_Name: name = GetNameOfNode(node) return PackageMembersReferenceSymbol(node, name, prefixName) elif kind == nodes.Iir_Kind.Selected_By_All_Name: + prefixName = GetPackageSymbol(nodes.Get_Prefix(node)) return AllPackageMembersReferenceSymbol(node, prefixName) else: raise DOMException(f"{kind.name} at {Position.parse(node)}") |