uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
136 stars 74 forks source link

space required after comma #12

Closed Reinhard-Prehofer closed 7 years ago

Reinhard-Prehofer commented 7 years ago

The grammar seems to be very strict on requiring SPACES after COMMAs. '1', '2', '3' is valid, but '1', '2','3' leads to a parsing error (there is no spaces between '2','3'.

Error Message: Parsing file CobolT1.cbl. line 28:12 mismatched input ',' expecting DOT_FS Collecting units in file CobolT1.cbl.

_01  Student.
   03  nachname    pic x(20).
   03  vorname     pic x(20).
   03  geschlecht  pic x(1).
     88  mann      values 'M' 'm'. 
     88  frau      value 'F', 'f', 'W', 'w'.
     88  egal      values 'a' thru 'z',
          'A' thru 'Z'
 * SPACE after COMMA required?        
 * OK     '1', '2', '3'.
          '1', '2','3'.     <<<<==== this is my line 28_ 

I am aware of some IBM-Cobol-Compilers being rather keen on having spaces before a comma, though these are WARNINGs only.

uwol commented 7 years ago

Should be fixed in https://github.com/uwol/cobol85parser/commit/8618fa6d9479a5cc077624680a5024994ffc056c.