ParseState(const CookedSource &cooked)
: p_{&cooked[0]}, limit_{p_ + cooked.size()}, messages_{cooked} {}
ParseState(const ParseState &that)
- : p_{that.p_}, limit_{that.limit_},
- messages_{that.messages_.cooked()}, userState_{that.userState_},
- inFixedForm_{that.inFixedForm_}, encoding_{that.encoding_},
- strictConformance_{that.strictConformance_},
+ : p_{that.p_}, limit_{that.limit_}, messages_{that.messages_.cooked()},
+ userState_{that.userState_}, inFixedForm_{that.inFixedForm_},
+ encoding_{that.encoding_}, strictConformance_{that.strictConformance_},
warnOnNonstandardUsage_{that.warnOnNonstandardUsage_},
warnOnDeprecatedUsage_{that.warnOnDeprecatedUsage_},
anyErrorRecovery_{that.anyErrorRecovery_},
anyConformanceViolation_{that.anyConformanceViolation_} {}
ParseState(ParseState &&that)
- : p_{that.p_}, limit_{that.limit_},
- messages_{std::move(that.messages_)}, context_{std::move(that.context_)},
- userState_{that.userState_}, inFixedForm_{that.inFixedForm_},
- encoding_{that.encoding_}, strictConformance_{that.strictConformance_},
+ : p_{that.p_}, limit_{that.limit_}, messages_{std::move(that.messages_)},
+ context_{std::move(that.context_)}, userState_{that.userState_},
+ inFixedForm_{that.inFixedForm_}, encoding_{that.encoding_},
+ strictConformance_{that.strictConformance_},
warnOnNonstandardUsage_{that.warnOnNonstandardUsage_},
warnOnDeprecatedUsage_{that.warnOnDeprecatedUsage_},
anyErrorRecovery_{that.anyErrorRecovery_},
// although a C++ compiler wouldn't default them anyway due to the presence
// of move constructors and move assignments.
-
CLASS_TRAIT(EmptyTrait);
CLASS_TRAIT(WrapperTrait);
CLASS_TRAIT(UnionTrait);
CLASS_TRAIT(TupleTrait);
//
-// An empty class to attach semantic information to each class in
-// the parse-tree. In practice, each parser-tree 'classname' shall
+// An empty class to attach semantic information to each class in
+// the parse-tree. In practice, each parser-tree 'classname' shall
// implement a member:
//
-// Semantic<classname> * s = nullptr;
-//
-// The actual implementation of each Sema<classname> will be provided
-// later thus allowing the parser to be build without an dependency
+// Semantic<classname> * s = nullptr;
+//
+// The actual implementation of each Sema<classname> will be provided
+// later thus allowing the parser to be build without an dependency
// with the Sema library
-//
+//
namespace Fortran {
namespace semantics {
- template <typename T> struct Semantic {
- Semantic(T*) {}
+template<typename T> struct Semantic {
+ Semantic(T *) {}
};
-}
-}
+} // namespace semantics
+} // namespace Fortran
// Most non-template classes in this file use these default definitions
// for their move constructor and move assignment operator=, and disable
classname &operator=(classname &&) = default; \
classname(const classname &) = delete; \
classname &operator=(const classname &) = delete; \
- Fortran::semantics::Semantic<classname> * s = nullptr \
+ Fortran::semantics::Semantic<classname> *s = nullptr
// Almost all classes in this file have no default constructor.
#define BOILERPLATE(classname) \
classname &operator=(const classname &) { return *this; }; \
classname &operator=(classname &&) { return *this; }; \
using EmptyTrait = std::true_type; \
- Fortran::semantics::Semantic<classname> * s = nullptr ; \
+ Fortran::semantics::Semantic<classname> *s = nullptr; \
}
// Many classes below simply wrap a std::variant<> discriminated union,
A statement;
};
-
// Error recovery marker
EMPTY_CLASS(ErrorRecovery);
TUPLE_CLASS_BOILERPLATE(Concurrent);
std::tuple<ConcurrentHeader, std::list<LocalitySpec>> t;
};
- std::variant<LoopBounds<ScalarIntExpr>, ScalarLogicalExpr, Concurrent> u;
+ std::variant<LoopBounds<ScalarIntExpr>, ScalarLogicalExpr, Concurrent> u;
};
// R1121 label-do-stmt -> [do-construct-name :] DO label [loop-control]
struct LabelDoStmt {
TUPLE_CLASS_BOILERPLATE(LabelDoStmt);
std::tuple<std::optional<Name>, Label, std::optional<LoopControl>> t;
- enum {NAME,LABEL,CONTROL} ;
+ enum { NAME, LABEL, CONTROL };
};
// R1122 nonlabel-do-stmt -> [do-construct-name :] DO [loop-control]
struct NonLabelDoStmt {
TUPLE_CLASS_BOILERPLATE(NonLabelDoStmt);
std::tuple<std::optional<Name>, std::optional<LoopControl>> t;
- enum {NAME,CONTROL} ;
+ enum { NAME, CONTROL };
};
// R1132 end-do-stmt -> END DO [do-construct-name]
ExecutionPart, std::optional<InternalSubprogramPart>,
Statement<EndProgramStmt>>
t;
- enum { PROG, SPEC, EXEC, INTERNAL, END } ;
+ enum { PROG, SPEC, EXEC, INTERNAL, END };
};
// R1405 module-stmt -> MODULE module-name
TUPLE_CLASS_BOILERPLATE(Module);
std::tuple<Statement<ModuleStmt>, SpecificationPart,
std::optional<ModuleSubprogramPart>, Statement<EndModuleStmt>>
- t;
- enum { MOD, SPEC, INTERNAL, END } ;
+ t;
+ enum { MOD, SPEC, INTERNAL, END };
};
// R1411 rename ->
std::tuple<Statement<FunctionStmt>, SpecificationPart, ExecutionPart,
std::optional<InternalSubprogramPart>, Statement<EndFunctionStmt>>
t;
- enum { FUNC, SPEC, EXEC, INTERNAL, END } ;
+ enum { FUNC, SPEC, EXEC, INTERNAL, END };
};
// R1534 subroutine-subprogram ->
std::tuple<Statement<SubroutineStmt>, SpecificationPart, ExecutionPart,
std::optional<InternalSubprogramPart>, Statement<EndSubroutineStmt>>
t;
- enum { SUBR, SPEC, EXEC, INTERNAL, END } ;
+ enum { SUBR, SPEC, EXEC, INTERNAL, END };
};
// R1539 mp-subprogram-stmt -> MODULE PROCEDURE procedure-name