Mercurial > projects > ddmd
diff dmd/VarDeclaration.d @ 68:ee3a9f34dc48
final bits of codegen implementation to compile Phobos
author | korDen |
---|---|
date | Tue, 24 Aug 2010 16:44:34 +0400 |
parents | a8b50ff7f201 |
children | 2e2a5c3f943a |
line wrap: on
line diff
--- a/dmd/VarDeclaration.d Mon Aug 23 21:21:05 2010 +0400 +++ b/dmd/VarDeclaration.d Tue Aug 24 16:44:34 2010 +0400 @@ -13,6 +13,7 @@ import dmd.CastExp; import dmd.WANT; import dmd.StructDeclaration; +import dmd.StorageClassDeclaration; import dmd.DsymbolExp; import dmd.TypeSArray; import dmd.IntegerExp; @@ -673,7 +674,28 @@ void toCBuffer(OutBuffer buf, HdrGenState* hgs) { - assert(false); + StorageClassDeclaration.stcToCBuffer(buf, storage_class); + + /* If changing, be sure and fix CompoundDeclarationStatement.toCBuffer() + * too. + */ + if (type) + type.toCBuffer(buf, ident, hgs); + else + buf.writestring(ident.toChars()); + if (init) + { + buf.writestring(" = "); +///version (DMDV2) { + ExpInitializer ie = init.isExpInitializer(); + if (ie && (ie.exp.op == TOKconstruct || ie.exp.op == TOKblit)) + (cast(AssignExp)ie.exp).e2.toCBuffer(buf, hgs); + else +///} + init.toCBuffer(buf, hgs); + } + buf.writeByte(';'); + buf.writenl(); } version (_DH) {