@@ -175,7 +175,7 @@ void Prescanner::Statement() {
175175 EmitChar (tokens, ' !' );
176176 ++at_, ++column_;
177177 for (const char *sp{directiveSentinel_}; *sp != ' \0 ' ;
178- ++sp, ++at_, ++column_) {
178+ ++sp, ++at_, ++column_) {
179179 EmitChar (tokens, *sp);
180180 }
181181 if (IsSpaceOrTab (at_)) {
@@ -346,6 +346,7 @@ void Prescanner::CheckAndEmitLine(
346346 tokens.CheckBadParentheses (messages_);
347347 }
348348 }
349+ tokens.RemoveRedundantCompilerDirectives (*this );
349350 tokens.Emit (cooked_);
350351 if (omitNewline_) {
351352 omitNewline_ = false ;
@@ -511,7 +512,7 @@ bool Prescanner::MustSkipToEndOfLine() const {
511512 if (inFixedForm_ && column_ > fixedFormColumnLimit_ && !tabInCurrentLine_) {
512513 return true ; // skip over ignored columns in right margin (73:80)
513514 } else if (*at_ == ' !' && !inCharLiteral_) {
514- return !IsCompilerDirectiveSentinel (at_);
515+ return !IsCompilerDirectiveSentinel (at_ + 1 );
515516 } else {
516517 return false ;
517518 }
@@ -1073,7 +1074,7 @@ std::optional<std::size_t> Prescanner::IsIncludeLine(const char *start) const {
10731074 }
10741075 if (IsDecimalDigit (*p)) { // accept & ignore a numeric kind prefix
10751076 for (p = SkipWhiteSpace (p + 1 ); IsDecimalDigit (*p);
1076- p = SkipWhiteSpace (p + 1 )) {
1077+ p = SkipWhiteSpace (p + 1 )) {
10771078 }
10781079 if (*p != ' _' ) {
10791080 return std::nullopt ;
@@ -1121,7 +1122,7 @@ void Prescanner::FortranInclude(const char *firstQuote) {
11211122 llvm::raw_string_ostream error{buf};
11221123 Provenance provenance{GetProvenance (nextLine_)};
11231124 std::optional<std::string> prependPath;
1124- if (const SourceFile * currentFile{allSources_.GetSourceFile (provenance)}) {
1125+ if (const SourceFile *currentFile{allSources_.GetSourceFile (provenance)}) {
11251126 prependPath = DirectoryName (currentFile->path ());
11261127 }
11271128 const SourceFile *included{
0 commit comments