changeset 268:c19b68a4e3db

- FunctionBody inherits from Node now. - Added begin variable and call to set().
author aziz
date Sat, 04 Aug 2007 13:23:01 +0000
parents f3dfa6208ed3
children a416e09c08ea
files trunk/src/Parser.d trunk/src/Statements.d
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Parser.d	Sat Aug 04 10:55:05 2007 +0000
+++ b/trunk/src/Parser.d	Sat Aug 04 13:23:01 2007 +0000
@@ -476,6 +476,7 @@
 
   FunctionBody parseFunctionBody()
   {
+    auto begin = token;
     auto func = new FunctionBody;
     while (1)
     {
@@ -515,11 +516,11 @@
         nT();
         goto case T.LBrace;
       default:
-        // TODO: issue error msg.
         error(MID.ExpectedButFound, "FunctionBody", token.srcText);
       }
       break; // exit while loop
     }
+    set(func, begin);
     return func;
   }
 
--- a/trunk/src/Statements.d	Sat Aug 04 10:55:05 2007 +0000
+++ b/trunk/src/Statements.d	Sat Aug 04 13:23:01 2007 +0000
@@ -42,10 +42,14 @@
   }
 }
 
-class FunctionBody
+class FunctionBody : Node
 {
   Statement funcBody, inBody, outBody;
   Token* outIdent;
+  this()
+  {
+    super(NodeType.Other);
+  }
 }
 
 class ScopeStatement : Statement