MCPcopy
hub / github.com/hashicorp/hcl / AsHCLBlock

Method AsHCLBlock

hclsyntax/structure.go:14–28  ·  view source on GitHub ↗

AsHCLBlock returns the block data expressed as a *hcl.Block.

()

Source from the content-addressed store, hash-verified

12
13// AsHCLBlock returns the block data expressed as a *hcl.Block.
14func (b *Block) AsHCLBlock() *hcl.Block {
15 if b == nil {
16 return nil
17 }
18
19 return &hcl.Block{
20 Type: b.Type,
21 Labels: b.Labels,
22 Body: b.Body,
23
24 DefRange: b.DefRange(),
25 TypeRange: b.TypeRange,
26 LabelRanges: b.LabelRanges,
27 }
28}
29
30// Body is the implementation of hcl.Body for the HCL native syntax.
31type Body struct {

Callers 4

InnermostBlockAtPosMethod · 0.80
OutermostBlockAtPosMethod · 0.80
blocksAtPosMethod · 0.80
PartialContentMethod · 0.80

Calls 1

DefRangeMethod · 0.95

Tested by

no test coverage detected