I'm sorry I keep coming up with these picayune edge cases, but these are all things I'm trying to handle in my TOML output stream, and the rules for TOML are considerably stricter than JSON in some ways, so I'm coming up with a bunch of output I can't round-trip through toml.
It's also possible that my reading of the spec is incorrect, although I think the way it deals with the quoted key with the dot in it is just wrong.
toml.parse('["the\\ key"]\n\none = "one"\ntwo = 2\nthree = false')
// => SyntaxError: Expected "]" but " " found.
toml.parse('[a."the\\ key"]\n\none = "one"\ntwo = 2\nthree = false')
// => SyntaxError: Expected "]" but " " found.
toml.parse('[a."the-key"]\n\none = "one"\ntwo = 2\nthree = false')
{ a: { '"the-key"': { one: 'one', two: 2, three: false } } }
toml.parse('[a."the.key"]\n\none = "one"\ntwo = 2\nthree = false')
{ a: { '"the': { 'key"': [Object] } } }
I'm sorry I keep coming up with these picayune edge cases, but these are all things I'm trying to handle in my TOML output stream, and the rules for TOML are considerably stricter than JSON in some ways, so I'm coming up with a bunch of output I can't round-trip through
toml.It's also possible that my reading of the spec is incorrect, although I think the way it deals with the quoted key with the dot in it is just wrong.