From 0389d798d7ebb4fb1294000b9e0d87cac64586f4 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 16 Sep 2015 17:20:16 -0700 Subject: [PATCH] Fix #187 --- src/dfmt/formatter.d | 2 +- tests/allman/issue0187.d.ref | 3 +++ tests/issue0187.d | 3 +++ tests/otbs/issue0187.d.ref | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/allman/issue0187.d.ref create mode 100644 tests/issue0187.d create mode 100644 tests/otbs/issue0187.d.ref diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 16eb759..0cb39d7 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -466,7 +466,7 @@ private: write(" "); } else if (index < tokens.length && (currentIs(tok!"@") || isBasicType(tokens[index].type) - || currentIs(tok!"identifier"))) + || currentIs(tok!"identifier") || currentIs(tok!"if"))) write(" "); } diff --git a/tests/allman/issue0187.d.ref b/tests/allman/issue0187.d.ref new file mode 100644 index 0000000..ee3cdbf --- /dev/null +++ b/tests/allman/issue0187.d.ref @@ -0,0 +1,3 @@ +void doStuff(T)() @safe if (isNumeric!T) +{ +} diff --git a/tests/issue0187.d b/tests/issue0187.d new file mode 100644 index 0000000..ee3cdbf --- /dev/null +++ b/tests/issue0187.d @@ -0,0 +1,3 @@ +void doStuff(T)() @safe if (isNumeric!T) +{ +} diff --git a/tests/otbs/issue0187.d.ref b/tests/otbs/issue0187.d.ref new file mode 100644 index 0000000..fa534e7 --- /dev/null +++ b/tests/otbs/issue0187.d.ref @@ -0,0 +1,2 @@ +void doStuff(T)() @safe if (isNumeric!T) { +}