Mercurial > projects > dil
changeset 573:87c4474a1295
Added semantic() to ClassDeclaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 29 Dec 2007 23:37:18 +0100 |
parents | 751d84733e07 |
children | ae8f58a13917 |
files | trunk/src/dil/Declarations.d trunk/src/dil/Symbols.d |
diffstat | 2 files changed, 18 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/Declarations.d Sat Dec 29 23:32:52 2007 +0100 +++ b/trunk/src/dil/Declarations.d Sat Dec 29 23:37:18 2007 +0100 @@ -276,6 +276,20 @@ this.bases = bases; } + + Class class_; /// The class symbol for this declaration. + + override void semantic(Scope scop) + { + if (class_) + return; + class_ = new Class(name, this); + // Create a new scope. + scop = scop.push(class_); + // Continue semantic analysis. + decls && decls.semantic(scop); + scop.pop(); + } } class InterfaceDeclaration : AggregateDeclaration @@ -350,7 +364,7 @@ addOptChild(decls); } - Union union_; /// The struct symbol for this declaration. + Union union_; /// The union symbol for this declaration. override void semantic(Scope scop) {