codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

Free Form Conversion of Subfields Defined with Reserved Words in From-To Length are not Converted Correctly #242

Closed BrianGodsend closed 1 year ago

BrianGodsend commented 1 year ago

The data structure subfields may contain reserved words in the From-To Length. For example, the Program Status Data Structure allows for the reserved words *STATUS, *PROC, *PARM, and *ROUTINE. When these D-specs are converted to **FREE using Convert to Free Format, the resulting free form declaration contains "NaN" as the field length and incorrect pos() keyword.

Fixed format example:

     d pgmSts         sds                  qualified
     d  programName      *PROC

       *inLR = *ON;
       return;

Annotated results of Convert to Free Format:

**FREE
dcl-ds pgmSts  PSDS qualified;
  // Following line was auto-created and is, obviously, invalid:
  programName    Char(NaN)  Pos(C);
  // The correct line should be like the following:
  programName    *PROC;
end-ds;

*inLR = *ON;
return;

For reference, I am running the latest version of VS Code on an up-to-date Windows 11 Pro 64-bit system. The Code for IBM i version is v2.0.2 and the RPGLE extension is v0.20.2.

worksofliam commented 1 year ago

Wrong extension. You want vscode-rpgfree.

BrianGodsend commented 1 year ago

(Again) Sorry for the incorrect reporting.

Anyone accidentally stumbling on this should note that not only did I report this in the wrong project, but, it is a duplicate of issue number https://github.com/BrianGarland/vscode-rpgfree/issues/62.