From ec37f2b5efe56d442ea51d3e10d16742f3cd4bce Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 21 Jun 2021 15:21:06 +0200 Subject: Minimal handling of types and subtypes. --- pyGHDL/dom/formatting/prettyprint.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pyGHDL/dom/formatting/prettyprint.py') 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.") -- cgit v1.2.3