[all-commits] [llvm/llvm-project] 0061e6: [flang] Better error recovery for missing THEN in ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Oct 4 09:38:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0061e681a3296ac9016891729e03e38ebb235bdc
      https://github.com/llvm/llvm-project/commit/0061e681a3296ac9016891729e03e38ebb235bdc
  Author: peter klausler <pklausler at nvidia.com>
  Date:   2021-10-04 (Mon, 04 Oct 2021)

  Changed paths:
    M flang/lib/Evaluate/check-expression.cpp
    M flang/lib/Parser/executable-parsers.cpp
    A flang/test/Parser/elseif-then.f90

  Log Message:
  -----------
  [flang] Better error recovery for missing THEN in ELSE IF

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.

Differential Revision: https://reviews.llvm.org/D110952




More information about the All-commits mailing list