@@ -797,23 +797,32 @@ Inline Table
797
797
------------
798
798
799
799
Inline tables provide a more compact syntax for expressing tables. They are
800
- especially useful for grouped data that can otherwise quickly become verbose.
800
+ especially useful for grouped nested data that can otherwise quickly become
801
+ verbose.
802
+
801
803
Inline tables are fully defined within curly braces: ` { ` and ` } ` . Within the
802
804
braces, zero or more comma-separated key/value pairs may appear. Key/value pairs
803
805
take the same form as key/value pairs in standard tables. All value types are
804
806
allowed, including inline tables.
805
807
806
- Inline tables are intended to appear on a single line. A terminating comma (also
807
- called trailing comma) is not permitted after the last key/value pair in an
808
- inline table. No newlines are allowed between the curly braces unless they are
809
- valid within a value. Even so, it is strongly discouraged to break an inline
810
- table onto multiples lines. If you find yourself gripped with this desire, it
811
- means you should be using standard tables.
808
+ Inline tables can have multiple key/value pairs on the same line, or they can be
809
+ put on different lines. A terminating comma (also called trailing comma) is
810
+ permitted after the last key/value pair.
812
811
813
812
``` toml
814
813
name = { first = " Tom" , last = " Preston-Werner" }
815
- point = { x = 1 , y = 2 }
814
+ point = {x = 1 , y = 2 }
816
815
animal = { type.name = " pug" }
816
+ contact = {
817
+ personal = {
818
+ name = " Donald Duck" ,
819
+
820
+ },
821
+ work = {
822
+ name = " Coin cleaner" ,
823
+
824
+ },
825
+ }
817
826
```
818
827
819
828
The inline tables above are identical to the following standard table
@@ -830,6 +839,14 @@ y = 2
830
839
831
840
[animal ]
832
841
type.name = " pug"
842
+
843
+ [contact .personal ]
844
+ name = " Donald Duck"
845
+
846
+
847
+ [contact .work ]
848
+ name = " Coin cleaner"
849
+
833
850
```
834
851
835
852
Inline tables are fully self-contained and define all keys and sub-tables within
0 commit comments