[J3] END statement
Malcolm Cohen
malcolm at nag-j.co.jp
Wed Dec 7 01:50:10 UTC 2022
Hi Steve,
I agree with your analysis.
I further note that the “END statement must be the last statement on a line” requirement appears only in this definition. There is no special text in 6.3.3 fixed form which says that you cannot have another statement after the END statement – all 6.3.3 says is that it cannot be continued.
However, this is sufficiently subtle that perhaps a NOTE in 6..3.1 to the effect of “Because a line can only belong to a single program unit, the program unit END statement cannot be followed by another statement on the same line.”.
Vipul writes:
> All that 6.3.1 informs me is "integer i" is *not* part of the program unit 'sub'.
No, 6.3.1 says that a program unit is a sequence of lines, and thus it says that it *IS* part of the program unit ‘sub’. And that would have to be invalid syntax.
>[it makes] little sense considering the potential scenarios of machine-generated code
If the machine can generate semi-colons, it can generate newlines instead. So I would have to disagree with this contention.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Steve Lionel via J3
Sent: Wednesday, December 7, 2022 10:02 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Steve Lionel <steve at stevelionel.com>
Subject: Re: [J3] END statement
On 12/6/2022 7:57 PM, Vipul Parekh wrote:
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.
That's not how I see it. "A Fortran program unit is a sequence of one or more lines" says to me that a line can't belong to more than one program unit. If the standard had said "one or more statements, comments or include lines" I'd conclude otherwise.
I'll be interested in others' views.
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221207/1d2b6e46/attachment.htm>
More information about the J3
mailing list