Cobol parser now handles tabs in fixed-format input more leniently.
Cobol lexer now treats a tab in columns 1-6 as if columns 1-7 were blank, improving NIST test compatibility.
The COBOL compiler’s lexer has been updated to better handle fixed-format input. A tab character in columns 1-6 will now cause the parser to treat columns 1-7 as blank, aligning with NIST test requirements. This change also improves the fast symbol-lookup for CLASS types.
In Details
The COBOL front-end's lexer (lexio.cc, scan.l) has been modified to adjust its handling of TAB characters in fixed-format source files. Previously, a TAB in columns 1-6 affected only the indicator column. This change expands the affected area to columns 1-7, ensuring that subsequent characters are correctly parsed as COBOL code, not ignored or misinterpreted. Additionally, symbol lookup for CLASS types has been optimized.
- fixed-format input
- A source code format where code must adhere to specific column positions for different elements, common in older languages like COBOL.
- lexer
- The component of a compiler that breaks source code into a stream of tokens (lexemes).
- NIST tests
- Tests developed by the National Institute of Standards and Technology, used here to ensure compliance with COBOL standards.
- CLASS types
- In COBOL, refers to data types that represent object-oriented classes.