www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2680] New: Declarator rule is broken


           Summary: Declarator rule is broken
           Product: D
           Version: 2.025
          Platform: PC
               URL: http://www.digitalmars.com/d/2.0/declaration.html
        OS/Version: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jlquinn optonline.net

This is a regression from http://www.digitalmars.com/d/1.0/declaration.html
The definition of Declarator prevents parsing the following declaration:

int x = 3;

Declaration -> Decl
Decl -> BasicType Declarators
BasicType -> "int"
Declarators -> DeclaratorInitializer
DeclaratorInitializer -> Declarator "=" Initializer

Declarator can't parse the Identifier 'x', though.  It must start with a
BasicType2, which cannot begin with Identifier as specified.

See the following thread as well:


Feb 20 2009