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

more...

comp.lang.fortran Profile…
 Up
Possible ambiguity with continuation lines and comments         


Author: Arjen Markus
Date: Sep 15, 2008 21:43

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?

Regards,

Arjen
2 Comments
Re: Possible ambiguity with continuation lines and comments         


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?
Show full article (1.01Kb)
no comments
Re: Possible ambiguity with continuation lines and comments         


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
> ...
Show full article (1.36Kb)
no comments