source.cc
token-sequence.cc
unparse.cc
+ user-state.cc
)
#include "char-block.h"
#include "idioms.h"
+#include "indirection.h"
#include "message.h"
#include "parse-state.h"
#include "provenance.h"
// R501 program -> program-unit [program-unit]...
// This is the top-level production for the Fortran language.
-struct StartNewSubprogram {
- using resultType = Success;
- static std::optional<Success> Parse(ParseState &state) {
- if (auto ustate = state.userState()) {
- ustate->NewSubprogram();
- }
- return {Success{}};
- }
-} startNewSubprogram;
-
+constexpr StartNewSubprogram startNewSubprogram;
TYPE_PARSER(
construct<Program>{}(
// statements consume only trailing noise; consume leading noise here.
// parse tree construction so as to avoid any need for representing
// state in static data.
+#include "basic-parsers.h"
#include "char-block.h"
#include <cinttypes>
+#include <optional>
#include <set>
#include <unordered_set>
class CookedSource;
class ParsingLog;
+class ParseState;
class UserState {
public:
std::set<CharBlock> oldStructureComponents_;
};
+
+struct StartNewSubprogram {
+ using resultType = Success;
+ static std::optional<Success> Parse(ParseState &);
+};
} // namespace parser
} // namespace Fortran
#endif // FORTRAN_PARSER_USER_STATE_H_