From 31118714652aee872464fdc7c393d72b4f9272bf Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Thu, 23 Apr 2015 16:53:31 -0700 Subject: [PATCH] Fix #136 --- src/dfmt/formatter.d | 2 +- tests/allman/issue0136.d.ref | 4 ++++ tests/issue0136.d | 4 ++++ tests/otbs/issue0136.d.ref | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/allman/issue0136.d.ref create mode 100644 tests/issue0136.d create mode 100644 tests/otbs/issue0136.d.ref diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index d351285..669f3a3 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -763,7 +763,7 @@ private: formatAt(); break; case tok!"!": - if (peekIs(tok!"is") && !peekBackIsOneOf(false, tok!"(", tok!"=")) + if ((peekIs(tok!"is") || peekIs(tok!"in")) && !peekBackIsOneOf(false, tok!"(", tok!"=")) write(" "); goto case; case tok!"...": diff --git a/tests/allman/issue0136.d.ref b/tests/allman/issue0136.d.ref new file mode 100644 index 0000000..c5d8941 --- /dev/null +++ b/tests/allman/issue0136.d.ref @@ -0,0 +1,4 @@ +unittest +{ + auto result = name !in aa; +} diff --git a/tests/issue0136.d b/tests/issue0136.d new file mode 100644 index 0000000..076bab8 --- /dev/null +++ b/tests/issue0136.d @@ -0,0 +1,4 @@ +unittest +{ + auto result = name !in aa; +} diff --git a/tests/otbs/issue0136.d.ref b/tests/otbs/issue0136.d.ref new file mode 100644 index 0000000..9f04038 --- /dev/null +++ b/tests/otbs/issue0136.d.ref @@ -0,0 +1,3 @@ +unittest { + auto result = name !in aa; +}