changeset 88:81cb24669ed3

- Fixed parser of AssocArrayLiteralExpression. - Fixed parseArgumentList().
author aziz
date Thu, 05 Jul 2007 20:14:01 +0000
parents c9544b7d5c7d
children 18c71269fb52
files trunk/src/Parser.d
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Parser.d	Thu Jul 05 19:52:00 2007 +0000
+++ b/trunk/src/Parser.d	Thu Jul 05 20:14:01 2007 +0000
@@ -466,6 +466,8 @@
       values ~= parseAssignExpression();
 
       if (token.type != T.RBracket)
+      {
+        require(T.Comma);
         while (1)
         {
           keys ~= parseAssignExpression();
@@ -482,8 +484,9 @@
           values ~= parseAssignExpression();
           if (token.type == T.RBracket)
             break;
-          errorIfNot(T.Comma);
+          require(T.Comma);
         }
+      }
       assert(token.type == T.RBracket);
       nT();
       e = new AssocArrayLiteralExpression(keys, values);
@@ -530,15 +533,17 @@
          T.Float, T.Double, T.Real, T.Ifloat, T.Idouble, T.Ireal,
          T.Cfloat, T.Cdouble, T.Creal:
     TOK type = token.type;
+
     requireNext(T.Dot);
 
     string ident;
-    errorIfNot(T.Identifier);
     if (token.type == T.Identifier)
     {
       ident = token.srcText;
       nT();
     }
+    else
+      errorIfNot(T.Identifier);
 
     e = new TypeDotIdExpression(type, ident);
     default:
@@ -567,7 +572,7 @@
       es ~= parseAssignExpression();
       if (token.type == terminator)
         break;
-      errorIfNot(T.Comma);
+      require(T.Comma);
     }
     nT();
     return es;