Mercurial > projects > ddmd
view dmd/TypeidExp.d @ 77:ad4792a1cfd6
more D-ification container accessing
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Sun, 29 Aug 2010 14:36:55 +0100 |
parents | 2e2a5c3f943a |
children | e28b18c23469 |
line wrap: on
line source
module dmd.TypeidExp; import dmd.Expression; import dmd.Type; import dmd.OutBuffer; import dmd.Loc; import dmd.Scope; import dmd.HdrGenState; import dmd.TOK; class TypeidExp : Expression { Type typeidType; this(Loc loc, Type typeidType) { super(loc, TOK.TOKtypeid, TypeidExp.sizeof); this.typeidType = typeidType; } version (DumbClone) { } else { Type clone() { assert(false); } } override Expression syntaxCopy() { return new TypeidExp(loc, typeidType.syntaxCopy()); } override Expression semantic(Scope sc) { Expression e; version (LOGSEMANTIC) { printf("TypeidExp.semantic()\n"); } typeidType = typeidType.semantic(loc, sc); e = typeidType.getTypeInfo(sc); if (e.loc.linnum == 0) e.loc = loc; // so there's at least some line number info return e; } override void toCBuffer(OutBuffer buf, HdrGenState* hgs) { assert(false); } }