# HG changeset patch # User Aziz K?ksal # Date 1198880553 -3600 # Node ID 184a8d8bad2e5b47108b5a375be36f1b67c1d545 # Parent 3c867a683258f00e6940383e0509cafd50d640ea Added semantic() to StructDeclaration. diff -r 3c867a683258 -r 184a8d8bad2e trunk/src/dil/Declarations.d --- a/trunk/src/dil/Declarations.d Fri Dec 28 22:32:32 2007 +0100 +++ b/trunk/src/dil/Declarations.d Fri Dec 28 23:22:33 2007 +0100 @@ -313,6 +313,20 @@ { this.alignSize = alignSize; } + + Struct struct_; /// The struct symbol for this declaration. + + override void semantic(Scope scop) + { + if (struct_) + return; + struct_ = new Struct(name); + // Create a new scope. + scop = scop.push(struct_); + // Continue semantic analysis. + decls.semantic(scop); + scop.pop(); + } } class UnionDeclaration : Declaration diff -r 3c867a683258 -r 184a8d8bad2e trunk/src/dil/Scope.d --- a/trunk/src/dil/Scope.d Fri Dec 28 22:32:32 2007 +0100 +++ b/trunk/src/dil/Scope.d Fri Dec 28 23:22:33 2007 +0100 @@ -51,11 +51,12 @@ /++ Create a new inner scope. +/ - Scope push() + Scope push(ScopeSymbol symbol) { auto sc = new Scope(); sc.parent = this; sc.infoMan = this.infoMan; + sc.symbol = symbol; return sc; } diff -r 3c867a683258 -r 184a8d8bad2e trunk/src/dil/Symbols.d --- a/trunk/src/dil/Symbols.d Fri Dec 28 22:32:32 2007 +0100 +++ b/trunk/src/dil/Symbols.d Fri Dec 28 23:22:33 2007 +0100 @@ -78,7 +78,8 @@ class Struct : Aggregate { - this() + Identifier* ident; + this(Identifier* ident) { this.sid = SYM.Struct; }