forked from jeremiah-c-leary/vhdl-style-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrule_011.py
More file actions
38 lines (27 loc) · 829 Bytes
/
rule_011.py
File metadata and controls
38 lines (27 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
from vsg import token
from vsg.rules import remove_carriage_return_after_token as Rule
lTokens = []
lTokens.append(token.selected_expressions.when_keyword)
lTokens.append(token.selected_waveforms.when_keyword)
class rule_011(Rule):
"""
This rule checks the choice is on the same line as the **when** keyword.
**Violation**
.. code-block:: vhdl
with
mux_sel select addr <=
"0000" when
0,
"0001" when 1,
"1111" when others;
**Fix**
.. code-block:: vhdl
with mux_sel select addr <=
"0000" when 0,
"0001" when 1,
"1111" when others;
"""
def __init__(self):
super().__init__(lTokens, bInsertSpace=True)
self.solution = "Removed carriage returns after when keyword"