Open JHertz5 opened 1 week ago
Similar problems discovered with package_body_400
, package_body_401
, and architecture_026
.
Expected output
package test is
type flag_pt is protected
procedure set;
procedure clear;
impure function get return boolean;
end protected;
end package test;
package body test is
constant c_my_const : boolean := false;
type flag_pt is protected body
variable flag : boolean;
variable flags : boolean;
constant test : integer := 1;
end protected body;
end package body test;
architecture rtl of test is
type flag_pt is protected
procedure set;
procedure clear;
impure function get return boolean;
end protected;
constant c_my_const : boolean := false;
type flag_pt is protected body
variable flag : boolean;
variable flags : boolean;
constant test : integer := 1;
end protected body;
begin
end architecture rtl;
(with type_010
) disabled is corrected to
package test is
type flag_pt is protected
procedure set;
procedure clear;
impure function get return boolean;
end protected;
end package test;
package body test is
constant c_my_const : boolean := false;
type flag_pt is protected body
variable flag : boolean;
variable flags : boolean;
constant test : integer := 1;
end protected body;
end package body test;
architecture rtl of test is
type flag_pt is protected
procedure set;
procedure clear;
impure function get return boolean;
end protected;
constant c_my_const : boolean := false;
type flag_pt is protected body
variable flag : boolean;
variable flags : boolean;
constant test : integer := 1;
end protected body;
begin
end architecture rtl;
Other declarative regions to consider:
I've raised PR #1296 to address this issue.
Environment VSG v3.27.0
Describe the bug The rule
architecture_029
modifies the alignment of declarations within the declarative region of protected types as if they are a normal part of the architecture's declarative region. It's likely that other declarative regions in which protected types may be declared will suffer from similar problems.To Reproduce Steps to reproduce the behavior:
Create test file
begin
end architecture rtl;
Expected behavior