RPG: Parser fails on enums

Enums were introduced in IBM i 7.4 and can only be defined in free format. The parser will fail to parse any enum declarations in free format code with the following error:
”Could not parse line 2: Invalid assignment operator: -”

Example code:

          dcl-enum colorCodes qualified;
             blue 1;
             green 2;
             yellow 3;
           end-enum;

The parser will fail with the above error and refuse to parse the rest of the program.

Hi,

Can you give your context for this? I.e. are you on SonarQube Cloud? SonarQube for IDE (flavor and version)? SonarQube self-managed (flavor and version)?

 
Thx,
Ann

I am on SonarQube Server 2025.6. It looks like the RPG plugin is version 3.12.0.7371

1 Like

Hi,

Thanks for verifying this happens in a current version! I’ll flag it for the language experts.

 
Ann

Thank you @1337_Nerd for sharing. I’ll have a look and get back to you.

Hey, @1337_Nerd. We are fixing this and it should be included in the next release/deployment of the analyzer.

Thank you for reporting this!