From 9242dc60da7bf7fec67c098b1bb4253bcdbd84af Mon Sep 17 00:00:00 2001 From: Jeremiah Leary Date: Thu, 11 Mar 2021 07:29:36 -0600 Subject: [PATCH] Updates for issue #499: Temporary commit of updates to concurrent_003. --- vsg/rules/multiline_alignment_between_tokens.py | 9 +++++---- ...03_test_input.fixed_align_left_no_align_paren_yes.vhd | 7 +++++++ ...03_test_input.fixed_align_left_yes_align_paren_no.vhd | 7 +++++++ ...3_test_input.fixed_align_left_yes_align_paren_yes.vhd | 7 +++++++ vsg/tests/concurrent/rule_003_test_input.vhd | 7 +++++++ vsg/tests/concurrent/test_rule_003.py | 6 +++--- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/vsg/rules/multiline_alignment_between_tokens.py b/vsg/rules/multiline_alignment_between_tokens.py index 6c885ccf..6dbb729e 100644 --- a/vsg/rules/multiline_alignment_between_tokens.py +++ b/vsg/rules/multiline_alignment_between_tokens.py @@ -202,10 +202,9 @@ def _set_indent(iToken, lTokens): def _analyze_align_paren_no(iFirstLine, iLastLine, lParens, iIndentStep, dActualIndent, bStartsWithParen): -# print('--> _analyze_align_paren_no <-' + '-'*70) + print('--> _analyze_align_paren_no <-' + '-'*70) dExpectedIndent = {} dExpectedIndent[iFirstLine] = dActualIndent[iFirstLine] -# print(iIndent) if bStartsWithParen: iFirstIndent = dActualIndent[iFirstLine] else: @@ -213,10 +212,11 @@ def _analyze_align_paren_no(iFirstLine, iLastLine, lParens, iIndentStep, dActual iIndent = iFirstIndent + print(iIndent) iParens = 0 for iLine in range(iFirstLine, iLastLine + 1): -# print('--> ' + str(iLine) + ' <--------------------------') + print('--> ' + str(iLine) + ' <--------------------------') lTemp = [] for dParen in lParens: @@ -241,7 +241,7 @@ def _analyze_align_paren_no(iFirstLine, iLastLine, lParens, iIndentStep, dActual iIndent = iFirstIndent + iParens * iIndentStep else: iIndent = iFirstIndent + iParens * iIndentStep + iIndentStep -# iIndent = iFirstIndent + iParens * iIndentStep +# iIndent = iFirstIndent + iParens * iIndentStep else: if iParens == 0: iIndent = iFirstIndent + iParens * iIndentStep @@ -255,6 +255,7 @@ def _analyze_align_paren_no(iFirstLine, iLastLine, lParens, iIndentStep, dActual # print(f'indent = {iIndent} | iPerens = {iParens}') dExpectedIndent[iLine + 1] = iIndent + print(dExpectedIndent) return dExpectedIndent diff --git a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_yes.vhd b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_yes.vhd index 9c2e4e04..228bf6b4 100644 --- a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_yes.vhd +++ b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_no_align_paren_yes.vhd @@ -16,4 +16,11 @@ begin n_foo <= resize(unsigned(I_FOO) + unsigned(I_BAR), q_foo'length); + O_FOO <= + ( + 1 => func1(std_logic_vector(G_GEN1), G_GEN2), + 2 => func2(func3(G_GEN3), G_GEN3), + 3 => func4(G_GEN4) + ); + end architecture RTL; diff --git a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_no.vhd b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_no.vhd index 34df0c23..2bf222da 100644 --- a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_no.vhd +++ b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_no.vhd @@ -16,4 +16,11 @@ begin n_foo <= resize(unsigned(I_FOO) + unsigned(I_BAR), q_foo'length); + O_FOO <= + ( + 1 => func1(std_logic_vector(G_GEN1), G_GEN2), + 2 => func2(func3(G_GEN3), G_GEN3), + 3 => func4(G_GEN4) + ); + end architecture RTL; diff --git a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_yes.vhd b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_yes.vhd index 34df0c23..2bf222da 100644 --- a/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_yes.vhd +++ b/vsg/tests/concurrent/rule_003_test_input.fixed_align_left_yes_align_paren_yes.vhd @@ -16,4 +16,11 @@ begin n_foo <= resize(unsigned(I_FOO) + unsigned(I_BAR), q_foo'length); + O_FOO <= + ( + 1 => func1(std_logic_vector(G_GEN1), G_GEN2), + 2 => func2(func3(G_GEN3), G_GEN3), + 3 => func4(G_GEN4) + ); + end architecture RTL; diff --git a/vsg/tests/concurrent/rule_003_test_input.vhd b/vsg/tests/concurrent/rule_003_test_input.vhd index 74e60220..1aafc2ad 100644 --- a/vsg/tests/concurrent/rule_003_test_input.vhd +++ b/vsg/tests/concurrent/rule_003_test_input.vhd @@ -16,4 +16,11 @@ begin n_foo <= resize(unsigned(I_FOO) + unsigned(I_BAR), q_foo'length); + O_FOO <= + ( + 1 => func1(std_logic_vector(G_GEN1), G_GEN2), + 2 => func2(func3(G_GEN3), G_GEN3), +3 => func4(G_GEN4) + ); + end architecture RTL; diff --git a/vsg/tests/concurrent/test_rule_003.py b/vsg/tests/concurrent/test_rule_003.py index a976b0bb..96a9cbfe 100644 --- a/vsg/tests/concurrent/test_rule_003.py +++ b/vsg/tests/concurrent/test_rule_003.py @@ -37,7 +37,7 @@ class test_concurrent_rule(unittest.TestCase): self.assertEqual(oRule.name, 'concurrent') self.assertEqual(oRule.identifier, '003') - lExpected = [14, 17] + lExpected = [14, 17, 20, 21, 22, 23, 24] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) @@ -61,7 +61,7 @@ class test_concurrent_rule(unittest.TestCase): oRule.align_left = 'yes' oRule.align_paren = 'no' - lExpected = [8, 11, 14, 17] + lExpected = [8, 11, 14, 17, 20, 21, 22, 23, 24] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) @@ -85,7 +85,7 @@ class test_concurrent_rule(unittest.TestCase): oRule.align_left = 'yes' oRule.align_paren = 'yes' - lExpected = [8, 11, 14, 17] + lExpected = [8, 11, 14, 17, 20, 21, 22, 23, 24] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))