Mercurial > projects > ddmd
comparison 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 |
comparison
equal
deleted
inserted
replaced
173:d237b38b5858 | 174:af724d3510d7 |
---|---|
303 return e; | 303 return e; |
304 } | 304 } |
305 | 305 |
306 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 306 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
307 { | 307 { |
308 assert(false); | 308 buf.writestring("switch ("); |
309 condition.toCBuffer(buf, hgs); | |
310 buf.writebyte(')'); | |
311 buf.writenl(); | |
312 if (body_) | |
313 { | |
314 if (!body_.isScopeStatement()) | |
315 { | |
316 buf.writebyte('{'); | |
317 buf.writenl(); | |
318 body_.toCBuffer(buf, hgs); | |
319 buf.writebyte('}'); | |
320 buf.writenl(); | |
321 } | |
322 else | |
323 { | |
324 body_.toCBuffer(buf, hgs); | |
325 } | |
326 } | |
309 } | 327 } |
310 | 328 |
311 override Statement inlineScan(InlineScanState* iss) | 329 override Statement inlineScan(InlineScanState* iss) |
312 { | 330 { |
313 //printf("SwitchStatement.inlineScan()\n"); | 331 //printf("SwitchStatement.inlineScan()\n"); |