From 578ded512e6617fb2c842a7d3453c7ad2c025853 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 15 Mar 2015 04:30:55 -0700 Subject: [PATCH] Fix #106 --- src/dfmt.d | 3 ++- tests/allman/issue0106.d.ref | 3 +++ tests/issue0106.d | 3 +++ tests/otbs/issue0106.d.ref | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/allman/issue0106.d.ref create mode 100644 tests/issue0106.d create mode 100644 tests/otbs/issue0106.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index ae5f09f..76fbc92 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -383,7 +383,8 @@ private: case tok!"enum": indents.push(tok!"enum"); writeToken(); - write(" "); + if (!currentIs(tok!":")) + write(" "); break; default: if (index + 1 < tokens.length) diff --git a/tests/allman/issue0106.d.ref b/tests/allman/issue0106.d.ref new file mode 100644 index 0000000..00d28ef --- /dev/null +++ b/tests/allman/issue0106.d.ref @@ -0,0 +1,3 @@ +enum : int +{ +} diff --git a/tests/issue0106.d b/tests/issue0106.d new file mode 100644 index 0000000..33c2663 --- /dev/null +++ b/tests/issue0106.d @@ -0,0 +1,3 @@ +enum:int +{ +} diff --git a/tests/otbs/issue0106.d.ref b/tests/otbs/issue0106.d.ref new file mode 100644 index 0000000..9045b4f --- /dev/null +++ b/tests/otbs/issue0106.d.ref @@ -0,0 +1,2 @@ +enum : int { +}