mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix Issue 508 (#511)
Fix Issue 508 merged-on-behalf-of: Brian Schott <Hackerpilot@users.noreply.github.com>
This commit is contained in:
parent
eab4cac12f
commit
7659b1ae1a
4 changed files with 15 additions and 1 deletions
|
@ -9,8 +9,8 @@ module dfmt.formatter;
|
|||
import dparse.lexer;
|
||||
import dparse.parser;
|
||||
import dparse.rollback_allocator;
|
||||
import dfmt.config;
|
||||
import dfmt.ast_info;
|
||||
import dfmt.config;
|
||||
import dfmt.indentation;
|
||||
import dfmt.tokens;
|
||||
import dfmt.wrapping;
|
||||
|
@ -765,6 +765,7 @@ private:
|
|||
}
|
||||
else if (hasCurrent && (currentIs(tok!"@")
|
||||
|| isBasicType(tokens[index].type)
|
||||
|| currentIs(tok!"invariant")
|
||||
|| currentIs(tok!"extern")
|
||||
|| currentIs(tok!"identifier"))
|
||||
&& !currentIsIndentedTemplateConstraint())
|
||||
|
|
7
tests/allman/issue0508.d.ref
Normal file
7
tests/allman/issue0508.d.ref
Normal file
|
@ -0,0 +1,7 @@
|
|||
struct S
|
||||
{
|
||||
@safe invariant
|
||||
{
|
||||
assert(true);
|
||||
}
|
||||
}
|
1
tests/issue0508.d
Normal file
1
tests/issue0508.d
Normal file
|
@ -0,0 +1 @@
|
|||
struct S {@safe invariant { assert(true); }}
|
5
tests/otbs/issue0508.d.ref
Normal file
5
tests/otbs/issue0508.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
struct S {
|
||||
@safe invariant {
|
||||
assert(true);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue