[J3] END statement
Vipul Parekh
parekhvs at gmail.com
Wed Dec 7 00:57:25 UTC 2022
On Tue, Dec 6, 2022 at 4:36 PM Steve Lionel via J3 <
j3 at mailman.j3-fortran.org> wrote:
> ..
>
> F2018 6.3.1 says:
>
> "A Fortran program unit is a sequence of one or more lines, organized as
> Fortran statements, comments, and INCLUDE lines. A line is a sequence of
> zero or more characters. Lines following a program unit END statement are
> not part of that program unit. A Fortran statement is a sequence of one or
> more complete or partial lines."
>
> This says to me that a line can't span more than one program unit.
>
> I note that NAG Fortran, for Jon's example, says:
>
> NAG Fortran Compiler Release 7.1(Hanzomon) Build 7114
> Error: t.f90, line 1: Program unit END stmt must be the last stmt on a line
> detected at SUBROUTINE@<end-of-statement>
>
> This is consistent with my reading of 6.3.1...
>
Steve, whatever little English I know does *not* say "to me that a line
can't span more than one program unit" is what is meant by 6.3.1.
Considering again the snippet from Jon,
subroutine sub() ; end subroutine ; integer i
end program
All that 6.3.1 informs me is "integer i" is *not* part of the program unit
'sub'.
It seems to me to make little sense that a "a line can't span more than one
program unit" considering the potential scenarios of machine-generated code
that was also behind the Fortran 2023 extension, "The maximum length of a
line in free form source has been increased. The maximum length of a
statement has been increased. The limit on the number of continuation lines
has been removed."
Vipul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221206/d9be951d/attachment.htm>
More information about the J3
mailing list