From bc693d0a5a725a2806656117d65b926150e71cb4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 18 Jun 2021 18:26:19 +0200 Subject: Better aggregate handling --- pyGHDL/dom/Aggregates.py | 21 +++++++++++++++++---- pyGHDL/dom/formatting/prettyprint.py | 17 +++++++++-------- testsuite/pyunit/SimpleEntity.vhdl | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/pyGHDL/dom/Aggregates.py b/pyGHDL/dom/Aggregates.py index 5a77b7e37..89acfa312 100644 --- a/pyGHDL/dom/Aggregates.py +++ b/pyGHDL/dom/Aggregates.py @@ -41,6 +41,8 @@ This module contains all DOM classes for VHDL's design units (:class:`context str: + return "{left} {dir} {right}".format( + left=self.formatExpression(r.LeftBound), + right=self.formatExpression(r.RightBound), + dir=DirectionTranslation[r.Direction], + ) + def formatExpression(self, expression: Expression) -> str: if isinstance(expression, SimpleObjectSymbol): return "{name}".format(name=expression.SymbolName) diff --git a/testsuite/pyunit/SimpleEntity.vhdl b/testsuite/pyunit/SimpleEntity.vhdl index 8d5b034bb..12068c06d 100644 --- a/testsuite/pyunit/SimpleEntity.vhdl +++ b/testsuite/pyunit/SimpleEntity.vhdl @@ -29,7 +29,7 @@ begin end architecture behav; package package_1 is - constant ghdl : float := (3, 5); -- 2.3; + constant ghdl : float := (3, 5, 0 => 5, 3 => 4, name => 10); -- 2.3; end package; package body package_1 is -- cgit v1.2.3