diff --git a/src/dfmt.d b/src/dfmt.d index 70b6209..f66a504 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -283,11 +283,12 @@ private: } else if (current.type == tok!"switch") formatSwitch(); - else if (current.type == tok!"version" && peekIs(tok!"(")) + else if ((current.type == tok!"version" || current.type == tok!"extern") + && peekIs(tok!"(")) { writeToken(); write(" "); - writeParens(false); + writeParens(true); } else if (currentIsBlockHeader()) { diff --git a/tests/issue0026.d.ref b/tests/issue0026.d.ref index 17c536b..902bfd9 100644 --- a/tests/issue0026.d.ref +++ b/tests/issue0026.d.ref @@ -1 +1 @@ -extern(C++) int HtmlNamedEntity(const(char)* p, size_t length); +extern (C++) int HtmlNamedEntity(const(char)* p, size_t length); diff --git a/tests/issue0039.d b/tests/issue0039.d new file mode 100644 index 0000000..002e8d2 --- /dev/null +++ b/tests/issue0039.d @@ -0,0 +1,2 @@ +version(AArch64) +int x = 10; diff --git a/tests/issue0039.d.ref b/tests/issue0039.d.ref new file mode 100644 index 0000000..206b331 --- /dev/null +++ b/tests/issue0039.d.ref @@ -0,0 +1 @@ +version (AArch64) int x = 10;