toml-lang / toml

Tom's Obvious, Minimal Language
https://toml.io
MIT License
19.45k stars 847 forks source link

Support for indentation in inline tables #920

Closed willpinha closed 2 years ago

willpinha commented 2 years ago

Is there a way to support indentation in inline tables? So instead of doing:

user = { name="abc", password = false }

We can do:

user = {
  name="abc",
  password = false
}

This is especially useful when we are dealing with many fields in the inline table.

marzer commented 2 years ago

Support for this was added in https://github.com/toml-lang/toml/pull/904. Changelog: https://github.com/toml-lang/toml/blob/main/CHANGELOG.md

eksortso commented 2 years ago

Keep in mind that, even with multi-line inline tables, indentation is ignored. What makes this work for you (once your parser supports it) are the commas and line breaks, not the indents.