Mercurial > projects > dil
diff trunk/src/dil/Declarations.d @ 572:751d84733e07
Added semantic() to UnionDeclaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 29 Dec 2007 23:32:52 +0100 |
parents | 35a8926253c8 |
children | 87c4474a1295 |
line wrap: on
line diff
--- a/trunk/src/dil/Declarations.d Sat Dec 29 23:26:25 2007 +0100 +++ b/trunk/src/dil/Declarations.d Sat Dec 29 23:32:52 2007 +0100 @@ -349,6 +349,20 @@ addOptChild(tparams); addOptChild(decls); } + + Union union_; /// The struct symbol for this declaration. + + override void semantic(Scope scop) + { + if (union_) + return; + union_ = new Union(name, this); + // Create a new scope. + scop = scop.push(union_); + // Continue semantic analysis. + decls && decls.semantic(scop); + scop.pop(); + } } class ConstructorDeclaration : Declaration