summaryrefslogtreecommitdiffstats
path: root/Source/cmFortranParserImpl.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-06 19:58:06 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-11-06 19:58:06 (GMT)
commit08b8fef254f4fb705046e5c59c1b8e2f4f3afe22 (patch)
tree8fc34698511c8c401b2a5e9e35a47609799ea34b /Source/cmFortranParserImpl.cxx
parent13dc7bdb5e3a0eaaf3607b154bba77a01404a788 (diff)
parent73f255e29d2ac9b45106e9ba7c9bb20ff2ab4349 (diff)
downloadCMake-08b8fef254f4fb705046e5c59c1b8e2f4f3afe22.zip
CMake-08b8fef254f4fb705046e5c59c1b8e2f4f3afe22.tar.gz
CMake-08b8fef254f4fb705046e5c59c1b8e2f4f3afe22.tar.bz2
Merge topic 'fortran-line-directives'
73f255e2 cmFortranLexer: Populate empty doxygen @param comments ba819f49 cmFortranParser: Parse #line directives
Diffstat (limited to 'Source/cmFortranParserImpl.cxx')
-rw-r--r--Source/cmFortranParserImpl.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index a09c5459..c175e62 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -210,6 +210,32 @@ void cmFortranParser_RuleUse(cmFortranParser* parser,
}
//----------------------------------------------------------------------------
+void cmFortranParser_RuleLineDirective(cmFortranParser* parser,
+ const char* filename)
+{
+ // This is a #line directive naming a file encountered during preprocessing.
+ std::string included = filename;
+
+ // Skip #line directives referencing non-files like
+ // "<built-in>" or "<command-line>".
+ if (included.empty() || included[0] == '<')
+ {
+ return;
+ }
+
+ // Fix windows file path separators since our lexer does not
+ // process escape sequences in string literals.
+ cmSystemTools::ReplaceString(included, "\\\\", "\\");
+ cmSystemTools::ConvertToUnixSlashes(included);
+
+ // Save the named file as included in the source.
+ if (cmSystemTools::FileExists(included))
+ {
+ parser->Info.Includes.insert(included);
+ }
+}
+
+//----------------------------------------------------------------------------
void cmFortranParser_RuleInclude(cmFortranParser* parser,
const char* name)
{