[flang] Recognize END FILE as ENDFILE in free form source

The ENDFILE statement may be spelled as two words.

Differential revision: https://reviews.llvm.org/D91377
This commit is contained in:
peter klausler 2020-11-12 12:02:09 -08:00
parent 3a7b57b7ca
commit 6c516cda39
2 changed files with 3 additions and 2 deletions

View file

@ -314,7 +314,7 @@ TYPE_CONTEXT_PARSER("BACKSPACE statement"_en_US,
// R1225 endfile-stmt ->
// ENDFILE file-unit-number | ENDFILE ( position-spec-list )
TYPE_CONTEXT_PARSER("ENDFILE statement"_en_US,
construct<EndfileStmt>("ENDFILE" >> positionOrFlushSpecList))
construct<EndfileStmt>("END FILE" >> positionOrFlushSpecList))
// R1226 rewind-stmt -> REWIND file-unit-number | REWIND ( position-spec-list )
TYPE_CONTEXT_PARSER("REWIND statement"_en_US,

View file

@ -157,8 +157,9 @@ module m
close(1) ! C1597
!ERROR: External I/O is not allowed in a pure subprogram
backspace(1) ! C1597
!Also checks parsing of variant END FILE spelling
!ERROR: External I/O is not allowed in a pure subprogram
endfile(1) ! C1597
end file(1) ! C1597
!ERROR: External I/O is not allowed in a pure subprogram
rewind(1) ! C1597
!ERROR: External I/O is not allowed in a pure subprogram