Mercurial > projects > ddmd
view dmd/ConditionalStatement.d @ 32:81796b717a39
A few bad cast fixed. TODO: either get rid of dyncast(), or derive all objects from intermediate supertype.
author | korDen |
---|---|
date | Tue, 18 May 2010 17:51:46 +0400 |
parents | 10317f0c89a5 |
children | 0aa7d1437ada |
line wrap: on
line source
module dmd.ConditionalStatement; import dmd.Statement; import dmd.Condition; import dmd.Loc; import dmd.OutBuffer; import dmd.Scope; import dmd.HdrGenState; import dmd.ArrayTypes; import dmd.BE; class ConditionalStatement : Statement { Condition condition; Statement ifbody; Statement elsebody; this(Loc loc, Condition condition, Statement ifbody, Statement elsebody) { super(loc); this.condition = condition; this.ifbody = ifbody; this.elsebody = elsebody; } Statement syntaxCopy() { assert(false); } Statement semantic(Scope sc) { assert(false); } Statements flatten(Scope sc) { Statement s; if (condition.include(sc, null)) s = ifbody; else s = elsebody; Statements a = new Statements(); a.push(cast(void*)s); return a; } bool usesEH() { assert(false); } BE blockExit() { assert(false); } void toCBuffer(OutBuffer buf, HdrGenState* hgs) { assert(false); } }