g2384 / VHDLFormatter

VHDL formatter web online written in typescript
https://g2384.github.io/VHDLFormatter/
MIT License
52 stars 20 forks source link

Procedures in package bodies are not indented correctly #7

Closed goglecm closed 6 years ago

goglecm commented 6 years ago

Here is the original code:


package body A_MAIN_ASYNC_PKG is
    procedure wait_until(
        signal a : in boolean;
        b        : boolean
    ) is
    begin
        if (a /= b) then
            wait until a = b;
        end if;
    end procedure wait_until;

end A_MAIN_ASYNC_PKG;

and here is how it gets formatted


package body A_MAIN_ASYNC_PKG is
    procedure wait_until(
        signal a : in boolean;
        b        : boolean
    ) is
begin
    if (a /= b) then
        wait until a = b;
    end if;
end procedure wait_until;

end A_MAIN_ASYNC_PKG;

As you can see all the lines starting from the keyword begin have been indented to the left for no reason. Here is how it should be formatted.


package body A_MAIN_ASYNC_PKG is
    procedure wait_until(
        signal a : in boolean;
        b        : boolean
    ) is
    begin
        if (a /= b) then
            wait until a = b;
        end if;
    end procedure wait_until;

end A_MAIN_ASYNC_PKG;
g2384 commented 6 years ago

Fixed