changeset 131:ce636f3981cc

- Removed TOK.Number. - Returning FunctionType in parseDeclaratorSuffix() when parsing parameters.
author aziz
date Tue, 10 Jul 2007 20:11:02 +0000
parents 0467f01ed524
children c97a3f683d13
files trunk/src/Lexer.d trunk/src/Parser.d trunk/src/Token.d
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Lexer.d	Tue Jul 10 16:49:01 2007 +0000
+++ b/trunk/src/Lexer.d	Tue Jul 10 20:11:02 2007 +0000
@@ -1325,7 +1325,7 @@
     p = t.end; // consume token
 
     peek(t);
-    if (this.loc == oldloc && t.type == TOK.Number)
+    if (this.loc == oldloc && t.type == TOK.Int32)
     {
       newloc = t.uint_ - 1;
       p = t.end;
--- a/trunk/src/Parser.d	Tue Jul 10 16:49:01 2007 +0000
+++ b/trunk/src/Parser.d	Tue Jul 10 20:11:02 2007 +0000
@@ -1345,6 +1345,7 @@
       }
       else
       {
+        // ( Expression )
         nT();
         e = parseExpression();
         require(T.RParen);
@@ -1483,12 +1484,15 @@
       switch (token.type)
       {
       case T.LBracket:
+        // Type Identifier ArrayType
+        // ArrayType := [] or [Type] or [Expression..Expression]
         t = parseArrayType(t);
         continue;
       case T.LParen:
         auto params = parseParameters();
-        // TODO: create FunctionType.
-        // new FunctionType(params);
+        // TODO: handle ( TemplateParameterList ) ( ParameterList )
+        // ReturnType FunctionName ( ParameterList )
+        t = new FunctionType(t, params);
         break;
       default:
         break;
--- a/trunk/src/Token.d	Tue Jul 10 16:49:01 2007 +0000
+++ b/trunk/src/Token.d	Tue Jul 10 20:11:02 2007 +0000
@@ -20,7 +20,6 @@
   CharLiteral, WCharLiteral, DCharLiteral,
 
   // Numbers
-  Number,
   Int32, Int64, Uint32, Uint64,
   // Floating point number scanner relies on this order. (FloatXY + 3 == ImaginaryXY)
   Float32, Float64, Float80,
@@ -37,7 +36,7 @@
 
   Dot, Slice, Ellipses,
 
-  // Floating point operators
+  // Floating point number operators
   Unordered,
   UorE,
   UorG,
@@ -101,6 +100,8 @@
   TOK type;
 //   Position pos;
 
+//   Token* next, prev;
+
   char* start;
   char* end;