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

Support TOML spec v1.0.0 #373

Open chshersh opened 3 years ago

chshersh commented 3 years ago

The latest spec is released here:

Need to check what changed since 0.5.0. Probably, will be easier to do together with #372.

dariodsa commented 3 years ago
  3.14159 = "pi"
  This line maps to the following JSON
  { "3": { "14159": "pi" } }

I think that for start that should be enough. The specification didn't change too much, it only specified some things more thoroughly.

brandonchinn178 commented 2 years ago

@chshersh any idea when v1 support might be added? Really looking forward to using this library, but heterogenous array support is pretty important to my use-case right now. Or, anything I could do to help?

Also it seems like there's at least one more addition for v1.0.0: plain foo.bar.baz keys seem to be synonymous with a baz key in a [foo.bar] table (alluded to in the Table section)

fruit.apple.color = "red"
# Defines a table named fruit
# Defines a table named fruit.apple

fruit.apple.taste.sweet = true
# Defines a table named fruit.apple.taste
# fruit and fruit.apple were already created

so maybe the TOML type shouldn't distinguish between "pairs" and "tables"? Namely, the following should be exactly equivalent:

# one
fruit.name = "apple"

# two
[fruit]
name = "apple"

I'm still getting familiar with this library, but it seems like these two methods would be queried differently using the combinators in this library?