emancu/toml-rb

Array table with a new parent key is parsed incorrectly

Closed this issue · 0 comments

rsim commented

Checked with the current master branch version

>> TOML.parse "[[a.b]]\nb=1"
=> {"a"=>[{"b"=>[{"b"=>1}]}]}

but the correct result should be

=> {"a"=>{"b"=>[{"b"=>1}]}}

Also

>> TOML.parse "[[a.b]]\nb=1\n[[a.c]]\nc=2\n"
=> {"a"=>[{"b"=>[{"b"=>1}], "c"=>[{"c"=>2}]}]}

but the correct result should be

=> {"a"=>{"b"=>[{"b"=>1}], "c"=>[{"c"=>2}]}}