diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 1847cbc..d68e55e 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -154,7 +154,8 @@ private: { immutable t = tokens[index].type; if (t == tok!"identifier" || isStringLiteral(t) - || isNumberLiteral(t) || t == tok!"characterLiteral") + || isNumberLiteral(t) || t == tok!"characterLiteral" + || isKeyword(t)) write(" "); } } diff --git a/tests/allman/issue0128.d.ref b/tests/allman/issue0128.d.ref new file mode 100644 index 0000000..cba3197 --- /dev/null +++ b/tests/allman/issue0128.d.ref @@ -0,0 +1,5 @@ +unittest +{ + string[string] aa = ["a" : "b"]; + auto x = "a" in aa; +} diff --git a/tests/issue0128.d b/tests/issue0128.d new file mode 100644 index 0000000..96e718e --- /dev/null +++ b/tests/issue0128.d @@ -0,0 +1,5 @@ +unittest +{ + string[string] aa = ["a":"b"]; + auto x = "a" in aa; +} diff --git a/tests/otbs/issue0128.d.ref b/tests/otbs/issue0128.d.ref new file mode 100644 index 0000000..0b1261c --- /dev/null +++ b/tests/otbs/issue0128.d.ref @@ -0,0 +1,4 @@ +unittest { + string[string] aa = ["a" : "b"]; + auto x = "a" in aa; +}