| Re: Possible ambiguity with continuation lines and comments |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: Steven G. KarglSteven G. Kargl Date: Sep 15, 2008 22:03
> 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
|