@@ -139,7 +139,7 @@ void ModFileWriter::Write(const Symbol &symbol) {
139139 const auto *ancestor{module .ancestor ()};
140140 isSubmodule_ = ancestor != nullptr ;
141141 auto ancestorName{ancestor ? ancestor->GetName ().value ().ToString () : " " s};
142- auto path{context_.moduleDirectory () + ' /' +
142+ std::string path{context_.moduleDirectory () + ' /' +
143143 ModFileName (symbol.name (), ancestorName, context_.moduleFileSuffix ())};
144144
145145 UnorderedSymbolSet hermeticModules;
@@ -1392,7 +1392,8 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
13921392 // USE, NON_INTRINSIC global name isn't a module?
13931393 fatalError = isIntrinsic.has_value ();
13941394 }
1395- auto path{ModFileName (name, ancestorName, context_.moduleFileSuffix ())};
1395+ std::string path{
1396+ ModFileName (name, ancestorName, context_.moduleFileSuffix ())};
13961397 parser::Parsing parsing{context_.allCookedSources ()};
13971398 parser::Options options;
13981399 options.isModuleFile = true ;
@@ -1468,7 +1469,7 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
14681469 } else {
14691470 for (auto &msg : parsing.messages ().messages ()) {
14701471 std::string str{msg.ToString ()};
1471- Say (name, ancestorName,
1472+ Say (" parse " , name, ancestorName,
14721473 parser::MessageFixedText{str.c_str (), str.size (), msg.severity ()},
14731474 path);
14741475 }
@@ -1480,11 +1481,11 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
14801481 std::optional<ModuleCheckSumType> checkSum{
14811482 VerifyHeader (sourceFile->content ())};
14821483 if (!checkSum) {
1483- Say (name, ancestorName, " File has invalid checksum: %s" _err_en_US,
1484+ Say (" use " , name, ancestorName, " File has invalid checksum: %s" _err_en_US,
14841485 sourceFile->path ());
14851486 return nullptr ;
14861487 } else if (requiredHash && *requiredHash != *checkSum) {
1487- Say (name, ancestorName,
1488+ Say (" use " , name, ancestorName,
14881489 " File is not the right module file for %s" _err_en_US,
14891490 " '" s + name.ToString () + " ': " s + sourceFile->path ());
14901491 return nullptr ;
@@ -1494,7 +1495,7 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
14941495 std::optional<parser::Program> &parsedProgram{parsing.parseTree ()};
14951496 if (!parsing.messages ().empty () || !parsing.consumedWholeFile () ||
14961497 !parsedProgram) {
1497- Say (name, ancestorName, " Module file is corrupt: %s" _err_en_US,
1498+ Say (" parse " , name, ancestorName, " Module file is corrupt: %s" _err_en_US,
14981499 sourceFile->path ());
14991500 return nullptr ;
15001501 }
@@ -1572,10 +1573,10 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
15721573 }
15731574}
15741575
1575- parser::Message &ModFileReader::Say (SourceName name,
1576+ parser::Message &ModFileReader::Say (const char *verb, SourceName name,
15761577 const std::string &ancestor, parser::MessageFixedText &&msg,
15771578 const std::string &arg) {
1578- return context_.Say (name, " Cannot read module file for %s: %s" _err_en_US,
1579+ return context_.Say (name, " Cannot %s module file for %s: %s" _err_en_US, verb ,
15791580 parser::MessageFormattedText{ancestor.empty ()
15801581 ? " module '%s'" _en_US
15811582 : " submodule '%s' of module '%s'" _en_US,
0 commit comments