diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index c7ced79..001b9ed 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -220,7 +220,7 @@ private: { writeToken(); if (index < tokens.length && (currentIs(tok!"identifier") - || isBasicType(current.type) || currentIs(tok!"@"))) + || isBasicType(current.type) || currentIs(tok!"@") || currentIs(tok!"if"))) { write(" "); } @@ -1385,7 +1385,7 @@ const pure @safe @nogc: auto t = tokens[i + index].type; return t == tok!"for" || t == tok!"foreach" || t == tok!"foreach_reverse" || t == tok!"while" || t == tok!"if" || t == tok!"out" - || t == tok!"catch" || t == tok!"with"; + || t == tok!"catch" || t == tok!"with" || t == tok!"synchronized"; } } diff --git a/tests/allman/issue0051.d.d.ref b/tests/allman/issue0051.d.d.ref deleted file mode 100644 index e69de29..0000000 diff --git a/tests/allman/issue0095.d.d.ref b/tests/allman/issue0095.d.d.ref deleted file mode 100644 index e69de29..0000000 diff --git a/tests/allman/issue0142.d.ref b/tests/allman/issue0142.d.ref new file mode 100644 index 0000000..0e44599 --- /dev/null +++ b/tests/allman/issue0142.d.ref @@ -0,0 +1,4 @@ +class Bar(A) : Foo if (isFloating!A) +{ + +} diff --git a/tests/issue0142.d b/tests/issue0142.d new file mode 100644 index 0000000..0e44599 --- /dev/null +++ b/tests/issue0142.d @@ -0,0 +1,4 @@ +class Bar(A) : Foo if (isFloating!A) +{ + +} diff --git a/tests/otbs/issue0051.d.d.ref b/tests/otbs/issue0051.d.d.ref deleted file mode 100644 index e69de29..0000000 diff --git a/tests/otbs/issue0095.d.d.ref b/tests/otbs/issue0095.d.d.ref deleted file mode 100644 index e69de29..0000000 diff --git a/tests/otbs/issue0142.d.ref b/tests/otbs/issue0142.d.ref new file mode 100644 index 0000000..0ff0108 --- /dev/null +++ b/tests/otbs/issue0142.d.ref @@ -0,0 +1,3 @@ +class Bar(A) : Foo if (isFloating!A) { + +}