summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortranLexer.in.l
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-04-21 15:15:56 (GMT)
committerBrad King <brad.king@kitware.com>2008-04-21 15:15:56 (GMT)
commit52898fe9250aaa16904640874852c45bfc4c325b (patch)
tree33eaa264d38846f3cf75bd8122c4967483f1bc52 /Source/cmDependsFortranLexer.in.l
parentfd0690fcebc2c7a0e50a51bce62f4774900b9f07 (diff)
downloadCMake-52898fe9250aaa16904640874852c45bfc4c325b.zip
CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.gz
CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.bz2
BUG: Fix Fortran dependency parser preprocessor handling crash.
- Do not crash if a #elseif occurs out of order - Recognize preprocessor directives only at the beginning of lines. - See issue #6855
Diffstat (limited to 'Source/cmDependsFortranLexer.in.l')
-rw-r--r--Source/cmDependsFortranLexer.in.l18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmDependsFortranLexer.in.l b/Source/cmDependsFortranLexer.in.l
index 05210eb..cef2be9 100644
--- a/Source/cmDependsFortranLexer.in.l
+++ b/Source/cmDependsFortranLexer.in.l
@@ -119,22 +119,22 @@ Modify cmDependsFortranLexer.h:
!.*\n { return EOSTMT; } /* Treat comments like */
<fixed_fmt>^[cC*dD].*\n { return EOSTMT; } /* empty lines */
-#[ \t]*include { return CPP_INCLUDE; }
+^[ \t]*#[ \t]*include { return CPP_INCLUDE; }
\$[ \t]*include { return F90PPR_INCLUDE; }
\?\?[ \t]*include { return COCO_INCLUDE; }
-#[ \t]*define { return CPP_DEFINE; }
+^[ \t]*#[ \t]*define { return CPP_DEFINE; }
\$[ \t]*DEFINE { return F90PPR_DEFINE; }
-#[ \t]*undef { return CPP_UNDEF; }
+^[ \t]*#[ \t]*undef { return CPP_UNDEF; }
\$[ \t]*UNDEF { return F90PPR_UNDEF; }
-#[ \t]*ifdef { return CPP_IFDEF; }
-#[ \t]*ifndef { return CPP_IFNDEF; }
-#[ \t]*if { return CPP_IF; }
-#[ \t]*elif { return CPP_ELIF; }
-#[ \t]*else { return CPP_ELSE; }
-#[ \t]*endif { return CPP_ENDIF; }
+^[ \t]*#[ \t]*ifdef { return CPP_IFDEF; }
+^[ \t]*#[ \t]*ifndef { return CPP_IFNDEF; }
+^[ \t]*#[ \t]*if { return CPP_IF; }
+^[ \t]*#[ \t]*elif { return CPP_ELIF; }
+^[ \t]*#[ \t]*else { return CPP_ELSE; }
+^[ \t]*#[ \t]*endif { return CPP_ENDIF; }
$[ \t]*ifdef { return F90PPR_IFDEF; }
$[ \t]*ifndef { return F90PPR_IFNDEF; }