Skip to content
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

Support inline tables #50

Closed
rsim opened this issue Feb 13, 2015 · 2 comments · Fixed by #55
Closed

Support inline tables #50

rsim opened this issue Feb 13, 2015 · 2 comments · Fixed by #55
Assignees
Milestone

Comments

@rsim
Copy link
Contributor

rsim commented Feb 13, 2015

From TOML 0.4.0 specification:

Inline tables provide a more compact syntax for expressing tables. They are especially useful for grouped data that can otherwise quickly become verbose. Inline tables are enclosed in curly braces { and }. Within the braces, zero or more comma separated key/value pairs may appear. Key/value pairs take the same form as key/value pairs in standard tables. All value types are allowed, including inline tables.

Inline tables are intended to appear on a single line. No newlines are allowed between the curly braces unless they are valid within a value. Even so, it is strongly discouraged to break an inline table onto multiples lines. If you find yourself gripped with this desire, it means you should be using standard tables.

name = { first = "Tom", last = "Preston-Werner" }
point = { x = 1, y = 2 }

The inline tables above are identical to the following standard table definitions:

[name]
first = "Tom"
last = "Preston-Werner"

[point]
x = 1
y = 2
@emancu emancu modified the milestone: Specs 0.4.0 Feb 13, 2015
@emancu
Copy link
Owner

emancu commented Feb 18, 2015

@rsim do you know if I have to support nested inline tables ?

@emancu emancu self-assigned this Feb 18, 2015
@rsim
Copy link
Contributor Author

rsim commented Feb 18, 2015

@emancu I can't find if they should be supported or not. In toml-lang/toml#235 pull request there was a discussion about them but didn't see the final answer.
I do not see a need for nested inline tables but it would be good if @mojombo could confirm and clarify TOML spec.

emancu added a commit that referenced this issue Feb 19, 2015
@emancu emancu mentioned this issue Feb 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants