This commit is contained in:
Hackerpilot 2015-03-10 14:26:22 -07:00
parent 0ae8eccc2f
commit b07ecacb91
3 changed files with 27 additions and 10 deletions

View file

@ -426,15 +426,10 @@ private:
writeToken();
break;
case tok!":":
if (!assumeSorted(astInformation.attributeDeclarationLines)
.equalRange(current.line).empty)
{
writeToken();
tempIndent = 0;
newline();
}
else if (!assumeSorted(astInformation.caseEndLocations)
.equalRange(current.index).empty)
if (!assumeSorted(astInformation.caseEndLocations)
.equalRange(current.index).empty || !assumeSorted(
astInformation.attributeDeclarationLines).equalRange(
current.line).empty)
{
indentLevel++;
writeToken();
@ -1043,7 +1038,9 @@ private:
&& currentIs(tok!"identifier") && peekIs(tok!":")
&& (!isBlockHeader(2) || peek2Is(tok!"if"))))
{
tempIndent--;
popIndent();
if (braceIndents.length)
indentLevel = braceIndents.top();
}
indent();
}

10
tests/issue0090.d Normal file
View file

@ -0,0 +1,10 @@
unittest
{
L1:
switch (x)
{
case Case:
doSomething();
doSomethingElse();
}
}

10
tests/issue0090.d.ref Normal file
View file

@ -0,0 +1,10 @@
unittest
{
L1:
switch (x)
{
case Case:
doSomething();
doSomethingElse();
}
}