From 3f3cf203c02671ab4d181d8d74aac2c3cc2c7c5c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 19 Jun 2021 14:04:02 +0200 Subject: Fixed missed renaming. Removed formatRange. --- pyGHDL/dom/formatting/prettyprint.py | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'pyGHDL') diff --git a/pyGHDL/dom/formatting/prettyprint.py b/pyGHDL/dom/formatting/prettyprint.py index 08f934fd6..1577edca0 100644 --- a/pyGHDL/dom/formatting/prettyprint.py +++ b/pyGHDL/dom/formatting/prettyprint.py @@ -4,11 +4,8 @@ from pydecor import export from pyVHDLModel.VHDLModel import ( GenericInterfaceItem, - Direction, - Mode, NamedEntity, PortInterfaceItem, - IdentityExpression, WithDefaultExpression, ) @@ -23,7 +20,6 @@ from pyGHDL.dom.DesignUnit import ( Context, ) from pyGHDL.dom.Object import Constant, Signal -from pyGHDL.dom.Range import Range from pyGHDL.dom.InterfaceItem import ( GenericConstantInterfaceItem, PortSignalInterfaceItem, @@ -32,17 +28,7 @@ from pyGHDL.dom.Symbol import ( SimpleSubTypeSymbol, ConstrainedSubTypeSymbol, ) -from pyGHDL.dom.Expression import ( - SubtractionExpression, - AdditionExpression, - MultiplyExpression, - DivisionExpression, - InverseExpression, - AbsoluteExpression, - NegationExpression, - ExponentiationExpression, - ParenthesisExpression, -) + StringBuffer = List[str] @@ -291,7 +277,7 @@ class PrettyPrint: subtype=self.formatSubtypeIndication( item.SubType, "constant", item.Name ), - expr=self.formatExpression(item.DefaultExpression), + expr=str(item.DefaultExpression), ) ) elif isinstance(item, Signal): @@ -302,9 +288,7 @@ class PrettyPrint: subtype=self.formatSubtypeIndication( item.SubType, "signal", item.Name ), - initValue=" := {expr}".format( - expr=self.formatExpression(item.DefaultExpression) - ) + initValue=" := {expr}".format(expr=str(item.DefaultExpression)) if item.DefaultExpression is not None else "", ) @@ -318,12 +302,8 @@ class PrettyPrint: if isinstance(subTypeIndication, SimpleSubTypeSymbol): return "{type}".format(type=subTypeIndication.SymbolName) elif isinstance(subTypeIndication, ConstrainedSubTypeSymbol): - constraints = ", ".join( - [ - self.formatRange(constraint.Range) - for constraint in subTypeIndication.Constraints - ] - ) + ranges = [str(c.Range) for c in subTypeIndication.Constraints] + constraints = ", ".join(ranges) return "{type}({constraints})".format( type=subTypeIndication.SymbolName, constraints=constraints @@ -340,6 +320,3 @@ class PrettyPrint: return "" return " := {expr!s}".format(expr=item.DefaultExpression) - - def formatRange(self, r: Range): - return str(r) -- cgit v1.2.3