summaryrefslogtreecommitdiffstats
path: root/Source/cmFortranParser.y
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-05 17:35:21 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-20 13:08:28 (GMT)
commitbdcc1f517ed8a513f8c156d83f0244c1b9e98703 (patch)
treece38cdaeadbf1c647bbee7aa208754c597e3bdca /Source/cmFortranParser.y
parent6b8812c27e6df1d10fa4bfc30cb3eadd08d7966b (diff)
downloadCMake-bdcc1f517ed8a513f8c156d83f0244c1b9e98703.zip
CMake-bdcc1f517ed8a513f8c156d83f0244c1b9e98703.tar.gz
CMake-bdcc1f517ed8a513f8c156d83f0244c1b9e98703.tar.bz2
cmFortranParser: Skip module procedures/functions/subroutines
Fortran allows the syntax MODULE PROCEDURE ... MODULE FUNCTION ... MODULE SUBROUTINE ... to declare procedures/functions/subroutines that are members of modules. Do not treat such syntax as the definition of a module with one of these names. Issue: #16234
Diffstat (limited to 'Source/cmFortranParser.y')
-rw-r--r--Source/cmFortranParser.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmFortranParser.y b/Source/cmFortranParser.y
index b856a1a..7cf7619 100644
--- a/Source/cmFortranParser.y
+++ b/Source/cmFortranParser.y
@@ -113,7 +113,11 @@ stmt:
}
| MODULE WORD other EOSTMT {
cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
- cmFortranParser_RuleModule(parser, $2);
+ if (cmsysString_strcasecmp($2, "function") != 0 &&
+ cmsysString_strcasecmp($2, "procedure") != 0 &&
+ cmsysString_strcasecmp($2, "subroutine") != 0) {
+ cmFortranParser_RuleModule(parser, $2);
+ }
free($2);
}
| INTERFACE WORD other EOSTMT {