From 5d03cc8b3750fe293e0bbfeddfc0e1ed660ac4bf Mon Sep 17 00:00:00 2001 From: JHertz5 Date: Sun, 24 Aug 2025 21:30:25 +0100 Subject: [PATCH] #1491: Updated parsing to avoid misidentifying range attributes as range keywords. --- vsg/vhdlFile/classify/discrete_range.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vsg/vhdlFile/classify/discrete_range.py b/vsg/vhdlFile/classify/discrete_range.py index 8bf99a41..8466fbb2 100644 --- a/vsg/vhdlFile/classify/discrete_range.py +++ b/vsg/vhdlFile/classify/discrete_range.py @@ -47,6 +47,11 @@ def classify_until(lUntils, iToken, lObjects): elif iOpenParenthesis == iCloseParenthesis: if lObjects[iCurrent].get_lower_value() in lUntils: break + elif utils.is_next_token("'", iToken, lObjects): + # Ensure that range attributes are not misidentified as range keywords. + utils.assign_token(lObjects, iCurrent, parser.todo) + iCurrent = utils.find_next_token(iCurrent, lObjects) + utils.assign_token(lObjects, iCurrent, parser.todo) elif utils.is_next_token("range", iToken, lObjects): utils.assign_token(lObjects, iCurrent, range_constraint.range_keyword) else: