aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/formatting
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-21 15:21:06 +0200
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-22 12:26:59 +0200
commitec37f2b5efe56d442ea51d3e10d16742f3cd4bce (patch)
tree5ca20e3522b1aa2d3b74827eb299941c2686fc06 /pyGHDL/dom/formatting
parent19ba3d3e37b02e870ed6c6e283c267d904cafac8 (diff)
downloadghdl-ec37f2b5efe56d442ea51d3e10d16742f3cd4bce.tar.gz
ghdl-ec37f2b5efe56d442ea51d3e10d16742f3cd4bce.tar.bz2
ghdl-ec37f2b5efe56d442ea51d3e10d16742f3cd4bce.zip
Minimal handling of types and subtypes.
Diffstat (limited to 'pyGHDL/dom/formatting')
-rw-r--r--pyGHDL/dom/formatting/prettyprint.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pyGHDL/dom/formatting/prettyprint.py b/pyGHDL/dom/formatting/prettyprint.py
index 1577edca0..8f95a412e 100644
--- a/pyGHDL/dom/formatting/prettyprint.py
+++ b/pyGHDL/dom/formatting/prettyprint.py
@@ -2,6 +2,7 @@ from typing import List, Union
from pydecor import export
+from pyGHDL.dom.Type import IntegerType, SubType
from pyVHDLModel.VHDLModel import (
GenericInterfaceItem,
NamedEntity,
@@ -293,6 +294,23 @@ class PrettyPrint:
else "",
)
)
+ elif isinstance(item, IntegerType):
+ buffer.append(
+ "{prefix}- type {name} is range {range}".format(
+ prefix=prefix,
+ name=item.Name,
+ range="{left!s} to {right!s}".format(
+ left=item.LeftBound, right=item.RightBound
+ ),
+ )
+ )
+ elif isinstance(item, SubType):
+ buffer.append(
+ "{prefix}- subtype {name} is ?????".format(
+ prefix=prefix,
+ name=item.Name,
+ )
+ )
else:
raise PrettyPrintException("Unhandled declared item kind.")