Mercurial > projects > ddmd
view dmd/DotExp.d @ 177:1475fd394c9e
bug fixes
author | korDen |
---|---|
date | Sun, 10 Oct 2010 10:38:55 +0400 |
parents | 010eb8f0e18d |
children | e3afd1303184 |
line wrap: on
line source
module dmd.DotExp; import dmd.common; import dmd.Expression; import dmd.Loc; import dmd.Scope; import dmd.ScopeExp; import dmd.TemplateDeclaration; import dmd.DotTemplateExp; import dmd.BinExp; import dmd.TOK; class DotExp : BinExp { this(Loc loc, Expression e1, Expression e2) { super(loc, TOKdotexp, DotExp.sizeof, e1, e2); } override Expression semantic(Scope sc) { version (LOGSEMANTIC) { printf("DotExp.semantic('%s')\n", toChars()); if (type) printf("\ttype = %s\n", type.toChars()); } e1 = e1.semantic(sc); e2 = e2.semantic(sc); if (e2.op == TOKimport) { ScopeExp se = cast(ScopeExp)e2; TemplateDeclaration td = se.sds.isTemplateDeclaration(); if (td) { Expression e = new DotTemplateExp(loc, e1, td); e = e.semantic(sc); return e; } } if (!type) type = e2.type; return this; } }