From 74400b677cccacae7e0b3093ea428dce3a90323c Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 27 Apr 2015 15:46:19 -0700 Subject: [PATCH] Fix #142 --- src/dfmt/formatter.d | 4 ++-- tests/allman/issue0051.d.d.ref | 0 tests/allman/issue0095.d.d.ref | 0 tests/allman/issue0142.d.ref | 4 ++++ tests/issue0142.d | 4 ++++ tests/otbs/issue0051.d.d.ref | 0 tests/otbs/issue0095.d.d.ref | 0 tests/otbs/issue0142.d.ref | 3 +++ 8 files changed, 13 insertions(+), 2 deletions(-) delete mode 100644 tests/allman/issue0051.d.d.ref delete mode 100644 tests/allman/issue0095.d.d.ref create mode 100644 tests/allman/issue0142.d.ref create mode 100644 tests/issue0142.d delete mode 100644 tests/otbs/issue0051.d.d.ref delete mode 100644 tests/otbs/issue0095.d.d.ref create mode 100644 tests/otbs/issue0142.d.ref 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) { + +}