Re: Possible ambiguity with continuation lines and comments
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Possible ambiguity with continuation lines and comments         

Group: comp.lang.fortran · Group Profile
Author: Steven G. Kargl
Date: Sep 15, 2008 22:03

In article <1a9caf61-641b-455c-a3cb-60e343b70f95@k30g2000hse.googlegroups.com>,
Arjen Markus writes:
> Hello,
>
> I was experimenting a bit with preprocessing Fortran code and I came
> to realise
> that you can combine continuation lines and comments in such a way
> that there
> are at least two interpretations possible:
>
> write(*,*) 'A string & ! Continued &
> & on the next line' ! all that
>
> In the first line: is the first ampersand the continuation character
> or is it the second?
>
> I hope nobody ever writes code like that, so it is mostly curiosity,
> but still. Is this
> situation somehow covered?

3.3.1.3.2 Character context continuation

If a character context is to be continued, the "&" shall be the last
nonblank character on the line and shall not be followed by commentary.
An "&" shall be the first nonblank character on the next line
that is not a comment line and the statement continues with the next
character following the "&".

--
steve
no comments
diggit! del.icio.us! reddit!