changeset 129:a9244d409652

- Added class EmptyDeclaration. - Returning decl instead of null.
author aziz
date Mon, 09 Jul 2007 22:08:05 +0000
parents e02b87281b4e
children 0467f01ed524
files trunk/src/Declarations.d trunk/src/Parser.d
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Declarations.d	Mon Jul 09 22:03:05 2007 +0000
+++ b/trunk/src/Declarations.d	Mon Jul 09 22:08:05 2007 +0000
@@ -16,6 +16,14 @@
   }
 }
 
+class EmptyDeclaration : Declaration
+{
+  this()
+  {
+    super(false);
+  }
+}
+
 alias string[] ModuleName; // Identifier(.Identifier)*
 
 class ModuleDeclaration : Declaration
--- a/trunk/src/Parser.d	Mon Jul 09 22:03:05 2007 +0000
+++ b/trunk/src/Parser.d	Mon Jul 09 22:08:05 2007 +0000
@@ -162,12 +162,16 @@
       break;
     case T.Debug:
       decl = parseDebugDeclaration();
+    case T.Semicolon:
+      nT();
+      decl = new EmptyDeclaration();
+      break;
     case T.Module:
       // Error: module is optional and can only appear once at the top of the source file.
       break;
     default:
     }
-    return null;
+    return decl;
   }
 
   /*