diff options
author | Brad King <brad.king@kitware.com> | 2016-09-05 18:18:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-06 19:52:40 (GMT) |
commit | d28da906fed16ab7f45440db65c8c84e15b53996 (patch) | |
tree | 0fdac920d680d9ea403add5875bcdc789983ae00 /Source/cmFortranParser.h | |
parent | 8c65a5017fe6a6dfe6d57018e28decd7649588d4 (diff) | |
download | CMake-d28da906fed16ab7f45440db65c8c84e15b53996.zip CMake-d28da906fed16ab7f45440db65c8c84e15b53996.tar.gz CMake-d28da906fed16ab7f45440db65c8c84e15b53996.tar.bz2 |
cmFortranParser: Inject a newline at end-of-file when missing
Our parser grammar expects all statements to end in an `EOSTMT` token
such as a newline. Ensure that the last statement in a file can be
parsed even if it is missing a newline.
Diffstat (limited to 'Source/cmFortranParser.h')
-rw-r--r-- | Source/cmFortranParser.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index d27a192..2b58375 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -118,11 +118,13 @@ struct cmFortranFile : File(file) , Buffer(buffer) , Directory(dir) + , LastCharWasNewline(false) { } FILE* File; YY_BUFFER_STATE Buffer; std::string Directory; + bool LastCharWasNewline; }; struct cmFortranParser_s |