bitwalker/toml-elixir

Inline tables nested inside arrays of tables sometimes are not associated with their key

Lakret opened this issue · 1 comments

An example:

[[outer]]
inner = { foo = "bar" }

is parsed as:

%{"outer" => [%{"foo" => "bar"}]}

However, adding another outer table:

[[outer]]
inner = { foo = "bar" }

[[outer]]
inner = { foo = "baz" }

will produce this:

%{
    "outer" => [
        %{"foo" => "bar"}, 
        %{"inner" => %{"foo" => "baz"}}
    ]
}

Or, adding another nested inline table:

[[outer]]
inner = { foo = "bar" }
inner2 = { count = 5 }

produces:

%{
    "outer" => [
        %{
            "foo" => "bar", 
            "inner2" => %{"count" => 5}
         }
    ]
}

I'm open to help with fixing it, but will need some pointers where to look :)

I think I may have fixed this inadvertently with #41.