Test empty nested arrays

This commit is contained in:
Benoit Blanchon
2014-08-25 11:01:22 +02:00
parent dbc3bee3a0
commit 981adf1989
2 changed files with 24 additions and 2 deletions

View File

@ -11,9 +11,21 @@ size_t IndentedPrintDecorator::write(uint8_t c)
{
case '{':
case '[':
indent++;
size_t n;
if (previousChar == '{' || previousChar == '[')
{
n = writeln() + sink.write(c);
}
else
{
n = sink.write(c);
}
previousChar = c;
return sink.write(c);
indent++;
return n;
case '}':
case ']':