#892 (#893): VSG would crash if code after last ) in array assignment

* Issue #892:  VSG would crash if code after last ) in array assignment was on a different line.

* Refactoring to improve readability.
This commit is contained in:
Jeremiah Leary 2022-12-01 06:03:11 -06:00 committed by GitHub
parent ead8c07780
commit cb2cca006a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 2 deletions

View File

@ -159,7 +159,8 @@ def check_last_line(oLine, oLines, iIndentStep):
def check_middle_line(oLine, oLines, iIndentStep):
set_expected_indent_of_line(oLine, oLines, iIndentStep)
oLines.update_parens(oLine, iIndentStep)
oLines.iNextIndent = oLines.lParens[-1].iExpectedColumn
if not oLines.no_parens():
oLines.iNextIndent = oLines.lParens[-1].iExpectedColumn
def set_expected_indent_of_line(oLine, oLines, iIndentStep):

View File

@ -19,6 +19,13 @@ begin
cnt_out => "00")
);
rd_data <=
(
others => '0'
)
after 4 ns
;
end process;
end architecture rtl;

View File

@ -19,6 +19,13 @@ rst_in => "00",
cnt_out => "00")
);
rd_data <=
(
others => '0'
)
after 4 ns
;
end process;
end architecture rtl;

View File

@ -28,7 +28,7 @@ class test_sequential_rule(unittest.TestCase):
self.assertEqual(oRule.identifier, '402')
self.assertEqual(oRule.groups, ['alignment'])
lExpected = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
lExpected = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27]
oRule.analyze(self.oFile)
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))