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:
parent
57c6d75eb8
commit
379d277e2b
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user