diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 6f9b7cc..ae3f798 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -211,7 +211,9 @@ private: { immutable t = tokens[index].type; if (t == tok!"identifier" || isStringLiteral(t) - || isNumberLiteral(t) || t == tok!"characterLiteral") + || isNumberLiteral(t) || t == tok!"characterLiteral" + // a!"b" function() + || t == tok!"function" || t == tok!"delegate") write(" "); } } diff --git a/tests/allman/issue0497.d.ref b/tests/allman/issue0497.d.ref new file mode 100644 index 0000000..eec042e --- /dev/null +++ b/tests/allman/issue0497.d.ref @@ -0,0 +1,5 @@ +alias f1 = S function(); +alias f2 = S!"foo" function(); +alias f3 = S!5 function(); +alias f4 = S!S function(); +alias f5 = S!(S) function(); diff --git a/tests/issue0497.d b/tests/issue0497.d new file mode 100644 index 0000000..eec042e --- /dev/null +++ b/tests/issue0497.d @@ -0,0 +1,5 @@ +alias f1 = S function(); +alias f2 = S!"foo" function(); +alias f3 = S!5 function(); +alias f4 = S!S function(); +alias f5 = S!(S) function(); diff --git a/tests/otbs/issue0497.d.ref b/tests/otbs/issue0497.d.ref new file mode 100644 index 0000000..eec042e --- /dev/null +++ b/tests/otbs/issue0497.d.ref @@ -0,0 +1,5 @@ +alias f1 = S function(); +alias f2 = S!"foo" function(); +alias f3 = S!5 function(); +alias f4 = S!S function(); +alias f5 = S!(S) function();