aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/formatting
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2021-06-18 19:25:53 +0200
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-19 15:25:07 +0200
commita81f2f777e30dadc775380a362c7fe38280a5234 (patch)
tree932d9722504f1884e07e86ecfd099da437b5be91 /pyGHDL/dom/formatting
parentbc693d0a5a725a2806656117d65b926150e71cb4 (diff)
downloadghdl-a81f2f777e30dadc775380a362c7fe38280a5234.tar.gz
ghdl-a81f2f777e30dadc775380a362c7fe38280a5234.tar.bz2
ghdl-a81f2f777e30dadc775380a362c7fe38280a5234.zip
pyGHDL: run black
Diffstat (limited to 'pyGHDL/dom/formatting')
-rw-r--r--pyGHDL/dom/formatting/prettyprint.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/pyGHDL/dom/formatting/prettyprint.py b/pyGHDL/dom/formatting/prettyprint.py
index a2ad6e949..7b5807cc2 100644
--- a/pyGHDL/dom/formatting/prettyprint.py
+++ b/pyGHDL/dom/formatting/prettyprint.py
@@ -2,7 +2,13 @@ from typing import List, Union
from pydecor import export
-from pyGHDL.dom.Aggregates import SimpleAggregateElement, IndexedAggregateElement, RangedAggregateElement, NamedAggregateElement, OthersAggregateElement
+from pyGHDL.dom.Aggregates import (
+ SimpleAggregateElement,
+ IndexedAggregateElement,
+ RangedAggregateElement,
+ NamedAggregateElement,
+ OthersAggregateElement,
+)
from pyGHDL.dom.Object import Constant, Signal
from pyGHDL.dom.Range import Range
from pyVHDLModel.VHDLModel import (
@@ -16,7 +22,7 @@ from pyVHDLModel.VHDLModel import (
IdentityExpression,
UnaryExpression,
WithDefaultExpression,
- AggregateElement
+ AggregateElement,
)
from pyGHDL import GHDLBaseException
@@ -48,7 +54,8 @@ from pyGHDL.dom.Expression import (
InverseExpression,
AbsoluteExpression,
NegationExpression,
- ExponentiationExpression, Aggregate,
+ ExponentiationExpression,
+ Aggregate,
)
StringBuffer = List[str]
@@ -323,7 +330,10 @@ class PrettyPrint:
return "{type}".format(type=subTypeIndication.SymbolName)
elif isinstance(subTypeIndication, ConstrainedSubTypeSymbol):
constraints = ", ".join(
- [self.formatRange(constraint.Range) for constraint in subTypeIndication.Constraints]
+ [
+ self.formatRange(constraint.Range)
+ for constraint in subTypeIndication.Constraints
+ ]
)
return "{type}({constraints})".format(
@@ -379,7 +389,14 @@ class PrettyPrint:
operator=operator,
)
elif isinstance(expression, Aggregate):
- return "({choices})".format(choices=", ".join([self.formatAggregateElement(element) for element in expression.Elements]))
+ return "({choices})".format(
+ choices=", ".join(
+ [
+ self.formatAggregateElement(element)
+ for element in expression.Elements
+ ]
+ )
+ )
else:
raise PrettyPrintException("Unhandled expression kind.")
@@ -391,17 +408,17 @@ class PrettyPrint:
elif isinstance(aggregateElement, IndexedAggregateElement):
return "{index} => {value}".format(
index=self.formatExpression(aggregateElement.Index),
- value=self.formatExpression(aggregateElement.Expression)
+ value=self.formatExpression(aggregateElement.Expression),
)
elif isinstance(aggregateElement, RangedAggregateElement):
return "{range} => {value}".format(
range=self.formatRange(aggregateElement.Range),
- value=self.formatExpression(aggregateElement.Expression)
+ value=self.formatExpression(aggregateElement.Expression),
)
elif isinstance(aggregateElement, NamedAggregateElement):
return "{name} => {value}".format(
name=aggregateElement.Name,
- value=self.formatExpression(aggregateElement.Expression)
+ value=self.formatExpression(aggregateElement.Expression),
)
elif isinstance(aggregateElement, OthersAggregateElement):
return "other => {value}".format(