# HG changeset patch # User Aziz K?ksal # Date 1198967572 -3600 # Node ID 751d84733e070bdad9346e97773129718d32e56a # Parent 35a8926253c87edca462cb78dbea2ea6f2b68442 Added semantic() to UnionDeclaration. diff -r 35a8926253c8 -r 751d84733e07 trunk/src/dil/Declarations.d --- 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 diff -r 35a8926253c8 -r 751d84733e07 trunk/src/dil/Symbols.d --- a/trunk/src/dil/Symbols.d Sat Dec 29 23:26:25 2007 +0100 +++ b/trunk/src/dil/Symbols.d Sat Dec 29 23:32:52 2007 +0100 @@ -63,19 +63,21 @@ class Interface : Aggregate { - this(Identifier* ident, Node interfNode) + this(Identifier* ident, Node interfaceNode) { this.sid = SYM.Interface; this.ident = ident; - this.node = interfNode; + this.node = interfaceNode; } } class Union : Aggregate { - this() + this(Identifier* ident, Node unionNode) { this.sid = SYM.Union; + this.ident = ident; + this.node = unionNode; } }