[flang-commits] [flang] 5fb5f7b - [flang] Fix line continuation after bare labels (fm200.f)
peter klausler via flang-commits
flang-commits at lists.llvm.org
Fri Jun 26 17:08:31 PDT 2020
Author: peter klausler
Date: 2020-06-26T17:07:38-07:00
New Revision: 5fb5f7b5ab340b7c2ebdfd0b5538308a2f8a85b0
URL: https://github.com/llvm/llvm-project/commit/5fb5f7b5ab340b7c2ebdfd0b5538308a2f8a85b0
DIFF: https://github.com/llvm/llvm-project/commit/5fb5f7b5ab340b7c2ebdfd0b5538308a2f8a85b0.diff
LOG: [flang] Fix line continuation after bare labels (fm200.f)
Fixed-form line continuation was not working when the
preceding line was a bare label.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D82687
Added:
Modified:
flang/lib/Parser/prescan.cpp
flang/lib/Parser/prescan.h
Removed:
################################################################################
diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp
index 90b71925b389..07ddbddaa08d 100644
--- a/flang/lib/Parser/prescan.cpp
+++ b/flang/lib/Parser/prescan.cpp
@@ -272,6 +272,7 @@ void Prescanner::LabelField(TokenSequence &token, int outCol) {
token.CloseToken();
}
}
+ SkipToNextSignificantCharacter();
}
void Prescanner::SkipToEndOfLine() {
@@ -298,6 +299,14 @@ void Prescanner::NextChar() {
at_ += 3;
encoding_ = Encoding::UTF_8;
}
+ SkipToNextSignificantCharacter();
+}
+
+// Skip everything that should be ignored until the next significant
+// character is reached; handles C-style comments in preprocessing
+// directives, Fortran ! comments, stuff after the right margin in
+// fixed form, and all forms of line continuation.
+void Prescanner::SkipToNextSignificantCharacter() {
if (inPreprocessorDirective_) {
SkipCComments();
} else {
diff --git a/flang/lib/Parser/prescan.h b/flang/lib/Parser/prescan.h
index f2840c3bf771..3a08a90c3679 100644
--- a/flang/lib/Parser/prescan.h
+++ b/flang/lib/Parser/prescan.h
@@ -147,6 +147,7 @@ class Prescanner {
void SkipToEndOfLine();
bool MustSkipToEndOfLine() const;
void NextChar();
+ void SkipToNextSignificantCharacter();
void SkipCComments();
void SkipSpaces();
static const char *SkipWhiteSpace(const char *);
More information about the flang-commits
mailing list