From e73280791af8e46cb4b3114e5e6acfa26116d452 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sat, 7 Mar 2015 23:45:50 -0800 Subject: [PATCH] Fix #44 --- src/dfmt.d | 5 ++++- tests/issue0017.d.ref | 4 ++-- tests/issue0044.d | 6 ++++++ tests/issue0044.d.ref | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 tests/issue0044.d create mode 100644 tests/issue0044.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index 0359721..c413dd4 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -505,8 +505,11 @@ private: writeToken(); if (currentIs(tok!"}", false)) tempIndent = 0; - else if (!currentIs(tok!")", false) && !currentIs(tok!"]", false)) + else if (!currentIs(tok!")", false) && !currentIs(tok!"]", false) + && !currentIs(tok!"comment", false)) + { write(" "); + } } regenLineBreakHintsIfNecessary(index - 1); break; diff --git a/tests/issue0017.d.ref b/tests/issue0017.d.ref index 4c5d68f..8a32cec 100644 --- a/tests/issue0017.d.ref +++ b/tests/issue0017.d.ref @@ -1,3 +1,3 @@ -immutable NameId[] namesA = [{"Aacgr", 0x00386}, // GREEK CAPITAL LETTER ALPHA WITH TONOS -{"aacgr", 0x003AC}, // GREEK SMALL LETTER ALPHA WITH TONOS +immutable NameId[] namesA = [{"Aacgr", 0x00386}, // GREEK CAPITAL LETTER ALPHA WITH TONOS +{"aacgr", 0x003AC}, // GREEK SMALL LETTER ALPHA WITH TONOS ]; diff --git a/tests/issue0044.d b/tests/issue0044.d new file mode 100644 index 0000000..c27473a --- /dev/null +++ b/tests/issue0044.d @@ -0,0 +1,6 @@ +enum Sizeok : int +{ + SIZEOKnone, // size of aggregate is not computed yet + SIZEOKdone, // size of aggregate is set correctly + SIZEOKfwd, // error in computing size of aggregate +} diff --git a/tests/issue0044.d.ref b/tests/issue0044.d.ref new file mode 100644 index 0000000..3131959 --- /dev/null +++ b/tests/issue0044.d.ref @@ -0,0 +1,6 @@ +enum Sizeok : int +{ + SIZEOKnone, // size of aggregate is not computed yet + SIZEOKdone, // size of aggregate is set correctly + SIZEOKfwd, // error in computing size of aggregate +}