Mercurial > projects > dil
changeset 280:1eb54f6f392e
- Made class Type abstract.
- Added new class IntegralType and adapted parser accordingly.
author | aziz |
---|---|
date | Mon, 06 Aug 2007 18:54:01 +0000 |
parents | 79c095aae50d |
children | c1fcfbce9499 |
files | trunk/src/Parser.d trunk/src/Types.d |
diffstat | 2 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Parser.d Mon Aug 06 18:10:05 2007 +0000 +++ b/trunk/src/Parser.d Mon Aug 06 18:54:01 2007 +0000 @@ -3116,7 +3116,7 @@ T.Float, T.Double, T.Real, T.Ifloat, T.Idouble, T.Ireal, T.Cfloat, T.Cdouble, T.Creal, T.Void: - auto type = new Type(token.type); + auto type = new IntegralType(token.type); nT(); set(type, begin); require(T.Dot); @@ -3206,7 +3206,7 @@ T.Float, T.Double, T.Real, T.Ifloat, T.Idouble, T.Ireal, T.Cfloat, T.Cdouble, T.Creal, T.Void: - t = new Type(token.type); + t = new IntegralType(token.type); nT(); set(t, begin); break;
--- a/trunk/src/Types.d Mon Aug 06 18:10:05 2007 +0000 +++ b/trunk/src/Types.d Mon Aug 06 18:54:01 2007 +0000 @@ -228,16 +228,11 @@ Invariant, // D2 } -class Type : Node +abstract class Type : Node { TID tid; Type next; - this(TOK tok) - { - this(cast(TID)tok); - } - this(TID tid) { this(tid, null); @@ -251,6 +246,14 @@ } } +class IntegralType : Type +{ + this(TOK tok) + { + super(cast(TID)tok); + } +} + class UndefinedType : Type { this()