//===-- lib/Parser/user-state.cpp -----------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "flang/Parser/user-state.h" #include "stmt-parser.h" #include "type-parsers.h" #include "flang/Parser/parse-state.h" #include namespace Fortran::parser { std::optional StartNewSubprogram::Parse(ParseState &state) { if (auto *ustate{state.userState()}) { ustate->NewSubprogram(); } return Success{}; } std::optional CapturedLabelDoStmt::Parse( ParseState &state) { static constexpr auto parser{statement(indirect(Parser{}))}; auto result{parser.Parse(state)}; if (result) { if (auto *ustate{state.userState()}) { ustate->NewDoLabel(std::get