[Issue 3415] broken JSON output
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 14 00:04:50 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3415
Rainer Schuetze <r.sagitario at gmx.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
CC| |r.sagitario at gmx.de
--- Comment #2 from Rainer Schuetze <r.sagitario at gmx.de> 2010-04-14 00:04:47 PDT ---
This happens for declarations in an AttribDeclaration, where the code for
adding commas is missing. Here's the patch:
Index: json.c
===================================================================
--- json.c (revision 432)
+++ json.c (working copy)
@@ -214,11 +214,17 @@
if (d)
{
+ size_t offset = buf->offset;
for (unsigned i = 0; i < d->dim; i++)
{ Dsymbol *s = (Dsymbol *)d->data[i];
+ if (offset != buf->offset)
+ { buf->writestring(",\n");
+ offset = buf->offset;
+ }
//printf("AttribDeclaration::toJsonBuffer %s\n", s->toChars());
s->toJsonBuffer(buf);
}
+ JsonRemoveComma(buf);
}
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list