www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Nested comment bugs

reply Victor Nakoryakov <nail-mail mail.ru> writes:
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
Aug 02 2005
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
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
Aug 02 2005
parent reply Victor Nakoryakov <nail-mail mail.ru> writes:
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
Aug 03 2005
parent Manfred Nowak <svv1999 hotmail.com> writes:
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
Aug 03 2005