Support emitting 1.9 Symbol keyword Hash syntax when pretty printing Hashes
Ruby 1.9 first introduced support for keyword Hash syntax for simple Symbol keys. However, Hash#inspect and pp do not emit the same syntax when printing Symbol keys. This patch adds support for "foo: " syntax to the pp_hash method, iff the key is a Symbol and does not contain any spaces or special characters. While the patch is probably not perfect, I hope to start a discussion.
Updated by phluid61 (Matthew Kerwin) about 7 years ago
I think it's better to not add unnecessary complexity. After all, we don't represent strings with single quotes, even when they don't contain escaped characters, and even when they do contain double-quote characters.