-
Notifications
You must be signed in to change notification settings - Fork 27
Does not support array of inline tables #7
Comments
Hi, your issue is absolutely valid and will be fixed soon. But I'm not sure if your given example
is valid TOML because for the key 'points' the types 'table' and 'array of tables' would get mixed up. What should work instead is something like:
For me, especially these lines of the TOML spec indicate that mixing 'array of tables' and 'tables' is not allowed.
Can you give me a hint, where in the TOML spec is stated, that your example is valid TOML? From the current TOML spec (that is somewhat vague in the area of 'array of tables') I'm not even sure if the following should be allowed:
|
Hi paiden, I share your confusion regarding the TOML spec on tables. I agree with your assessment that my example should be invalid. And, as you pointed out, the alternative valid scenario should be:
Clearly, we are not alone in our doubts regarding the usage of 'array of tables'; there is at least one recent discussion on the TOML page here: toml-lang/toml#309 Perhaps someone on the toml-lang group can resolve this? I'm curious to know the valid usage scenarios. |
This issue should be fixed with 071161d.
as valid TOML. The other given examples given from previous comments are not accepted as valid TOML because handling those cases would cause somewhat weird code in the current parser implementation (as this would need different handling than the other TOML objects). I hope the toml-lang guys really think hard about 'array of tables' as I really don't like the current specification. I also hope at some point they will release an up to date EBNF grammar so that people implementing the TOML standard don't need to rely the textually written specification (that is ambiguous). |
The following example listed on the TOML v0.4.0 specs is parsed as an array instead of a table:
points = [ { x = 1, y = 2, z = 3 }, { x = 7, y = 8, z = 9 }, { x = 2, y = 4, z = 8 } ]
This causes a parsing error when another table entry is specified. E.g.
points = [ { x = 1, y = 2, z = 3 }, { x = 7, y = 8, z = 9 }, { x = 2, y = 4, z = 8 } ]
points = { x = 12, y = 42, z = 35 }
These lines need to be treated as regular array of tables; i.e.
[[points]]
x = 1
y = 2
z = 3
[[points]]
x = 7
...
The text was updated successfully, but these errors were encountered: