Landing: af7d8aa47684

Project / Subsystem

gcc / cobol

Date

2026-09-28

Author

James K. Lowden

Commit

af7d8aa47684edd0a2947face79ace648bd7da96

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
cobol
patch_id
—
commit_hash
af7d8aa47684edd0a2947face79ace648bd7da96
source_type
github
headline
cobol: Maintain lexer state after CDF.
tldr
Improves COBOL parsing by ensuring lexer state is preserved after handling directives, fixing implicit PICTURE recognition.
author
James K. Lowden
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • cobol
  • • parser
  • • lexer
discussion_id_link
—
bugzilla_pr
—
date
2026-09-28T00:00:00.000Z

This commit enhances the COBOL parser’s ability to maintain lexer state when processing Compiler-Directing Facilities (CDF) lookahead tokens. Previously, if a CDF token was not a lookahead token, it was reprocessed, sometimes leading to incorrect NAME recognition. The changes ensure that the lexer state is correctly managed, fixing an issue where a CDF directive could prevent the recognition of an implicit PICTURE clause. Debug messages and internal logic have also been tidied.