| Re: Possible ambiguity with continuation lines and comments |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: Arjen MarkusArjen Markus Date: Sep 15, 2008 23:33
>> 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- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
Ah! It is not possible to add a comment that way - that makes
it much easier indeed.
Thanks,
Arjen
|