GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
cobol

Resume COBOL source format after copybook ends.

COBOL parser correctly resumes source format after processing copybooks.

The COBOL front-end now correctly resumes the source format after a copybook file has been processed. Previously, changes to the source format directive within a copybook were not properly discarded upon exiting the copybook, leading to incorrect parsing.

In Details

Refactors COBOL's lexer to properly manage source format state across copybook inclusions. Changes to SOURCE FORMAT directives within copybooks are now correctly discarded upon exiting the copybook, ensuring consistent parsing of the main source file.

For Context
copybook
A file containing COBOL structures and definitions that can be included in multiple programs. It promotes code reuse and consistency.
SOURCE FORMAT
A COBOL directive that specifies the syntax rules for interpreting the source code, such as fixed or free format.
Filed Under: cobolparserrefactor