mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix #204
This commit is contained in:
parent
8847c6155b
commit
9fc36fe587
4 changed files with 41 additions and 0 deletions
|
@ -781,6 +781,11 @@ private:
|
|||
indents.pop();
|
||||
write(" ");
|
||||
}
|
||||
else if (currentIs(tok!":"))
|
||||
{
|
||||
writeToken();
|
||||
newline();
|
||||
}
|
||||
else if (!currentIs(tok!"{") && !currentIs(tok!"comment"))
|
||||
{
|
||||
if (indents.topIs(tok!"if") || indents.topIs(tok!"version"))
|
||||
|
|
13
tests/allman/issue0204.d.ref
Normal file
13
tests/allman/issue0204.d.ref
Normal file
|
@ -0,0 +1,13 @@
|
|||
version (Foo)
|
||||
{
|
||||
version (D_Version2)
|
||||
{
|
||||
public import core.memory;
|
||||
}
|
||||
else:
|
||||
}
|
||||
|
||||
version (Bar)
|
||||
int foo();
|
||||
else:
|
||||
int foo(int);
|
13
tests/issue0204.d
Normal file
13
tests/issue0204.d
Normal file
|
@ -0,0 +1,13 @@
|
|||
version (Foo)
|
||||
{
|
||||
version(D_Version2)
|
||||
{
|
||||
public import core.memory;
|
||||
}
|
||||
else:
|
||||
}
|
||||
|
||||
version (Bar)
|
||||
int foo ();
|
||||
else:
|
||||
int foo(int);
|
10
tests/otbs/issue0204.d.ref
Normal file
10
tests/otbs/issue0204.d.ref
Normal file
|
@ -0,0 +1,10 @@
|
|||
version (Foo) {
|
||||
version (D_Version2) {
|
||||
public import core.memory;
|
||||
} else:
|
||||
}
|
||||
|
||||
version (Bar)
|
||||
int foo();
|
||||
else:
|
||||
int foo(int);
|
Loading…
Add table
Add a link
Reference in a new issue