-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dotted keys can't define sub-tables within tables indirectly defined in header form #61
Comments
The behaviour is correct; that's not legal TOML. You can't mix The way to do this correctly would be: [fruit.apple.texture]
smooth = true
[fruit.apple]
color = "red"
taste.sweet = true Dotted keys are effectively just shorthand for creating nested inline tables. |
My mistake, I didn't scroll all the way down in toml-lang/toml#771 to see that this issue is still being debated. |
Aye, it's a pretty confusing part of the spec. Given the choice personally I'd remove |
I'm intrigued by this example, maybe I should rather ask this to the discussion in toml-lang/toml#769, but it seems more related to this particular implementation to me. Why would this TOML document be invalid [fruit.apple.texture] # you can add sub-tables
smooth = true
[fruit]
apple.color = "red"
apple.taste.sweet = true but changing the order of the tables be valid instead if dotted keys were shorthands for inline tables? https://godbolt.org/z/ss9xsP [fruit]
apple.color = "red"
apple.taste.sweet = true
[fruit.apple.texture] # you can add sub-tables
smooth = true |
Well, yeah, it shouldn't be. I need to revisit this part of the code (and the spec!), evidently. |
This is fixed now, though won't find it's way into the online parser until whenever that next gets updated; I'm not the maintainer of that project. (cc @bobfang1992) |
I believe based on the online library tester that this library fails to handle this valid TOML document:
I haven't actually used this library outside of the browser, so all I got for you is a playground link: https://godbolt.org/z/T59E7d
Related: toml-lang/toml#771
The text was updated successfully, but these errors were encountered: