41 lines
910 B
Python
41 lines
910 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from vsg import token
|
|
from vsg.rules import multiline_alignment_between_tokens as Rule
|
|
|
|
lTokenPairs = []
|
|
lTokenPairs.append([token.variable_declaration.variable_keyword, token.variable_declaration.semicolon])
|
|
|
|
|
|
class rule_400(Rule):
|
|
"""
|
|
This rule checks alignment of multiline constraints in variable declarations.
|
|
|
|
|configuring_multiline_indent_rules_link|
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
variable v_element : my_record(
|
|
element1(7 downto 0),
|
|
element2(3 downto 0)
|
|
);
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
variable v_element : my_record(
|
|
element1(7 downto 0),
|
|
element2(3 downto 0)
|
|
);
|
|
"""
|
|
|
|
def __init__(self):
|
|
super().__init__(lTokenPairs)
|
|
self.phase = 5
|
|
self.subphase = 3
|
|
self.bIgnoreStartParen = True
|
|
self.bConstraint = True
|