kowainik / tomland

🏝 Bidirectional TOML serialization
https://kowainik.github.io/posts/2019-01-14-tomland
Mozilla Public License 2.0
121 stars 39 forks source link

Inconsistent parsing of toml tables #356

Open bitc opened 3 years ago

bitc commented 3 years ago

Hello, it is my understanding that the following two TOML files are supposed to be completely identical:

1

[a]
[a.b]
c = 1
d = 2

2

[a]
b.c = 1
b.d = 2

For example, when I convert it to JSON using this tool https://pseitz.github.io/toml-to-json-online-converter/ I get for both of them:

{
  "a": {
    "b": {
      "c": 1,
      "d": 2
    }
  }
}

But the tomland library seems to think they are different and doesn't generate a "b" table properly in the second snippet.

What I expect to happen: Any code that uses tomland and succesfully parses the first snippet, should get the same results when the second snippet is fed in, and vice versa.

Thank you

Qqwy commented 1 year ago

This is a variation of this issue: https://github.com/kowainik/tomland/issues/336