2017-10-03 22:59:20 +00:00
|
|
|
package hcldec
|
|
|
|
|
|
|
|
import (
|
2019-09-09 23:08:19 +00:00
|
|
|
"github.com/hashicorp/hcl/v2"
|
2017-10-03 22:59:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|