summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmFortranParser.h4
-rw-r--r--Source/cmFortranParserImpl.cxx23
2 files changed, 21 insertions, 6 deletions
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index 8d4c90b..cc5c113 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -137,6 +137,10 @@ struct cmFortranParser_s
bool FindIncludeFile(const char* dir, const char* includeName,
std::string& fileName);
+ std::string ModName(std::string const& mod_name) const;
+ std::string SModName(std::string const& mod_name,
+ std::string const& sub_name) const;
+
// The include file search path.
std::vector<std::string> IncludePath;
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 45481a4..7b0c1a9 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -69,6 +69,17 @@ cmFortranParser_s::~cmFortranParser_s()
cmFortran_yylex_destroy(this->Scanner);
}
+std::string cmFortranParser_s::ModName(std::string const& mod_name) const
+{
+ return mod_name + ".mod";
+}
+
+std::string cmFortranParser_s::SModName(std::string const& mod_name,
+ std::string const& sub_name) const
+{
+ return mod_name + "@" + sub_name + ".smod";
+}
+
bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
{
// Open the new file and push it onto the stack. Save the old
@@ -178,7 +189,7 @@ void cmFortranParser_RuleUse(cmFortranParser* parser, const char* module_name)
// syntax: "use module_name"
// requires: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Requires.insert(mod_name + ".mod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
}
void cmFortranParser_RuleLineDirective(cmFortranParser* parser,
@@ -242,7 +253,7 @@ void cmFortranParser_RuleModule(cmFortranParser* parser,
// syntax: "module module_name"
// provides: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Provides.insert(mod_name + ".mod");
+ parser->Info.Provides.insert(parser->ModName(mod_name));
}
}
@@ -265,8 +276,8 @@ void cmFortranParser_RuleSubmodule(cmFortranParser* parser,
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
- parser->Info.Requires.insert(mod_name + ".mod");
- parser->Info.Provides.insert(mod_name + "@" + sub_name + ".smod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, sub_name));
}
void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
@@ -286,8 +297,8 @@ void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
std::string const& nest_name =
cmSystemTools::LowerCase(nested_submodule_name);
- parser->Info.Requires.insert(mod_name + "@" + sub_name + ".smod");
- parser->Info.Provides.insert(mod_name + "@" + nest_name + ".smod");
+ parser->Info.Requires.insert(parser->SModName(mod_name, sub_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, nest_name));
}
void cmFortranParser_RuleDefine(cmFortranParser* parser, const char* macro)