[flang] Clause 13 (Input/output editing) syntax and semantic checking (flang-compiler...
authorvdonaldson <37090318+vdonaldson@users.noreply.github.com>
Tue, 25 Jun 2019 22:59:30 +0000 (15:59 -0700)
committerGitHub <noreply@github.com>
Tue, 25 Jun 2019 22:59:30 +0000 (15:59 -0700)
commit69f5f1373867f2bf38c58edb1ab82be8f90cb2c5
treeb89509d537bc108c7380c4fd65d91fe3a0c2b6ca
parenta0b0bb43ed716ea3bcda9958e96fd067dc6003b5
[flang] Clause 13 (Input/output editing) syntax and semantic checking (flang-compiler/f18#498)

* Clause 13 (Input/output editing) syntax and semantic checking

Diagnose:
 - all clause syntax errors (independent of normal parsing)
 - all clause constraints
 - use of non-standard extensions under -Mstandard
 - obvious program requirement violations

The code:
 - is invoked for both format statement and I/O statement constant formats
 - should be useable by the runtime I/O library for runtime formats
 - is able to recover from errors
 - is able to diagnose multiple errors in a single format
 - has accurate markers for errors
 - can process (fixed character size) Hollerith strings
 - generates reasonable error messages for known error scenarios
 - should not require C++ run-time library support

The code is templatized for use with fixed size character kind={1,2,4} input,
but only the kind=1 variant is actually exercised.

* Review update.

* Review update.

* Review update.

* Improve error processing of unterminated formats.

Original-commit: flang-compiler/f18@c04b7518df75bb516f039065d4edcba87dae8210
Reviewed-on: https://github.com/flang-compiler/f18/pull/498
15 files changed:
flang/.gitignore
flang/lib/common/format.h [new file with mode: 0644]
flang/lib/semantics/check-io.cc
flang/lib/semantics/check-io.h
flang/test/semantics/CMakeLists.txt
flang/test/semantics/io01.f90
flang/test/semantics/io02.f90
flang/test/semantics/io03.f90
flang/test/semantics/io04.f90
flang/test/semantics/io05.f90
flang/test/semantics/io06.f90
flang/test/semantics/io07.f90 [new file with mode: 0644]
flang/test/semantics/io08.f90 [new file with mode: 0644]
flang/test/semantics/io09.f90 [new file with mode: 0644]
flang/test/semantics/io10.f90 [new file with mode: 0644]