Mercurial > projects > ddmd
view dmd/LineInitExp.d @ 17:ddae60498573
Implemented mixin statements, DefaultInitExps, FileInitExps, LineInitExps and __traits.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Mon, 05 Apr 2010 03:24:08 +0100 |
parents | 10317f0c89a5 |
children | 460959608115 |
line wrap: on
line source
module dmd.LineInitExp; import dmd.Expression; import dmd.Loc; import dmd.Scope; import dmd.DefaultInitExp; import dmd.IntegerExp; import dmd.TOK; import dmd.Type; class LineInitExp : DefaultInitExp { this(Loc loc) { super(loc, TOK.TOKline, this.sizeof); } Expression semantic(Scope sc) { type = Type.tint32; return this; } Expression resolve(Loc loc, Scope sc) { Expression e = new IntegerExp(loc, loc.linnum, Type.tint32); e = e.castTo(sc, type); return e; } }