Mercurial > projects > dil
changeset 617:0749f30ef2d0
Added member 'EnumType type' to class Enum.
Added method setType() to Enum.
Fixed module name of src/dil/Types.d.
Added member enumSymbol to EnumType.
Removed 'TypeBasic' from newTB declaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Thu, 10 Jan 2008 19:47:34 +0100 |
parents | 506ce60760d8 |
children | 07946b379006 |
files | trunk/src/dil/semantic/Symbols.d trunk/src/dil/semantic/Types.d |
diffstat | 2 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/semantic/Symbols.d Wed Jan 09 17:41:22 2008 +0100 +++ b/trunk/src/dil/semantic/Symbols.d Thu Jan 10 19:47:34 2008 +0100 @@ -96,13 +96,18 @@ class Enum : ScopeSymbol { - Identifier* ident; + EnumType type; this(Identifier* ident, Node enumNode) { this.sid = SYM.Enum; this.ident = ident; this.node = enumNode; } + + void setType(EnumType type) + { + this.type = type; + } } class Function : ScopeSymbol
--- a/trunk/src/dil/semantic/Types.d Wed Jan 09 17:41:22 2008 +0100 +++ b/trunk/src/dil/semantic/Types.d Thu Jan 10 19:47:34 2008 +0100 @@ -2,9 +2,9 @@ Author: Aziz Köksal License: GPL3 +/ -module dil.semantic.Type; +module dil.semantic.Types; -import dil.semantic.Symbol; +import dil.semantic.Symbols; import dil.semantic.TypesEnum; import dil.lexer.Identifier; import dil.CompilerInfo; @@ -96,9 +96,11 @@ class EnumType : Type { - this(Type baseType) + Enum enumSymbol; + this(Enum enumSymbol, Type baseType) { super(baseType, TYP.Enum); + this.enumSymbol = enumSymbol; } Type baseType() @@ -302,7 +304,7 @@ /// Allocates an instance of TypeBasic and assigns it to typeName. template newTB(char[] typeName) { - const TypeBasic newTB = mixin(typeName~" = new TypeBasic(TYP."~typeName~")"); + const newTB = mixin(typeName~" = new TypeBasic(TYP."~typeName~")"); } static this()