diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-20 17:23:21 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-22 12:26:59 +0200 |
commit | ee253532230b5c1904844006e2a4bd8ec8cffc1d (patch) | |
tree | 66b2391b945ff3c0c569032f71612dc86aaddc4f /pyGHDL/dom/Expression.py | |
parent | d9241cf7156ff2e8b1ce8258e780eb9c8bf1e38f (diff) | |
download | ghdl-ee253532230b5c1904844006e2a4bd8ec8cffc1d.tar.gz ghdl-ee253532230b5c1904844006e2a4bd8ec8cffc1d.tar.bz2 ghdl-ee253532230b5c1904844006e2a4bd8ec8cffc1d.zip |
Handle OthersAggregateElement properly.
Diffstat (limited to 'pyGHDL/dom/Expression.py')
-rw-r--r-- | pyGHDL/dom/Expression.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pyGHDL/dom/Expression.py b/pyGHDL/dom/Expression.py index 75d288a83..d55ea8cef 100644 --- a/pyGHDL/dom/Expression.py +++ b/pyGHDL/dom/Expression.py @@ -399,24 +399,21 @@ class Aggregate(VHDLModel_Aggregate): choicesChain = nodes.Get_Association_Choices_Chain(node) for item in utils.chain_iter(choicesChain): kind = GetIirKindOfNode(item) + value = GetExpressionFromNode(nodes.Get_Associated_Expr(item)) + if kind == nodes.Iir_Kind.Choice_By_None: - value = GetExpressionFromNode(nodes.Get_Associated_Expr(item)) choices.append(SimpleAggregateElement(value)) elif kind == nodes.Iir_Kind.Choice_By_Expression: index = GetExpressionFromNode(nodes.Get_Choice_Expression(item)) - value = GetExpressionFromNode(nodes.Get_Associated_Expr(item)) choices.append(IndexedAggregateElement(index, value)) elif kind == nodes.Iir_Kind.Choice_By_Range: r = GetRangeFromNode(nodes.Get_Choice_Range(item)) - value = GetExpressionFromNode(nodes.Get_Associated_Expr(item)) choices.append(RangedAggregateElement(r, value)) elif kind == nodes.Iir_Kind.Choice_By_Name: name = EnumerationLiteralSymbol(nodes.Get_Choice_Name(item)) - value = GetExpressionFromNode(nodes.Get_Associated_Expr(item)) choices.append(NamedAggregateElement(name, value)) elif kind == nodes.Iir_Kind.Choice_By_Others: - expression = None - choices.append(OthersAggregateElement(expression)) + choices.append(OthersAggregateElement(value)) else: raise DOMException( "Unknown choice kind '{kindName}'({kind}) in aggregate '{aggr}'.".format( |