encoding/toml: add support for inline tables
Decoding a field is moved to a method, as now it is used for both
top-level key-values as well as key-values inside an inline table.
We will soon use this method for tables with headers too.
While here, add more edge cases for duplicate keys as well as
test cases where the keys are different but in subtle ways.
And also ensure that go-toml's Unmarshal errors on all the cases
where our decoder errors, primarily to ensure that we are identical
in terms of failing on duplicate keys.
This test validation with go-toml might need to be tweaked
if or when our decoder ever starts giving any CUE-specific errors.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Idfb92615c2bbdfd2cdc7fe299990438bdf4eb009
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1194758
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>