bool isFatal_{false};
};
+inline namespace literals {
constexpr MessageFixedText operator""_en_US(const char str[], std::size_t n) {
return MessageFixedText{str, n, false /* not fatal */};
}
const char str[], std::size_t n) {
return MessageFixedText{str, n, true /* fatal */};
}
+} // namespace literals
std::ostream &operator<<(std::ostream &, const MessageFixedText &);
return true;
}
bool Pre(const EndProgramStmt &x) { // R1403
- Outdent(), Word("END PROGRAM"), Walk(" ", x.v);
- EndSubprogram();
+ EndSubprogram("PROGRAM", x.v);
return false;
}
bool Pre(const ModuleStmt &) { // R1405
return true;
}
bool Pre(const EndModuleStmt &x) { // R1406
- Outdent(), Word("END MODULE"), Walk(" ", x.v);
+ EndSubprogram("MODULE", x.v);
return false;
}
bool Pre(const UseStmt &x) { // R1409
return false;
}
bool Pre(const EndSubmoduleStmt &x) { // R1419
- Outdent(), Word("END SUBMODULE"), Walk(" ", x.v);
+ EndSubprogram("SUBMODULE", x.v);
return false;
}
bool Pre(const BlockDataStmt &x) { // R1421
return false;
}
bool Pre(const EndBlockDataStmt &x) { // R1422
- Outdent(), Word("END BLOCK DATA"), Walk(" ", x.v);
+ EndSubprogram("BLOCK DATA", x.v);
return false;
}
return false;
}
bool Pre(const EndFunctionStmt &x) { // R1533
- Outdent(), Word("END FUNCTION"), Walk(" ", x.v);
- EndSubprogram();
+ EndSubprogram("FUNCTION", x.v);
return false;
}
bool Pre(const SubroutineStmt &x) { // R1535
return false;
}
bool Pre(const EndSubroutineStmt &x) { // R1537
- Outdent(), Word("END SUBROUTINE"), Walk(" ", x.v);
- EndSubprogram();
+ EndSubprogram("SUBROUTINE", x.v);
return false;
}
bool Pre(const MpSubprogramStmt &) { // R1539
return true;
}
bool Pre(const EndMpSubprogramStmt &x) { // R1540
- Outdent(), Word("END PROCEDURE"), Walk(" ", x.v);
- EndSubprogram();
+ EndSubprogram("PROCEDURE", x.v);
return false;
}
bool Pre(const EntryStmt &x) { // R1541
WalkTupleElements(tuple, separator);
}
- void EndSubprogram() { structureComponents_.clear(); }
+ void EndSubprogram(const char *kind, const std::optional<Name> &name) {
+ Outdent(), Word("END "), Word(kind), Walk(" ", name);
+ structureComponents_.clear();
+ }
std::ostream &out_;
int indent_{0};