[flang-commits] [PATCH] D91377: [flang] Recognize END FILE as ENDFILE in free form source

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Nov 12 12:03:51 PST 2020


klausler created this revision.
klausler added a reviewer: PeteSteinfeld.
klausler added a project: Flang.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.
klausler requested review of this revision.

The ENDFILE statement may be spelled as two words.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91377

Files:
  flang/lib/Parser/io-parsers.cpp
  flang/test/Semantics/call10.f90


Index: flang/test/Semantics/call10.f90
===================================================================
--- flang/test/Semantics/call10.f90
+++ flang/test/Semantics/call10.f90
@@ -157,8 +157,9 @@
     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
Index: flang/lib/Parser/io-parsers.cpp
===================================================================
--- flang/lib/Parser/io-parsers.cpp
+++ flang/lib/Parser/io-parsers.cpp
@@ -314,7 +314,7 @@
 // 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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91377.304929.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20201112/c651a720/attachment.bin>


More information about the flang-commits mailing list