TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

Bug in picture string based on a REPLACE operation

Open fm-117 opened this issue 2 years ago • 0 comments

Describe the bug Our parser does not handle replace operations over PictureCharacterString

To Reproduce (Type)Cobol code that cause the bug : (if any)

       IDENTIFICATION DIVISION.
       PROGRAM-ID. MyPgm.
       REPLACE ==toReplace== BY ==50==.
       data division.
       working-storage section.
       01 var PIC X(toReplace).
       END PROGRAM MyPgm.

The parser will fail and return Line 6[19,30] <27, Error, Syntax> - Syntax error : Missing '(' or ')' in PICTURE string because the REPLACE did not happen.

Expected behavior No error and correct picture definition (check DataDef and VariableSymbol)

fm-117 avatar Apr 06 '22 14:04 fm-117