diff options
Diffstat (limited to 'pyGHDL/dom/_Translate.py')
-rw-r--r-- | pyGHDL/dom/_Translate.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pyGHDL/dom/_Translate.py b/pyGHDL/dom/_Translate.py index 146c3443a..54c52614c 100644 --- a/pyGHDL/dom/_Translate.py +++ b/pyGHDL/dom/_Translate.py @@ -334,7 +334,13 @@ def GetScalarConstrainedSubtypeFromNode( typeMarkName = GetNameOfNode(typeMark) simpleTypeMark = SimpleName(typeMark, typeMarkName) rangeConstraint = nodes.Get_Range_Constraint(subtypeIndicationNode) - r = GetRangeFromNode(rangeConstraint) + + r = None + # Check if RangeExpression. Might also be an AttributeName (see ยง3.1) + if GetIirKindOfNode(rangeConstraint) == nodes.Iir_Kind.Range_Expression: + r = GetRangeFromNode(rangeConstraint) + #todo: Get actual range from AttributeName node? + return ConstrainedScalarSubtypeSymbol(subtypeIndicationNode, str(simpleTypeMark), r) # XXX: hacked |