Mercurial > projects > ddmd
diff dmd/DotExp.d @ 129:010eb8f0e18d
further work on dmd test suite
author | korDen |
---|---|
date | Sun, 05 Sep 2010 15:32:22 +0400 |
parents | e28b18c23469 |
children | e3afd1303184 |
line wrap: on
line diff
--- a/dmd/DotExp.d Sat Sep 04 01:33:05 2010 +0100 +++ b/dmd/DotExp.d Sun Sep 05 15:32:22 2010 +0400 @@ -4,6 +4,9 @@ import dmd.Expression; import dmd.Loc; import dmd.Scope; +import dmd.ScopeExp; +import dmd.TemplateDeclaration; +import dmd.DotTemplateExp; import dmd.BinExp; import dmd.TOK; @@ -11,13 +14,31 @@ { this(Loc loc, Expression e1, Expression e2) { - assert(false); - super(loc, TOK.init, 0, e1, e2); + super(loc, TOKdotexp, DotExp.sizeof, e1, e2); } override Expression semantic(Scope sc) { - assert(false); +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; } }