This commit is contained in:
Hackerpilot 2015-03-10 14:38:39 -07:00
parent 66342a99ee
commit 52eabd4f47
3 changed files with 23 additions and 1 deletions

View File

@ -341,9 +341,13 @@ private:
case tok!"in": case tok!"in":
case tok!"is": case tok!"is":
writeToken(); writeToken();
if (!currentIs(tok!"(")) if (!currentIs(tok!"(") && !currentIs(tok!"{"))
write(" "); write(" ");
break; break;
case tok!"case":
writeToken();
write(" ");
break;
default: default:
if (index + 1 < tokens.length) if (index + 1 < tokens.length)
{ {

9
tests/issue0088.d Normal file
View File

@ -0,0 +1,9 @@
unittest
{
switch (x)
{
case+1:
case-1:
case(1):
}
}

9
tests/issue0088.d.ref Normal file
View File

@ -0,0 +1,9 @@
unittest
{
switch (x)
{
case +1:
case -1:
case (1):
}
}