Skip to content

Commit 23df06c

Browse files
committed
Merge pull request #179 from Hackerpilot/issue-172
#172
2 parents 773e8bc + 699ae10 commit 23df06c

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

src/dfmt/formatter.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ const pure @safe @nogc:
12691269
break;
12701270
if (depths[i] < d)
12711271
break;
1272-
if (!braces && tokens[i].type == tok!";")
1272+
if (!braces && (tokens[i].type == tok!";" || tokens[i].type == tok!"{"))
12731273
break;
12741274
i++;
12751275
}

tests/allman/issue0153.d.ref

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
class Foo(T) : FirstInterfaceWithVeryLongName,
2-
SecondInterfaceWithVeryLongName if (is(T : Bar))
1+
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar))
32
{
43
void foo()
54
{

tests/allman/issue0172.d.ref

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
final class FormatVisitor : ASTVisitor
2+
{
3+
this(ASTInformation* astInformation)
4+
{
5+
this.astInformation = astInformation;
6+
}
7+
}

tests/issue0172.d

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
final class FormatVisitor : ASTVisitor
2+
{
3+
this(ASTInformation* astInformation)
4+
{
5+
this.astInformation = astInformation;
6+
}
7+
}

tests/otbs/issue0153.d.ref

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
class Foo(T) : FirstInterfaceWithVeryLongName,
2-
SecondInterfaceWithVeryLongName if (is(T : Bar)) {
1+
class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) {
32
void foo() {
43
}
54
}

tests/otbs/issue0172.d.ref

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
final class FormatVisitor : ASTVisitor {
2+
this(ASTInformation* astInformation) {
3+
this.astInformation = astInformation;
4+
}
5+
}

0 commit comments

Comments
 (0)