uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
137 stars 76 forks source link

Value-String not composed correctly due to mix of comments and continuation #61

Open Reinhard-Prehofer opened 6 years ago

Reinhard-Prehofer commented 6 years ago

The following mix of comments and continuation signs in a pic x value declaration is not resolved correctly (sample cobol file attached):

       01  TAB-TAG.                                                     11.02.14
002300     05 FILLER              PIC X(66) VALUE                       21.09.16
002310*                                            Index 01 - 10        11.02.14
002320                                             '0304060405091039111211.02.14
002330*                                            Index 11 - 20        11.02.14
002340-                                            '1318192124272829303111.02.14
002350*                                            Index 21 - 30        11.02.14
002360-                                            '3537384143444546474921.09.16
002370*                                            Index 31 - 33        21.09.16
002380-                                            '525456'.            21.09.16

the parser changes that statement into the following wrong declaration:

       01  TAB-TAG.
           05 FILLER              PIC X(66) VALUE
      *>                                             Index 01 - 10
                                                   '03040604050910391112
      *>                                             Index 11 - 20'13181921242728293031
      *>                                             Index 21 - 30'35373841434445464749
      *>                                             Index 31 - 33'525456'.
[aNasty.cbl.txt](https://github.com/uwol/cobol85parser/files/1615553/aNasty.cbl.txt)