chiark / gitweb /
Writer: Fix quoting of table keys
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Aug 2020 16:51:46 +0000 (17:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Aug 2020 21:57:41 +0000 (22:57 +0100)
commitdddd27118cd69091dddcbe0b8ab6139a5e8358a4
tree6a3bcf80e894c5193e4714e1d8d6d19a3156cba2
parentf2a7bfaf390094b2c0ac9472c4589aebcdca2f64
Writer: Fix quoting of table keys

Looking only at the first character to decide how to quote is clearly
a mistake.  And if we end up using " we must do \-escaping.

So replace this broken code.  Instead, we now prefer ' if there is
no ' in the key.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
TOML-Tiny/lib/TOML/Tiny/Writer.pm