emancu / toml-rb

A parser for TOML using Citrus library.
MIT License
104 stars 39 forks source link

Failure to dump empty keys. #147

Closed dreid closed 9 months ago

dreid commented 9 months ago

Per TOML v1.0.0

A bare key must be non-empty, but an empty quoted key is allowed (though discouraged).

Currently, TomlRB will parse:

[foo]
"" = "bar"

as

{"foo"=>{""=>"bar"}}

However it dumps the above as:

[foo]
 = "bar"

Which is invalid TOML that it (rightly) refuses to parse again.