diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 1a13a45..6620071 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -232,6 +232,18 @@ private: { writeToken(); write(" "); + while (index < tokens.length) + { + if (currentIs(tok!"(")) + formatLeftParenOrBracket(); + else if (currentIs(tok!")")) + { + formatRightParen(); + break; + } + else + writeToken(); + } } else if (((isBlockHeader() || currentIs(tok!"version")) && peekIs(tok!"(")) || (currentIs(tok!"debug") && peekIs(tok!"{"))) diff --git a/tests/allman/issue0436.d.ref b/tests/allman/issue0436.d.ref new file mode 100644 index 0000000..fac85b5 --- /dev/null +++ b/tests/allman/issue0436.d.ref @@ -0,0 +1 @@ +extern (Objective-C) int a; diff --git a/tests/issue0436.d b/tests/issue0436.d new file mode 100644 index 0000000..fac85b5 --- /dev/null +++ b/tests/issue0436.d @@ -0,0 +1 @@ +extern (Objective-C) int a; diff --git a/tests/otbs/issue0436.d.ref b/tests/otbs/issue0436.d.ref new file mode 100644 index 0000000..fac85b5 --- /dev/null +++ b/tests/otbs/issue0436.d.ref @@ -0,0 +1 @@ +extern (Objective-C) int a;