diff --git a/flang/lib/Parser/prescan.h b/flang/lib/Parser/prescan.h --- a/flang/lib/Parser/prescan.h +++ b/flang/lib/Parser/prescan.h @@ -147,6 +147,7 @@ void SkipToEndOfLine(); bool MustSkipToEndOfLine() const; void NextChar(); + void SkipToNextSignificantCharacter(); void SkipCComments(); void SkipSpaces(); static const char *SkipWhiteSpace(const char *); diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp --- a/flang/lib/Parser/prescan.cpp +++ b/flang/lib/Parser/prescan.cpp @@ -272,6 +272,7 @@ token.CloseToken(); } } + SkipToNextSignificantCharacter(); } void Prescanner::SkipToEndOfLine() { @@ -298,6 +299,14 @@ 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 {