changeset 313:1c1adededd8f

- Fix: assign new EmptyDeclaration to decls when parsing PragmaStatement. - Fix in constructors: add only non-null variables to this.children.
author aziz
date Wed, 15 Aug 2007 19:26:04 +0000
parents fa0b6f32c1ae
children ebd21bbf296e
files trunk/src/Declarations.d trunk/src/Parser.d
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Declarations.d	Wed Aug 15 19:19:00 2007 +0000
+++ b/trunk/src/Declarations.d	Wed Aug 15 19:26:04 2007 +0000
@@ -346,7 +346,10 @@
   {
     super(true /+decls.length != 0+/);
     mixin(set_kind);
-    this.children = [decls, elseDecls];
+    if (decls)
+      this.children = [decls];
+    if (elseDecls)
+      this.children ~= elseDecls;
     this.spec = spec;
     this.cond = cond;
     this.decls = decls;
@@ -364,7 +367,10 @@
   {
     super(true /+decls.length != 0+/);
     mixin(set_kind);
-    this.children = [decls, elseDecls];
+    if (decls)
+      this.children = [decls];
+    if (elseDecls)
+      this.children ~= elseDecls;
     this.spec = spec;
     this.cond = cond;
     this.decls = decls;
--- a/trunk/src/Parser.d	Wed Aug 15 19:19:00 2007 +0000
+++ b/trunk/src/Parser.d	Wed Aug 15 19:26:04 2007 +0000
@@ -714,7 +714,10 @@
         require(T.RParen);
 
       if (token.type == T.Semicolon)
+      {
         nT();
+        decls = new EmptyDeclaration();
+      }
       else
         decls = parseDeclarationsBlock();