[flang] Skip D when including D debug line

When including debug lines as code, the `D` should be considered as
a white space. Currently an error was raised about bad labels because
it the `D` remained a `D` when considering the source line as code.

Differential Revision: https://reviews.llvm.org/D122711
This commit is contained in:
Jean Perier 2022-03-31 10:54:15 +02:00
parent 481b185620
commit 14c7754a35

View file

@ -144,6 +144,10 @@ void Prescanner::Statement() {
case LineClassification::Kind::Source:
BeginStatementAndAdvance();
if (inFixedForm_) {
if (features_.IsEnabled(LanguageFeature::OldDebugLines) &&
(*at_ == 'D' || *at_ == 'd')) {
NextChar();
}
LabelField(tokens);
} else if (skipLeadingAmpersand_) {
skipLeadingAmpersand_ = false;