Fix parser skipping over the whole file (#547)

* Add test for ReferenceFile/struct
* Stop skipping after table
* Add .gitattributes to force LF encoding
* Fix the reference file
This commit is contained in:
Thomas Pelletier
2021-05-30 18:53:07 -04:00
committed by GitHub
parent 840df4a229
commit 11f022ab09
6 changed files with 296 additions and 10 deletions
+2
View File
@@ -198,6 +198,7 @@ func (d *decoder) fromParser(p *parser, v interface{}) error {
err = d.unmarshalKeyValue(current, node)
found = true
case ast.Table:
skipUntilTable = false
d.strict.EnterTable(node)
current, found, err = d.scopeWithKey(root, node.Key())
@@ -210,6 +211,7 @@ func (d *decoder) fromParser(p *parser, v interface{}) error {
ensureMapIfInterface(current)
}
case ast.ArrayTable:
skipUntilTable = false
d.strict.EnterArrayTable(node)
current, found, err = d.scopeWithArrayTable(root, node.Key())
default: