6c4344623b
The main HCL package is more visible this way, and so it's easier than having to pick it out from dozens of other package directories.
22 lines
351 B
Go
22 lines
351 B
Go
package hcldec
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl/v2"
|
|
)
|
|
|
|
type blockLabel struct {
|
|
Value string
|
|
Range hcl.Range
|
|
}
|
|
|
|
func labelsForBlock(block *hcl.Block) []blockLabel {
|
|
ret := make([]blockLabel, len(block.Labels))
|
|
for i := range block.Labels {
|
|
ret[i] = blockLabel{
|
|
Value: block.Labels[i],
|
|
Range: block.LabelRanges[i],
|
|
}
|
|
}
|
|
return ret
|
|
}
|