Skip to content

Commit fa44ec7

Browse files
authored
[flang] Allow continuation of D lines (#66242)
When the old extension of D debug lines in fixed form source is enabled, recognize continuation lines that begin with a D. (No test is added, since the community's driver doesn't support the GNU Fortran option -fd-lines-as-code.)
1 parent 9bbec0a commit fa44ec7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

flang/lib/Parser/prescan.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,11 @@ const char *Prescanner::FixedFormContinuationLine(bool mightNeedSpace) {
10411041
tabInCurrentLine_ = true;
10421042
return nextLine_ + 2; // VAX extension
10431043
}
1044-
if (col1 == ' ' && nextLine_[1] == ' ' && nextLine_[2] == ' ' &&
1045-
nextLine_[3] == ' ' && nextLine_[4] == ' ') {
1044+
if ((col1 == ' ' ||
1045+
((col1 == 'D' || col1 == 'd') &&
1046+
features_.IsEnabled(LanguageFeature::OldDebugLines))) &&
1047+
nextLine_[1] == ' ' && nextLine_[2] == ' ' && nextLine_[3] == ' ' &&
1048+
nextLine_[4] == ' ') {
10461049
char col6{nextLine_[5]};
10471050
if (col6 != '\n' && col6 != '\t' && col6 != ' ' && col6 != '0') {
10481051
if ((col6 == 'i' || col6 == 'I') && IsIncludeLine(nextLine_)) {

0 commit comments

Comments
 (0)