# HG changeset patch # User aziz # Date 1186426441 0 # Node ID 1eb54f6f392e9f165f7949b5f1449a039f41b0ea # Parent 79c095aae50d5db8be47457371e931116d57f722 - Made class Type abstract. - Added new class IntegralType and adapted parser accordingly. diff -r 79c095aae50d -r 1eb54f6f392e trunk/src/Parser.d --- 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; diff -r 79c095aae50d -r 1eb54f6f392e trunk/src/Types.d --- 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()