Fix []*Toml.Tree being wrapped in *Toml.Value (#110)

Nodes can be either *Toml.Tree, []*Toml.Tree, or *Toml.Value.
Arrays of trees were incorrectly wrapped in a *Toml.Value,
making the conversion functions think they were leaf nodes.
This commit is contained in:
Thomas Pelletier
2016-11-23 15:48:39 +01:00
committed by GitHub
parent f7f14983c3
commit 3ddb37c944
2 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ func (p *tomlParser) parseAssign() tomlParserStateFn {
var toInsert interface{}
switch value.(type) {
case *TomlTree:
case *TomlTree, []*TomlTree:
toInsert = value
default:
toInsert = &tomlValue{value, key.Position}