Closed RaoulHC closed 1 year ago
Cheers, nice catch.
To confirm, there are two things we're doing here:
!
inline comments -- don't believe this is in F77, but one of the many common extensionsfortran-src is generally pretty stubborn about syntax and standards, but I agree with you that we should be lenient here, especially with comments (no semantic value). LGTM!
Unrelated, the comment for
-- Skip the newline before a comment
| _isWhiteInsensitive && isNewlineCommentsFollowedByContinuation ai
= skip NewlineComment ai
threw me. It's actually detecting the former case, and skips that (comment) line.
Hmmm actually maybe we just want the first change in that case, indeed it looks like using !
for comments isn't in the standard at all! Maybe that change should be removed and we can make the legacy parser the default for .f
files as I suggested in #256? I think it could be useful to have a strict 77 standard parser, but the majority of users probably actually want the legacy parser.
I'm fairly ambivalent on the !
change. I'm definitely for your .f
default parser change suggestion -- opened an issue at #259 .
Ah, I now note that this change loosens further than Fortran77
-- the FORTRAN 66 parser also receives these changes. We should be able to use Ord FortranVersion
to check for "FORTRAN 77 or newer" to catch all the F77s. (It'd be so much nicer if our lexers were composable...! aleeeeex!!)
Cool, have updated so it's just the one change that loosens the comment line before continuation line restriction.
These are explicitly in the Fortran 77 standard.
Issue raised in #256.