Test an array with one element

This commit is contained in:
Benoit Blanchon
2014-08-25 10:55:09 +02:00
parent c243417585
commit 3f2b7b706a
4 changed files with 16 additions and 5 deletions

View File

@ -10,14 +10,16 @@ size_t IndentedPrintDecorator::write(uint8_t c)
switch (c)
{
case '{':
case '[':
indent++;
previousChar = c;
return sink.write(c);
case '}':
case ']':
indent--;
if (previousChar == '{')
if (previousChar == '{' || previousChar == '[')
{
previousChar = c;
return sink.write(c);
@ -58,7 +60,7 @@ size_t IndentedPrintDecorator::write(uint8_t c)
default:
if (previousChar == '{')
if (previousChar == '{' || previousChar == '[')
{
previousChar = c;
return writeln() + sink.write(c);