Thread overview
Nested comment bugs
Aug 02, 2005
Victor Nakoryakov
Aug 02, 2005
Manfred Nowak
Aug 03, 2005
Victor Nakoryakov
Aug 03, 2005
Manfred Nowak
August 02, 2005
Hello.

I found 2 bugs with nested comments. Not sure about second but first indeed.

So the first one:

> 
> module core;
> 
> /+
> char[] string = "/+";
> +/
> 
> int main(char[][] args)
> {
> 	return 0;
> }

D:\proj\dtest>dmd core.d
core.d(12): unterminated /+ +/ comment

And second is:

> 
> module core;
> 
> /+
> int[] x = 5; // comment with /+ in it
> +/
> 
> int main(char[][] args)
> {
> 	return 0;
> }

Compiloation gives exactly same result.

-- 
Victor (aka nail) Nakoryakov
nail-mail<at>mail<dot>ru

Krasnoznamensk, Moscow, Russia
August 02, 2005
Victor Nakoryakov <nail-mail@mail.ru> wrote:

> I found 2 bugs with nested comments.

No bugs at all:

| This means that embedded strings and comments do not prevent | recognition of comment openings and closings

The first comment token appearing in normal source code determines the type of the comment and that of the the following source code that belongs to the type determined as above is considered to control the state of the comment.

-manfred
August 03, 2005
Manfred Nowak wrote:
> Victor Nakoryakov <nail-mail@mail.ru> wrote:
> 
> 
>>I found 2 bugs with nested comments.
> 
> 
> No bugs at all:
> 
> | This means that embedded strings and comments do not prevent
> | recognition of comment openings and closings
> 
> The first comment token appearing in normal source code determines the type of the comment and that of the the following source code that belongs to the type determined as above is considered to control the state of the comment.
> 
> -manfred


Aaargh! I'm stupid, stupid, stupid... to many beer yesterday :)
Of course there is no bug there, sorry.

-- 
Victor (aka nail) Nakoryakov
nail-mail<at>mail<dot>ru

Krasnoznamensk, Moscow, Russia
August 03, 2005
Victor Nakoryakov <nail-mail@mail.ru> wrote:

> Aaargh! I'm stupid, stupid, stupid...

No, you are not. I think the knowledge of the many failures software professionals make, do also make them for errors the most tolerant professional group.

-manfred