Mercurial > projects > dil
changeset 248:63a15b082c0c
- Removed class SpecializationType.
- Changed type of member specType to Type. Added members opTok and specTok.
- Changed parser of IsExpression to accomodate above changes.
author | aziz |
---|---|
date | Wed, 01 Aug 2007 14:57:05 +0000 |
parents | 11a67ec83281 |
children | 32d354584b28 |
files | trunk/src/Expressions.d trunk/src/Parser.d trunk/src/Types.d |
diffstat | 3 files changed, 11 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Expressions.d Wed Aug 01 13:06:00 2007 +0000 +++ b/trunk/src/Expressions.d Wed Aug 01 14:57:05 2007 +0000 @@ -590,11 +590,14 @@ { Type type; string ident; - SpecializationType specType; - this(Type type, string ident, SpecializationType specType) + Token* opTok, specTok; + Type specType; + this(Type type, string ident, Token* opTok, Token* specTok, Type specType) { this.type = type; this.ident = ident; + this.opTok = opTok; + this.specTok = specTok; this.specType = specType; } }
--- a/trunk/src/Parser.d Wed Aug 01 13:06:00 2007 +0000 +++ b/trunk/src/Parser.d Wed Aug 01 14:57:05 2007 +0000 @@ -2945,16 +2945,16 @@ case T.Is: requireNext(T.LParen); - Type type; - SpecializationType specType; + Type type, specType; string ident; // optional Identifier + Token* opTok, specTok; type = parseDeclarator(ident, true); switch (token.type) { case T.Colon, T.Equal: - TOK specTok = token.type; + opTok = token; nT(); switch (token.type) { @@ -2968,16 +2968,16 @@ T.Delegate, T.Super, T.Return: + specTok = token; nT(); - specType = new SpecializationType(specTok, token.type); break; default: - specType = new SpecializationType(specTok, parseType()); + specType = parseType(); } default: } require(T.RParen); - e = new IsExpression(type, ident, specType); + e = new IsExpression(type, ident, opTok, specTok, specType); break; case T.LParen: if (tokenAfterParenIs(T.LBrace))
--- a/trunk/src/Types.d Wed Aug 01 13:06:00 2007 +0000 +++ b/trunk/src/Types.d Wed Aug 01 14:57:05 2007 +0000 @@ -195,7 +195,6 @@ Identifier, Typeof, TemplateInstance, - Specialization, } class Type : Node @@ -339,28 +338,6 @@ } } -class SpecializationType : Type -{ - TOK specTok; // Colon|Equal - Type type; - TOK tokType; // Typedef|Struct|Union|Class|Interface| - // Enum|Function|Delegate|Super|Return - - this(TOK specTok, TOK tokType) - { - super(TID.Specialization, null); - this.specTok = specTok; - this.tokType = tokType; - } - - this(TOK specTok, Type type) - { - super(TID.Specialization, null); - this.specTok = specTok; - this.type = type; - } -} - class FunctionType : Type { Type returnType;