blob: 71de451934a4a8bcccbb81c5e36d8e4c6b0d4144 [file] [log] [blame] [edit]
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
}