summaryrefslogtreecommitdiffstats
path: root/Source/cmFortranLexer.in.l
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-05 20:46:42 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-20 13:18:47 (GMT)
commitb5ac8b8aa778c7ad612a20deb04a2efafa386d9d (patch)
tree3f0fb4c12b0c363d4c014a29634223c11d0967da /Source/cmFortranLexer.in.l
parentbdcc1f517ed8a513f8c156d83f0244c1b9e98703 (diff)
downloadCMake-b5ac8b8aa778c7ad612a20deb04a2efafa386d9d.zip
CMake-b5ac8b8aa778c7ad612a20deb04a2efafa386d9d.tar.gz
CMake-b5ac8b8aa778c7ad612a20deb04a2efafa386d9d.tar.bz2
Fortran: Add support for submodule syntax in dependency scanning
Fortran 2008 [1] adds support for a new syntax related to modules: submodule ( ParentModule ) SubModule submodule ( ParentModule : SubModule ) NestedSubModule Both of these mean that the current source file requires the module `ParentModule` to be available if it is not provided in the current file. Teach our Fortran dependency scanner to parse this syntax to extract this relationship. For now simply tolerate the nested submodule case and extract only the dependency it expresses on the main module. Further work will be needed to extract dependencies among nested submodules. [1] http://fortranwiki.org/fortran/show/Fortran+2008 Closes: #16234
Diffstat (limited to 'Source/cmFortranLexer.in.l')
-rw-r--r--Source/cmFortranLexer.in.l7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmFortranLexer.in.l b/Source/cmFortranLexer.in.l
index 6870f7c..ea3c132 100644
--- a/Source/cmFortranLexer.in.l
+++ b/Source/cmFortranLexer.in.l
@@ -146,6 +146,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
, { return COMMA; }
:: { return DCOLON; }
+: { return COLON; }
<fixed_fmt>\n[ ]{5}[^ ] { return GARBAGE; }
@@ -155,6 +156,7 @@ $[ \t]*endif { return F90PPR_ENDIF; }
[Ii][Nn][Cc][Ll][Uu][Dd][Ee] { return INCLUDE; }
[Ii][Nn][Tt][Ee][Rr][Ff][Aa][Cc][Ee] { return INTERFACE; }
[Mm][Oo][Dd][Uu][Ll][Ee] { return MODULE; }
+[Ss][Uu][bb][Mm][Oo][Dd][Uu][Ll][Ee] { return SUBMODULE; }
[Uu][Ss][Ee] { return USE; }
[a-zA-Z_][a-zA-Z_0-9]* {
@@ -162,7 +164,10 @@ $[ \t]*endif { return F90PPR_ENDIF; }
return WORD;
}
-[^ \t\n\r;,!'"a-zA-Z=&]+ { return GARBAGE; }
+\( { return LPAREN; }
+\) { return RPAREN; }
+
+[^ \t\n\r:;,!'"a-zA-Z=&()]+ { return GARBAGE; }
;|\n { return EOSTMT; }