Mercurial > projects > dil
changeset 488:cfb3805768b6
Added DotExpression and DotType.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 01 Dec 2007 21:42:24 +0100 |
parents | bccca748d745 |
children | a7291d3ee9d7 |
files | trunk/src/dil/Expressions.d trunk/src/dil/Parser.d trunk/src/dil/SyntaxTree.d trunk/src/dil/Types.d |
diffstat | 4 files changed, 24 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/Expressions.d Sat Dec 01 20:20:44 2007 +0100 +++ b/trunk/src/dil/Expressions.d Sat Dec 01 21:42:24 2007 +0100 @@ -604,6 +604,15 @@ } } */ + +class DotExpression : Expression +{ + this() + { + mixin(set_kind); + } +} + class DotListExpression : Expression { Expression[] items;
--- a/trunk/src/dil/Parser.d Sat Dec 01 20:20:44 2007 +0100 +++ b/trunk/src/dil/Parser.d Sat Dec 01 21:42:24 2007 +0100 @@ -810,9 +810,6 @@ // Pragma: // pragma ( Identifier ) // pragma ( Identifier , ExpressionList ) - // ExpressionList: - // AssignExpression - // AssignExpression , ExpressionList nT(); Token* ident; Expression[] args; @@ -1437,8 +1434,8 @@ Expression[] identList; if (token.type == T.Dot) { - identList ~= set(new IdentifierExpression(token), begin); nT(); + identList ~= set(new DotExpression(), begin); } else if (token.type == T.Typeof) { @@ -1504,8 +1501,8 @@ Type[] identList; if (token.type == T.Dot) { - identList ~= set(new IdentifierType(token), begin); nT(); + identList ~= set(new DotType(), begin); } else if (token.type == T.Typeof) { @@ -1572,8 +1569,8 @@ // This code is similar to parseDotListType(). if (token.type == T.Dot) { - templateIdent ~= set(new IdentifierExpression(token), begin); nT(); + templateIdent ~= set(new DotExpression(), begin); } while (1)
--- a/trunk/src/dil/SyntaxTree.d Sat Dec 01 20:20:44 2007 +0100 +++ b/trunk/src/dil/SyntaxTree.d Sat Dec 01 21:42:24 2007 +0100 @@ -152,6 +152,7 @@ PrimaryExpressio, IdentifierExpression, SpecialTokenExpression, + DotExpression, DotListExpression, TemplateInstanceExpression, ThisExpression, @@ -188,6 +189,7 @@ // Types: IntegralType, UndefinedType, + DotType, DotListType, IdentifierType, TypeofType,
--- a/trunk/src/dil/Types.d Sat Dec 01 20:20:44 2007 +0100 +++ b/trunk/src/dil/Types.d Sat Dec 01 21:42:24 2007 +0100 @@ -309,6 +309,7 @@ Pointer, CFuncPointer, Array, + Dot, DotList, Identifier, Typeof, @@ -378,6 +379,15 @@ } } +class DotType : Type +{ + this() + { + super(TID.Dot); + mixin(set_kind); + } +} + class TypeofType : Type { Expression e;