Issue 1474: Add 2019 standard and its reserved keywords (#1476)
* Add 2019 standard and its reserved keywords Resolves #1474 * Update vsg/rules/reserved/rule_001.py Fixed spelling. Co-authored-by: Jukka Hertzog <jukka.hertzog@live.co.uk> --------- Co-authored-by: Jeremiah Leary <jeremiah.c.leary@gmail.com> Co-authored-by: Jukka Hertzog <jukka.hertzog@live.co.uk>
This commit is contained in:
parent
068f9102ef
commit
a8e061a92f
|
|
@ -28,11 +28,14 @@ These rules provide the following options:
|
|||
.. |standard__2008| replace::
|
||||
:code:`2008` = Use reserved keywords from 2008 standard
|
||||
|
||||
.. |standard__2019| replace::
|
||||
:code:`2019` = Use reserved keywords from 2019 standard
|
||||
|
||||
.. |standard__all| replace::
|
||||
:code:`all` = Use reserved keywords from all standards
|
||||
|
||||
.. |values| replace::
|
||||
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`
|
||||
:code:`1987`, :code:`1993`, :code:`2000`, :code:`2002`, :code:`2008`, :code:`2019`
|
||||
|
||||
.. |default_value| replace::
|
||||
:code:`all`
|
||||
|
|
@ -45,6 +48,7 @@ These rules provide the following options:
|
|||
| | | | * |standard__2000| |
|
||||
| | | | * |standard__2002| |
|
||||
| | | | * |standard__2008| |
|
||||
| | | | * |standard__2019| |
|
||||
| | | | * |standard__all| |
|
||||
+----------------------+----------+-----------------+----------------------------+
|
||||
|
||||
|
|
@ -96,6 +100,19 @@ The :code:`context` keyword is a reserved word in the 2008 standard.
|
|||
end entity;
|
||||
|
||||
|
||||
Example: |standard_option| set to :code:`2019`
|
||||
##############################################
|
||||
|
||||
The :code:`private` keyword is a reserved word in the 2019 standard.
|
||||
|
||||
**Violation**
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
entity private is
|
||||
end entity;
|
||||
|
||||
|
||||
Rules Enforcing Optional Items
|
||||
##############################
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
-- Making identifiers out of reserved keywords to test the awesome vsg project
|
||||
|
||||
entity null is -- 'null' is a reserved keyword since 1987
|
||||
entity null is -- 'null' is a reserved keyword since 1987
|
||||
generic (
|
||||
default : natural; -- 'default' is a reserved keyword since 2008
|
||||
unaffected : natural -- 'unaffected' is a reserved keyword since 1993
|
||||
vpkg : positive; -- 'vpkg' is a reserved keyword since 2019
|
||||
default : natural; -- 'default' is a reserved keyword since 2008
|
||||
unaffected : natural -- 'unaffected' is a reserved keyword since 1993
|
||||
);
|
||||
port (
|
||||
private : out natural; -- 'private' since 2019
|
||||
|
|
@ -19,6 +20,7 @@ end entity null; -- 'null' since 1987
|
|||
|
||||
architecture rol of null is -- 'rol' since 1993, 'null' since 1987
|
||||
|
||||
signal view : boolean; -- 'view' since 2019
|
||||
signal procedural : natural; -- 'procedural' reserved in 2002 and not in 2008
|
||||
signal open : natural; -- 'open' reserved since 1987
|
||||
signal wilbur : std_logic; -- legal
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class test_reserved_rule(unittest.TestCase):
|
|||
self.assertEqual(oRule.identifier, "001")
|
||||
self.assertFalse(oRule.fixable)
|
||||
|
||||
lExpected = [7, 9, 10, 14, 18, 20, 20, 22, 23, 28, 28, 30, 36, 42]
|
||||
lExpected = [7, 9, 10, 11, 14, 15, 19, 21, 21, 23, 24, 25, 30, 30, 32, 38, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
@ -34,7 +34,7 @@ class test_reserved_rule(unittest.TestCase):
|
|||
oRule = reserved.rule_001()
|
||||
oRule.standard = "1987"
|
||||
|
||||
lExpected = [7, 10, 18, 20, 20, 23, 28, 42]
|
||||
lExpected = [7, 11, 19, 21, 21, 25, 30, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
@ -43,7 +43,7 @@ class test_reserved_rule(unittest.TestCase):
|
|||
oRule = reserved.rule_001()
|
||||
oRule.standard = "1987"
|
||||
|
||||
lExpected = [7, 10, 18, 20, 20, 23, 28, 42]
|
||||
lExpected = [7, 11, 19, 21, 21, 25, 30, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
@ -52,7 +52,7 @@ class test_reserved_rule(unittest.TestCase):
|
|||
oRule = reserved.rule_001()
|
||||
oRule.standard = "2000"
|
||||
|
||||
lExpected = [7, 10, 18, 20, 20, 22, 23, 28, 30, 42]
|
||||
lExpected = [7, 11, 19, 21, 21, 24, 25, 30, 32, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
@ -61,7 +61,7 @@ class test_reserved_rule(unittest.TestCase):
|
|||
oRule = reserved.rule_001()
|
||||
oRule.standard = "2002"
|
||||
|
||||
lExpected = [7, 10, 18, 20, 20, 22, 23, 28, 30, 42]
|
||||
lExpected = [7, 11, 19, 21, 21, 24, 25, 30, 32, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
@ -70,7 +70,16 @@ class test_reserved_rule(unittest.TestCase):
|
|||
oRule = reserved.rule_001()
|
||||
oRule.standard = "2008"
|
||||
|
||||
lExpected = [7, 9, 10, 14, 18, 20, 20, 23, 28, 28, 36, 42]
|
||||
lExpected = [7, 10, 11, 15, 19, 21, 21, 25, 30, 30, 38, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
||||
def test_2019_standard(self):
|
||||
oRule = reserved.rule_001()
|
||||
oRule.standard = "2019"
|
||||
|
||||
lExpected = [7, 9, 10, 11, 14, 15, 19, 21, 21, 23, 25, 30, 30, 38, 44]
|
||||
|
||||
oRule.analyze(self.oFile)
|
||||
self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))
|
||||
|
|
|
|||
|
|
@ -538,6 +538,125 @@ dMap["2008"] = [
|
|||
"xnor",
|
||||
"xor",
|
||||
]
|
||||
# https://www.0x04.net/~mwk/vstd/ieee-1076-2019.pdf, p. 266-267, 15.10: Reserved Words
|
||||
dMap["2019"] = [
|
||||
"abs",
|
||||
"access",
|
||||
"after",
|
||||
"alias",
|
||||
"all",
|
||||
"and",
|
||||
"architecture",
|
||||
"array",
|
||||
"assert",
|
||||
"assume",
|
||||
"attribute",
|
||||
"begin",
|
||||
"block",
|
||||
"body",
|
||||
"buffer",
|
||||
"bus",
|
||||
"case",
|
||||
"component",
|
||||
"configuration",
|
||||
"constant",
|
||||
"context",
|
||||
"cover",
|
||||
"default",
|
||||
"disconnect",
|
||||
"downto",
|
||||
"else",
|
||||
"elsif",
|
||||
"end",
|
||||
"entity",
|
||||
"exit",
|
||||
"fairness",
|
||||
"file",
|
||||
"for",
|
||||
"force",
|
||||
"function",
|
||||
"generate",
|
||||
"generic",
|
||||
"group",
|
||||
"guarded",
|
||||
"if",
|
||||
"impure",
|
||||
"in",
|
||||
"inertial",
|
||||
"inout",
|
||||
"is",
|
||||
"label",
|
||||
"library",
|
||||
"linkage",
|
||||
"literal",
|
||||
"loop",
|
||||
"map",
|
||||
"mod",
|
||||
"nand",
|
||||
"new",
|
||||
"next",
|
||||
"nor",
|
||||
"not",
|
||||
"null",
|
||||
"of",
|
||||
"on",
|
||||
"open",
|
||||
"or",
|
||||
"others",
|
||||
"out",
|
||||
"package",
|
||||
"parameter",
|
||||
"port",
|
||||
"postponed",
|
||||
"procedure",
|
||||
"process",
|
||||
"property",
|
||||
"protected",
|
||||
"private",
|
||||
"pure",
|
||||
"range",
|
||||
"record",
|
||||
"register",
|
||||
"reject",
|
||||
"release",
|
||||
"rem",
|
||||
"report",
|
||||
"restrict",
|
||||
"return",
|
||||
"rol",
|
||||
"ror",
|
||||
"select",
|
||||
"sequence",
|
||||
"severity",
|
||||
"signal",
|
||||
"shared",
|
||||
"sla",
|
||||
"sll",
|
||||
"sra",
|
||||
"srl",
|
||||
"strong",
|
||||
"subtype",
|
||||
"then",
|
||||
"to",
|
||||
"transport",
|
||||
"type",
|
||||
"unaffected",
|
||||
"units",
|
||||
"until",
|
||||
"use",
|
||||
"variable",
|
||||
"view",
|
||||
"vpkg",
|
||||
"vmode",
|
||||
"vprop",
|
||||
"vunit",
|
||||
"wait",
|
||||
"when",
|
||||
"while",
|
||||
"with",
|
||||
"xnor",
|
||||
"xor",
|
||||
]
|
||||
dMap["all"] = uniquify_standards(dMap)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue