Thread overview
[Issue 5921] New: No mismatched nested comments
May 03, 2011
kennytm@gmail.com
May 03, 2011
Walter Bright
May 03, 2011
kennytm@gmail.com
May 03, 2011
Walter Bright
May 08, 2011
Stewart Gordon
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921

           Summary: No mismatched nested comments
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2011-05-03 02:54:41 PDT ---
D2 program:


/+
/*
*/+/
void main() {}


DMD 2.052 prints (with no line number):
Error: Source:Mismatched nested comments in test.d


Tagged as 'major' because Don (almost) asked me to do this in a comment to bug
5745

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kennytm@gmail.com
           Platform|x86                         |All
         OS/Version|Windows                     |All
           Severity|major                       |normal


--- Comment #1 from kennytm@gmail.com 2011-05-03 06:03:13 PDT ---
Cannot reproduce the error message. Please show your dmd options. I've got

x.d(6): unterminated /+ +/ comment

in 2.052, 2.042 (ideone), 1.026 (codepad) and git master with 'dmd x'. Reducing
severity back to 'normal'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #2 from bearophile_hugs@eml.cc 2011-05-03 09:54:41 PDT ---
(In reply to comment #1)
> Cannot reproduce the error message. Please show your dmd options. I've got

Thank you, you are right, I've seen that the error message I see is generated by the build system I use and not by DMD. DMD shows the line number.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |INVALID


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-05-03 10:30:56 PDT ---
Not a dmd issue, marked as invalid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #4 from bearophile_hugs@eml.cc 2011-05-03 10:39:30 PDT ---
(In reply to comment #3)
> Not a dmd issue, marked as invalid.

But isn't it a DMD problem still? Maybe we have discussed this same problem in past, but the comments are not mismatched here.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #5 from kennytm@gmail.com 2011-05-03 10:58:33 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > Not a dmd issue, marked as invalid.
> 
> But isn't it a DMD problem still? Maybe we have discussed this same problem in past, but the comments are not mismatched here.

No they are mismatched.

Inside a /+ ... +/, the /* ... */ is not special. Therefore, the tokenizer, using greedy match, recognizes the input as:

<start-of-nestable-comment> /+
<comment-text>              /*
                            *
<start-of-nestable-comment> /+
<comment-text>              /
                            void main() {}

Therefore you have two +/ unmatched.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> 2011-05-03 12:13:25 PDT ---
Kenny's right.

This is not a dmd bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5921


Stewart Gordon <smjg@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com
            Version|D2                          |D1 & D2


--- Comment #7 from Stewart Gordon <smjg@iname.com> 2011-05-08 07:53:56 PDT ---
(In reply to comment #6)
> Kenny's right.
> 
> This is not a dmd bug.

So why couldn't you explain this in the first place?

Or did you somehow misread "rejects-valid" as "diagnostic"?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------