BrianGarland / vscode-rpgfree

Visual Studio Code extension to convert fixed format RPGLE to free format
MIT License
18 stars 11 forks source link

Auto Data Area Data Structures Have Duplicate DtaAra Keywords #93

Closed BrianGodsend closed 4 months ago

BrianGodsend commented 1 year ago

When the declaration of an auto-data-area data structure (coded with a U) include the DTAARA keyword, the resulting free form declaration has two DTAARA keywords. The fist keyword is the DtaAra(*AUTO) and the second is the keyword from the original line of source. When converting an auto-data-area data structure, the *AUTO option of the DTAARA keyword must be placed in the existing definition, if any.

[!NOTE] The output below also demonstrates the issue addressed by issue [#92]; where the *VAR option is not removed from the DTAARA keyword.

For example:

     d @DTAARANAME     c                   'QTEMP/MYDTAARA'
     d dtaAraDs       uds                  dtaara(*VAR: @DTAARANAME)
     d  fld1                          1a
     c                   eval      *inLR = *ON
     c                   return

Is incorrectly converted as:

**FREE
       Dcl-C @DTAARANAME 'QTEMP/MYDTAARA';
       Dcl-DS dtaAraDs  DtaAra(*AUTO) dtaara(*VAR: @DTAARANAME);
         fld1           Char(1);
       End-DS;
       *inLR = *ON;
       Return;

The expected output is:

**FREE
       Dcl-C @DTAARANAME 'QTEMP/MYDTAARA';
       Dcl-DS dtaAraDs                dtaara(*AUTO: @DTAARANAME);
         fld1           Char(1);
       End-DS;
       *inLR = *ON;
       Return;
BrianGarland commented 4 months ago

Will be fixed in 0.0.30