diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-27 22:46:28 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-07-01 06:39:46 +0200 |
commit | 5c2afa1e06c43e4f445e3387b3de77231b6c42d4 (patch) | |
tree | 865a9605f2447d4600899caa23b2de450405c075 /pyGHDL/dom/formatting | |
parent | 2b8408086015c15c105c3a173e9485c19e391980 (diff) | |
download | ghdl-5c2afa1e06c43e4f445e3387b3de77231b6c42d4.tar.gz ghdl-5c2afa1e06c43e4f445e3387b3de77231b6c42d4.tar.bz2 ghdl-5c2afa1e06c43e4f445e3387b3de77231b6c42d4.zip |
Fixed MRO problems.
Diffstat (limited to 'pyGHDL/dom/formatting')
-rw-r--r-- | pyGHDL/dom/formatting/prettyprint.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pyGHDL/dom/formatting/prettyprint.py b/pyGHDL/dom/formatting/prettyprint.py index fb1fcf826..cddfec458 100644 --- a/pyGHDL/dom/formatting/prettyprint.py +++ b/pyGHDL/dom/formatting/prettyprint.py @@ -44,6 +44,7 @@ from pyGHDL.dom.Object import Constant, Signal, SharedVariable, File from pyGHDL.dom.InterfaceItem import ( GenericConstantInterfaceItem, PortSignalInterfaceItem, + GenericTypeInterfaceItem, ) from pyGHDL.dom.Symbol import ( SimpleSubTypeSymbol, @@ -262,6 +263,8 @@ class PrettyPrint: ) -> StringBuffer: if isinstance(generic, GenericConstantInterfaceItem): return self.formatGenericConstant(generic, level) + elif isinstance(generic, GenericTypeInterfaceItem): + return self.formatGenericType(generic, level) else: raise PrettyPrintException( "Unhandled generic kind for generic '{name}'.".format(name=generic.Name) @@ -297,6 +300,21 @@ class PrettyPrint: return buffer + def formatGenericType( + self, generic: GenericConstantInterfaceItem, level: int = 0 + ) -> StringBuffer: + buffer = [] + prefix = " " * level + + buffer.append( + "{prefix} - type {name}".format( + prefix=prefix, + name=generic.Name, + ) + ) + + return buffer + def formatPortSignal( self, port: PortSignalInterfaceItem, level: int = 0 ) -> StringBuffer: |