This commit is contained in:
Hackerpilot 2015-03-08 00:29:36 -08:00
parent e73280791a
commit 7952562efc
3 changed files with 19 additions and 1 deletions

View File

@ -839,6 +839,8 @@ private:
else else
newline(); newline();
writeToken(); writeToken();
if (!currentIs(tok!"case") && !currentIs(tok!"default") && !currentIs(tok!"}"))
indentLevel++;
newline(); newline();
while (index < tokens.length) while (index < tokens.length)
{ {
@ -850,7 +852,7 @@ private:
newline(); newline();
return; return;
} }
else if (current.type == tok!";" && peekIs(tok!"}")) else if (current.type == tok!";" && peekIs(tok!"}", false))
{ {
writeToken(); writeToken();
newline(); newline();
@ -886,6 +888,8 @@ private:
else else
goto peek; goto peek;
} }
else if (currentIs(tok!"}", false))
break;
else else
{ {
peek: peek:

7
tests/issue0062.d Normal file
View File

@ -0,0 +1,7 @@
unittest
{
switch (op)
{
return -1; // memory blocks are different
}
}

7
tests/issue0062.d.ref Normal file
View File

@ -0,0 +1,7 @@
unittest
{
switch (op)
{
return -1; // memory blocks are different
}
}