hcl/hclsyntax: Fix invalid block parsing test

Invalid blocks now have empty bodies rather than nil bodies, to avoid the
need to callers to specially handle nils here when they are doing analysis
of a partially-invalid file.
This commit is contained in:
Martin Atkins 2018-11-03 19:49:14 +00:00
parent 57c6d75eb8
commit 379d277e2b

View File

@ -297,7 +297,16 @@ block "valid" {}
&Block{
Type: "block",
Labels: []string{"invalid"},
Body: nil,
Body: &Body{
SrcRange: hcl.Range{
Start: hcl.Pos{Line: 2, Column: 1, Byte: 1},
End: hcl.Pos{Line: 2, Column: 6, Byte: 6},
},
EndRange: hcl.Range{
Start: hcl.Pos{Line: 2, Column: 1, Byte: 1},
End: hcl.Pos{Line: 2, Column: 6, Byte: 6},
},
},
TypeRange: hcl.Range{
Start: hcl.Pos{Line: 2, Column: 1, Byte: 1},