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!"is":
writeToken();
if (!currentIs(tok!"("))
if (!currentIs(tok!"(") && !currentIs(tok!"{"))
write(" ");
break;
case tok!"case":
writeToken();
write(" ");
break;
default:
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):
}
}