Mercurial > projects > ddmd
diff dmd/Declaration.d @ 79:43073c7c7769
updated to 2.035
also implemented a few missing functions
still crashes in Import.importAll though
author | Trass3r |
---|---|
date | Mon, 30 Aug 2010 03:57:51 +0200 |
parents | 2e2a5c3f943a |
children | acd69f84627e |
line wrap: on
line diff
--- a/dmd/Declaration.d Sun Aug 29 14:39:08 2010 +0100 +++ b/dmd/Declaration.d Mon Aug 30 03:57:51 2010 +0200 @@ -2,9 +2,11 @@ import dmd.Dsymbol; import dmd.Type; +import dmd.TypedefDeclaration; import dmd.PROT; import dmd.LINK; import dmd.Identifier; +import dmd.Json; import dmd.Scope; import dmd.Loc; import dmd.STC; @@ -173,6 +175,32 @@ assert(false); } + override void toJsonBuffer(OutBuffer buf) + { + //writef("Declaration.toJsonBuffer()\n"); + buf.writestring("{\n"); + + JsonProperty(buf, Pname, toChars()); + JsonProperty(buf, Pkind, kind()); + if (type) + JsonProperty(buf, Ptype, type.toChars()); + + if (comment) + JsonProperty(buf, Pcomment, comment); + + if (loc.linnum) + JsonProperty(buf, Pline, loc.linnum); + + TypedefDeclaration td = isTypedefDeclaration(); + if (td) + { + JsonProperty(buf, "base", td.basetype.toChars()); + } + + JsonRemoveComma(buf); + buf.writestring("}\n"); + } + override void toDocBuffer(OutBuffer buf) { assert(false);