Mercurial > projects > ddmd
diff dmd/SwitchStatement.d @ 174:af724d3510d7
lot os toCBuffer methods implemented
moved shared Type.* stuff into Global
author | korDen |
---|---|
date | Sun, 10 Oct 2010 03:47:23 +0400 |
parents | 438eaa11eed4 |
children | e3afd1303184 |
line wrap: on
line diff
--- a/dmd/SwitchStatement.d Sun Oct 10 01:55:35 2010 +0400 +++ b/dmd/SwitchStatement.d Sun Oct 10 03:47:23 2010 +0400 @@ -305,7 +305,25 @@ override void toCBuffer(OutBuffer buf, HdrGenState* hgs) { - assert(false); + buf.writestring("switch ("); + condition.toCBuffer(buf, hgs); + buf.writebyte(')'); + buf.writenl(); + if (body_) + { + if (!body_.isScopeStatement()) + { + buf.writebyte('{'); + buf.writenl(); + body_.toCBuffer(buf, hgs); + buf.writebyte('}'); + buf.writenl(); + } + else + { + body_.toCBuffer(buf, hgs); + } + } } override Statement inlineScan(InlineScanState* iss)