Trailing commas cause parsing errors when parsing AcuCobol sources

We are trying to parse Cobol sources.

Trailing comma’s cause a lot of parsing errors, while the compiler has no problems with them.
So why don’t you ignore comma’s alltogether for AcuCobol (like you apparently do for other Cobol dialects)

Versions used:
Cobol: AcuCobol version 10.2.1, fixed format
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)

– extract from the parser logging –

ERROR: Unable to parse COBOL source file : /build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0020 at line 13

Original contents starting from line 1 till line 13:
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PP0020.
       WORKING-STORAGE SECTION.
       01  VARIABLE PIC 9.
       PROCEDURE DIVISION.
           MOVE 1 TO VARIABLE,
           GOBACK.


Preprocessed contents: 
Parse error at line 13:

    1:  IDENTIFICATION DIVISION .
    2:  PROGRAM-ID . PP0020 .
    3:  WORKING-STORAGE SECTION .
    4:  01 VARIABLE PIC 9 .
    5:  PROCEDURE DIVISION .
   12:  MOVE 1 TO VARIABLE ,
   13:  GOBACK .
       ^
   14:  EOF

Thank you for your feedback.
TIcket created: SONARCOBOL-1653

We indeed ignore commas except for AcuCOBOL: that’s because we believe we need commas to correctly parse some AcuCOBOL specific syntaxes. Maybe we should revisit this assumption.

If you encounter a lot of parsing errors due to commas, can you please give us a few more examples of various cases? It would help us when we investigate the best way to address this problem.
Thank you.