www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16603] New: [Lexical] comment definition is incorrrect

https://issues.dlang.org/show_bug.cgi?id=16603

          Issue ID: 16603
           Summary: [Lexical] comment definition is incorrrect
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P3
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: kevin brogan.ca

Both of the block comment definitions are incorrect.

BlockComment:
    /* Characters */

Character:
    any Unicode character

The ending comment tags are included in the definition of "any unicode
character", which would make the block comment in quotes "/* abc */ */" a
single comment instead of a comment followed by an invalid sequence, if you
follow the maximal munch technique.

The nesting block comment suffers from the same definition.

The c++ spec handles this by describing comments in a non technical manner. See
 [lex.comment] in the spec.

A solution could be perhaps, to mention that comments take a minimum munch in
the exceptions note.

--
Oct 07 2016