diff ast/Decl.d @ 136:2be29b296081

Lots of changes: - Parsing classes and interfaces - Fixed some seg faults in sema - Supporting "private" to some extend - And a lot of other small fixes
author johnsen@johnsen-laptop
date Fri, 11 Jul 2008 21:47:57 +0200
parents ed815b31479b
children 6e6355fb5f0f
line wrap: on
line diff
--- a/ast/Decl.d	Wed Jul 09 13:38:11 2008 +0200
+++ b/ast/Decl.d	Fri Jul 11 21:47:57 2008 +0200
@@ -40,6 +40,19 @@
         return null;
     }
 
+    Identifier getIdentifier()
+    {
+        switch(declType)
+        {
+            case DeclType.VarDecl:
+                return (cast(VarDecl)this).identifier;
+            case DeclType.FuncDecl:
+                return (cast(FuncDecl)this).identifier;
+            default:
+                assert(0, "Invalid DeclType for getting a identifier");
+        }
+    }
+
     DeclType declType;
     Scope env;
     Symbol sym;