www.digitalmars.com         C & C++   DMDScript  

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

http://d.puremagic.com/issues/show_bug.cgi?id=2680

           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:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=84691


-- 
Feb 20 2009