[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
This commit is contained in:
peter klausler 2020-06-26 12:58:05 -07:00
parent 63bcf89125
commit 5fb5f7b5ab
2 changed files with 10 additions and 0 deletions

View File

@ -272,6 +272,7 @@ void Prescanner::LabelField(TokenSequence &token, int outCol) {
token.CloseToken(); token.CloseToken();
} }
} }
SkipToNextSignificantCharacter();
} }
void Prescanner::SkipToEndOfLine() { void Prescanner::SkipToEndOfLine() {
@ -298,6 +299,14 @@ void Prescanner::NextChar() {
at_ += 3; at_ += 3;
encoding_ = Encoding::UTF_8; 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_) { if (inPreprocessorDirective_) {
SkipCComments(); SkipCComments();
} else { } else {

View File

@ -147,6 +147,7 @@ private:
void SkipToEndOfLine(); void SkipToEndOfLine();
bool MustSkipToEndOfLine() const; bool MustSkipToEndOfLine() const;
void NextChar(); void NextChar();
void SkipToNextSignificantCharacter();
void SkipCComments(); void SkipCComments();
void SkipSpaces(); void SkipSpaces();
static const char *SkipWhiteSpace(const char *); static const char *SkipWhiteSpace(const char *);