From 4b7e37c1da3d908e60a267dc1cf399ec3d7f1e1d Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 8 Mar 2015 18:07:26 -0700 Subject: [PATCH] Fix #73 --- src/dfmt.d | 2 +- tests/issue0073.d | 6 ++++++ tests/issue0073.d.ref | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/issue0073.d create mode 100644 tests/issue0073.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index 5bdb674..37dbe5e 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -290,7 +290,7 @@ private: write(" "); writeParens(true); } - else if (isBlockHeader()) + else if (isBlockHeader() && peekIs(tok!"(", false)) { if (current.type == tok!"if") ifIndents.push(tempIndent); diff --git a/tests/issue0073.d b/tests/issue0073.d new file mode 100644 index 0000000..5a474c0 --- /dev/null +++ b/tests/issue0073.d @@ -0,0 +1,6 @@ +void presumed (out uint column) @trusted { + CXString cxstring; + + clang_getPresumedLocation(cx, &cxstring, &line, &column); + filename = toD(cxstring); + } diff --git a/tests/issue0073.d.ref b/tests/issue0073.d.ref new file mode 100644 index 0000000..6119049 --- /dev/null +++ b/tests/issue0073.d.ref @@ -0,0 +1,7 @@ +void presumed(out uint column) @trusted +{ + CXString cxstring; + + clang_getPresumedLocation(cx, &cxstring, &line, &column); + filename = toD(cxstring); +}