Adding indenting for package_body.

This commit is contained in:
Jeremiah Leary 2020-11-23 19:01:37 -06:00
parent d706afaa27
commit 4772e9949f
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,18 @@
from vsg.token import package_body as token
def set_indent(iCurrentIndent, bLabelFound, oToken):
iIndent = iCurrentIndent
bMyLabelFound = bLabelFound
if isinstance(oToken, token.package_keyword):
oToken.set_indent(iIndent)
iIndent += 1
if isinstance(oToken, token.end_keyword):
iIndent -= 1
oToken.set_indent(iIndent)
return iIndent, bMyLabelFound

View File

@ -30,6 +30,7 @@ from vsg.vhdlFile.indent import generate_statement
from vsg.vhdlFile.indent import generic_clause
from vsg.vhdlFile.indent import port_clause
from vsg.vhdlFile.indent import if_statement
from vsg.vhdlFile.indent import package_body
from vsg.vhdlFile.indent import package_declaration
from vsg.vhdlFile.indent import simple_signal_assignment
from vsg.vhdlFile.indent import signal_declaration
@ -382,6 +383,7 @@ class vhdlFile():
iIndent, bLabelFound = generic_clause.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = port_clause.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = if_statement.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = package_body.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = package_declaration.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = simple_signal_assignment.set_indent(iIndent, bLabelFound, oToken)
iIndent, bLabelFound = signal_declaration.set_indent(iIndent, bLabelFound, oToken)