diff --git a/vsg/tests/vhdlFile/loop_statement/classification_results.txt b/vsg/tests/vhdlFile/loop_statement/classification_results.txt index dcb01366..706fd25b 100644 --- a/vsg/tests/vhdlFile/loop_statement/classification_results.txt +++ b/vsg/tests/vhdlFile/loop_statement/classification_results.txt @@ -172,18 +172,32 @@ 42 | -------------------------------------------------------------------------------- -43 | +43 | FOR_LABEL : loop + + + +-------------------------------------------------------------------------------- +44 | null; + + +-------------------------------------------------------------------------------- +45 | end loop; + + + +-------------------------------------------------------------------------------- +46 | -------------------------------------------------------------------------------- -44 | end process; +47 | end process; -------------------------------------------------------------------------------- -45 | +48 | -------------------------------------------------------------------------------- -46 | end architecture RTL; +49 | end architecture RTL; diff --git a/vsg/tests/vhdlFile/loop_statement/classification_test_input.vhd b/vsg/tests/vhdlFile/loop_statement/classification_test_input.vhd index 3849b120..77bd8a35 100644 --- a/vsg/tests/vhdlFile/loop_statement/classification_test_input.vhd +++ b/vsg/tests/vhdlFile/loop_statement/classification_test_input.vhd @@ -40,6 +40,9 @@ begin end loop; + FOR_LABEL : loop + null; + end loop; end process; diff --git a/vsg/vhdlFile/classify/loop_statement.py b/vsg/vhdlFile/classify/loop_statement.py index 91433169..a02670e7 100644 --- a/vsg/vhdlFile/classify/loop_statement.py +++ b/vsg/vhdlFile/classify/loop_statement.py @@ -15,23 +15,19 @@ def detect(iToken, lObjects): sequence_of_statements end loop [ loop_label ] ; ''' - if utils.find_in_next_n_tokens(':', 2, iToken, lObjects): iCurrent = utils.find_next_token(iToken, lObjects) iCurrent += 1 - iCurrent = utils.find_next_token(iToken, lObjects) + iCurrent = utils.find_next_token(iCurrent, lObjects) iCurrent += 1 - if iteration_scheme.detect(iToken, lObjects): - return classify(iToken, lObjects) - if utils.is_next_token('loop', iToken, lObjects): - return classify(iToken, lObjects) - return iToken else: - if iteration_scheme.detect(iToken, lObjects): - return classify(iToken, lObjects) - if utils.is_next_token('loop', iToken, lObjects): - return classify(iToken, lObjects) - return iToken + iCurrent = iToken + + if iteration_scheme.detect(iCurrent, lObjects): + return classify(iToken, lObjects) + if utils.is_next_token('loop', iCurrent, lObjects): + return classify(iToken, lObjects) + return iToken @@ -41,7 +37,7 @@ def classify(iToken, lObjects): iCurrent = iteration_scheme.classify(iCurrent, lObjects) - iCurrent = utils.assign_next_token_required('loop', token.loop_keyword, iToken, lObjects) + iCurrent = utils.assign_next_token_required('loop', token.loop_keyword, iCurrent, lObjects) iCurrent = sequence_of_statements.detect(iCurrent, lObjects)