Skip to content

Commit

Permalink
Merge pull request #179 from Hackerpilot/issue-172
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerpilot committed Aug 24, 2015
2 parents 773e8bc + 699ae10 commit 23df06c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dfmt/formatter.d
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ const pure @safe @nogc:
break;
if (depths[i] < d)
break;
if (!braces && tokens[i].type == tok!";")
if (!braces && (tokens[i].type == tok!";" || tokens[i].type == tok!"{"))
break;
i++;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/allman/issue0153.d.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Foo(T) : FirstInterfaceWithVeryLongName,
SecondInterfaceWithVeryLongName if (is(T : Bar))
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar))
{
void foo()
{
Expand Down
7 changes: 7 additions & 0 deletions tests/allman/issue0172.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
final class FormatVisitor : ASTVisitor
{
this(ASTInformation* astInformation)
{
this.astInformation = astInformation;
}
}
7 changes: 7 additions & 0 deletions tests/issue0172.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
final class FormatVisitor : ASTVisitor
{
this(ASTInformation* astInformation)
{
this.astInformation = astInformation;
}
}
3 changes: 1 addition & 2 deletions tests/otbs/issue0153.d.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Foo(T) : FirstInterfaceWithVeryLongName,
SecondInterfaceWithVeryLongName if (is(T : Bar)) {
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) {
void foo() {
}
}
5 changes: 5 additions & 0 deletions tests/otbs/issue0172.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
final class FormatVisitor : ASTVisitor {
this(ASTInformation* astInformation) {
this.astInformation = astInformation;
}
}

0 comments on commit 23df06c

Please sign in to comment.