This is an archive of the discontinued LLVM Phabricator instance.

[flang] Better error recovery for missing THEN in ELSE IF
ClosedPublic

Authored by klausler on Oct 1 2021, 11:31 AM.

Details

Summary

The THEN keyword in the "ELSE IF (test) THEN" statement is useless
syntactically, and to omit it is a common error (at least for me!)
that has poor error recovery. This patch changes the parser to
cough up a simple "expected 'THEN'" and still recognize the rest of
the IF construct.

Diff Detail

Event Timeline

klausler created this revision.Oct 1 2021, 11:31 AM
klausler requested review of this revision.Oct 1 2021, 11:31 AM
This revision is now accepted and ready to land.Oct 2 2021, 6:30 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2021, 9:38 AM