changeset 398:f7bb892d64c2

Fixed Parser.parseEnumDeclaration(): empty enums are allowed now.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sat, 22 Sep 2007 14:58:44 +0200
parents c99f8aeb7b4a
children ff1d11c27061
files trunk/src/dil/Parser.d
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Parser.d	Fri Sep 21 13:46:17 2007 +0200
+++ b/trunk/src/dil/Parser.d	Sat Sep 22 14:58:44 2007 +0200
@@ -925,8 +925,8 @@
     else if (token.type == T.LBrace)
     {
       hasBody = true;
-      nT();
-      do
+      nT(); // Skip {
+      while (token.type != T.RBrace)
       {
         members ~= requireId();
 
@@ -938,15 +938,11 @@
         else
           values ~= null;
 
-        if (token.type == T.Comma)
-          nT();
-        else if (token.type != T.RBrace)
-        {
-          expected(T.RBrace);
+        if (token.type != T.Comma)
           break;
-        }
-      } while (token.type != T.RBrace)
-      nT();
+        nT(); // Skip ,
+      }
+      require(T.RBrace);
     }
     else
       error(MID.ExpectedButFound, "enum declaration", token.srcText);