Closed uNouss closed 1 year ago
Looks like it does parse fine if you use the legacy flag, i.e. fortran-src -v77l test.f
.
I'm not entirely sure why it's confined to the legacy parser, but there's logic in the fixed form lexer in alexGetByte
for skipping comments that are before a continuation line. It might be that this isn't actually allowed in the Fortran 77 standard but I will check. If not this should be made more general to the different fortran 77 parsers.
@RaoulHC Thank you for the answer.
yes indeed with the legacy flag in addition, the parsing works.
Looks like the 77 standard explicitly says this should be allowed in section 3.2 here, so I'll look at making this behaviour a bit more general.
Okay thanks
FYI I was having a slightly deeper look at the Fortran standard and there's a few things in your example that are actually non-standard and so the Fortran 77 parser fails to compile: underscore in a symbolic name, symbolic names that are longer than 6 characters and end subroutine id
. So a strict Fortran77 standard parser should actually still fail.
Given how little old Fortran is actually strictly standard compliant I wonder if we should change the default to Fortran 77 legacy for .f
files. Any thoughts on this @raehik or @dorchard?
okay I have edited the example to take into account your remarks.
Confirmed that #257 has fixed this.
Hello everyone, I have an example of code in fortran77 in which in the declaration of the parameters of procedures over several lines using line continuation, there are comments as on the following example.
I can compile it, so parse it, with
gfortran
but not withfortran-src
with the following error message.You can see it here to reproduce the bug