[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:53:05 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6c516cda3974: [flang] Recognize END FILE as ENDFILE in free form source (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91377/new/

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.304943.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20201112/834b80e6/attachment-0001.bin>


More information about the flang-commits mailing list