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: Arjen Markus
Date: Sep 15, 2008 23:33

On 16 sep, 07:03, ka...@REMOVE.apl.washington.edu (Steven G. Kargl)
wrote:
> In article <1a9caf61-641b-455c-a3cb-60e343b70...@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- 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
no comments
diggit! del.icio.us! reddit!