protected:
void PushScope();
void PopScope();
- void ClearScopes() { implicitRules_.reset(nullptr); }
+ void ClearScopes() { implicitRules_.reset(); }
private:
// implicit rules in effect for current scope
EraseSymbol(*genericName);
genericSymbol_ = &MakeSymbol(*genericName);
genericSymbol_->set_details(details);
- } else if (!genericSymbol_->isSubprogram()) {
+ } else if (!genericSymbol_->IsSubprogram()) {
SayAlreadyDeclared(*genericName, *genericSymbol_);
EraseSymbol(*genericName);
genericSymbol_ = nullptr;
}
bool HasModulePrefix(const std::list<parser::PrefixSpec> &prefixes) {
- for (auto &prefix : prefixes) {
+ for (const auto &prefix : prefixes) {
if (std::holds_alternative<parser::PrefixSpec::Module>(prefix.u)) {
return true;
}
bool SubprogramVisitor::Pre(const parser::InterfaceBody::Subroutine &x) {
const auto &name{std::get<parser::Name>(
std::get<parser::Statement<parser::SubroutineStmt>>(x.t).statement.t)};
- return BeginSubprogram(name, Symbol::Flag::Subroutine, false, std::nullopt);
+ return BeginSubprogram(
+ name, Symbol::Flag::Subroutine, /*hasModulePrefix*/ false, std::nullopt);
}
void SubprogramVisitor::Post(const parser::InterfaceBody::Subroutine &) {
EndSubprogram();
bool SubprogramVisitor::Pre(const parser::InterfaceBody::Function &x) {
const auto &name{std::get<parser::Name>(
std::get<parser::Statement<parser::FunctionStmt>>(x.t).statement.t)};
- return BeginSubprogram(name, Symbol::Flag::Function, false, std::nullopt);
+ return BeginSubprogram(
+ name, Symbol::Flag::Function, /*hasModulePrefix*/ false, std::nullopt);
}
void SubprogramVisitor::Post(const parser::InterfaceBody::Function &) {
EndSubprogram();
}
if (hasModulePrefix && !inInterfaceBlock()) {
auto *symbol{FindSymbol(name.source)};
- if (!symbol || !symbol->IsSeparateMp()) {
+ if (!symbol || !symbol->IsSeparateModuleProc()) {
Say(name.source,
"'%s' was not declared a separate module procedure"_err_en_US);
return false;
std::get<parser::Statement<parser::MpSubprogramStmt>>(x.t).statement.v};
const auto &subpPart{
std::get<std::optional<parser::InternalSubprogramPart>>(x.t)};
- return BeginSubprogram(name, Symbol::Flag::Subroutine, true, subpPart);
+ return BeginSubprogram(
+ name, Symbol::Flag::Subroutine, /*hasModulePrefix*/ true, subpPart);
}
void SubprogramVisitor::Post(const parser::SeparateModuleSubprogram &) {
details_);
}
-bool Symbol::isSubprogram() const {
+bool Symbol::IsSubprogram() const {
return std::visit(
common::visitors{
[](const SubprogramDetails &) { return true; },
[](const SubprogramNameDetails &) { return true; },
[](const GenericDetails &) { return true; },
- [](const UseDetails &x) { return x.symbol().isSubprogram(); },
+ [](const UseDetails &x) { return x.symbol().IsSubprogram(); },
[](const auto &) { return false; },
},
details_);
details_);
}
-bool Symbol::IsSeparateMp() const {
+bool Symbol::IsSeparateModuleProc() const {
if (attrs().test(Attr::MODULE)) {
if (auto *details{detailsIf<SubprogramDetails>()}) {
return details->isInterface();