[flang-commits] [flang] [flang][parser] handle semicolons uniformly in program unit constructs (PR #181180)
Andre Kuhlenschmidt via flang-commits
flang-commits at lists.llvm.org
Wed Feb 18 11:58:56 PST 2026
================
@@ -91,8 +91,9 @@ TYPE_PARSER(
"nonstandard usage: empty source file"_port_en_US,
skipStuffBeforeStatement >> consumedAllInput >>
pure<std::list<ProgramUnit>>()) ||
- some(globalCompilerDirective || globalOpenACCCompilerDirective ||
- normalProgramUnit) /
+ some(skipStuffBeforeStatement >> (globalCompilerDirective ||
----------------
akuhlens wrote:
Factoring it out won't work to fix the problem that moving it to here solves. The problems, trailing semicolons currently count as progress in the alternatives causing `CombineFailedParses` to register that there are errors in the alternatives as a whole. Moving it here advances the parser for all the alternatives so that there is no progress in each alternative. There are probably more direct ways of doing this, but I think it would have to change how the combinators themselves work.
https://github.com/llvm/llvm-project/pull/181180
More information about the flang-commits
mailing list