Skip to content

--fix produces invalid syntax for subprograms #1522

@Giftkekschen

Description

@Giftkekschen

Environment
VSG version: 3.35.0
OS: Ubuntu 22.04.5 LTS

Describe the bug
When using the --fix option, vsg currently produces invalid VHDL syntax, when fixing function_020 or procedure_014 for nested subprograms. Instead of adding just the designator, <designator>;function; is added.

To Reproduce
Steps to reproduce the behavior:

  1. get minimal.vhd.txt
  2. get minimal.yml
  3. run vsg -f minimal.vhd -c minimal.yml --fix
  4. See error in "fixed" file

Expected behavior
The optional subprogram designator is added at the end of the subprogram.

original:

    function calc_out_function return integer is
        function nested_function_function return integer is
        begin
            return 5;
        end function;
    begin
        return 2 * nested_function_function;
    end function;

expected:

    function calc_out_function return integer is
        function nested_function_function return integer is
        begin
            return 5;
        end function nested_function_function;
    begin
        return 2 * nested_function_function;
    end function calc_out_function;

actual:

    function calc_out_function return integer is
        function nested_function_function return integer is
        begin
            return 5;
        end function;
    begin
        return 2 * nested_function_function;
    end function calc_out_function;function;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions