Updates for issue #203

Made process detection ignore commented out code.

  1)  Updated test
  2)  Updated classifier
This commit is contained in:
Jeremiah C Leary 2019-02-11 18:13:50 -06:00
parent 78ba6e0706
commit 5f5eee4571
3 changed files with 10 additions and 5 deletions

View File

@ -130,7 +130,12 @@ proc_name : process (one, two, three) is
begin
end process;
--PROC_NAME : process (one) is
--
-- begin
--
-- end process;
end architecture ARCH;

View File

@ -11,7 +11,7 @@ oFileProcess = vhdlFile.vhdlFile(os.path.join(os.path.dirname(__file__),'..','pr
class testVhdlFileMethods(unittest.TestCase):
def test_comment_assignment(self):
lExpected = [8,21,50,76,83,90,114]
lExpected = [8,21,50,76,83,90,114,134,135,136,137,138]
# Generic actual list
lActual = []
for iIndex, oLine in enumerate(oFileProcess.lines):
@ -101,7 +101,7 @@ class testVhdlFileMethods(unittest.TestCase):
self.assertEqual(lActual, lExpected)
def test_end_architecture_assignment(self):
lExpected = [135]
lExpected = [140]
# Generic actual list
lActual = []
for iIndex, oLine in enumerate(oFileProcess.lines):

View File

@ -19,12 +19,12 @@ def classify_process_keyword(dVars, oLine):
oLine.insideProcess = True
oLine.indentLevel = dVars['iCurrentIndentLevel']
dVars['iCurrentIndentLevel'] += 1
if re.match('^\s*\S+\s*:\s*process', oLine.lineLower):
if re.match('^\s*\S+\s*:\s*process', oLine.lineLower) and not oLine.isComment:
oLine.isProcessKeyword = True
oLine.insideProcess = True
oLine.indentLevel = dVars['iCurrentIndentLevel']
oLine.isProcessLabel = True
if re.match('^\s*\S+\s*:\s*process\s*$', oLine.lineNoComment):
if re.match('^\s*\S+\s*:\s*process\s*$', oLine.lineNoComment) and not oLine.isComment:
dVars['iCurrentIndentLevel'] += 1