[flang-commits] [flang] [flang][openacc] Make OpenACC block construct parse errors less verbose. (PR #131042)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Mar 17 14:16:08 PDT 2025


================
@@ -19,9 +19,16 @@
 // OpenACC Directives and Clauses
 namespace Fortran::parser {
 
+// Only need to handle ! line comments because prescanning normalizes the
+// other types of line comments from fixed form.
 constexpr auto startAccLine{skipStuffBeforeStatement >>
-    ("!$ACC "_sptok || "C$ACC "_sptok || "*$ACC "_sptok)};
-constexpr auto endAccLine{space >> endOfLine};
+    withMessage(
+        "expected OpenACC directive sentinal: !$ACC (free-form) / C$ACC or *$ACC (fixed-form)"_err_en_US,
----------------
klausler wrote:

It's spelled "sentinel".

https://github.com/llvm/llvm-project/pull/131042


More information about the flang-commits mailing list