changeset 261:966756c5d5d3

- Added begin variables and calls to set().
author aziz
date Fri, 03 Aug 2007 15:04:03 +0000
parents b83180748ae6
children 0f22269e76ff
files trunk/src/Parser.d trunk/src/Statements.d
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Parser.d	Fri Aug 03 08:44:03 2007 +0000
+++ b/trunk/src/Parser.d	Fri Aug 03 15:04:03 2007 +0000
@@ -1478,6 +1478,7 @@
   Statement parseStatement()
   {
 // writefln("°parseStatement:(%d)token='%s'°", lx.loc, token.srcText);
+    auto begin = token;
     Statement s;
     Declaration d;
     switch (token.type)
@@ -1513,7 +1514,7 @@
          //T.Static
     case_parseAttribute:
       s = parseAttributeStatement();
-      break;
+      return s;
     case T.Identifier:
       if (peekNext() == T.Colon)
       {
@@ -1527,7 +1528,6 @@
     case T.Dot, T.Typeof:
       bool success;
       d = try_(parseDeclaration(), success);
-// writefln("parseDeclaration()=", failed?"failed":"success");
       if (success)
         goto case_DeclarationStatement; // Declaration
       else
@@ -1645,6 +1645,7 @@
       d = parseAggregateDeclaration();
       goto case_DeclarationStatement;
     case_DeclarationStatement:
+      set(d, begin);
       s = new DeclarationStatement(d);
       break;
     case T.LBrace:
@@ -1672,6 +1673,7 @@
     }
     assert(s !is null);
 //     writef("§%s§", s.classinfo.name);
+    set(s, begin);
     return s;
   }
 
@@ -1745,6 +1747,7 @@
 
     Statement parse()
     {
+      auto begin = token;
       Statement s;
       switch (token.type)
       {
@@ -1813,6 +1816,7 @@
       default:
         s = new DeclarationStatement(parseDeclaration(stc));
       }
+      set(s, begin);
       return s;
     }
     return parse();
--- a/trunk/src/Statements.d	Fri Aug 03 08:44:03 2007 +0000
+++ b/trunk/src/Statements.d	Fri Aug 03 15:04:03 2007 +0000
@@ -102,12 +102,12 @@
     this.elseBody = elseBody;
   }
 }
-
+/+
 class ConditionalStatement : Statement
 {
 
 }
-
++/
 class WhileStatement : Statement
 {
   Expression condition;