2019-10-14 11:02:53 -04:00
|
|
|
package hcl2template
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/hcl/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
// reference to the source definition in configuration text file
|
|
|
|
type HCL2Ref struct {
|
|
|
|
// reference to the source definition in configuration text file
|
2020-01-16 06:08:39 -05:00
|
|
|
DefRange hcl.Range
|
|
|
|
TypeRange hcl.Range
|
|
|
|
LabelsRanges []hcl.Range
|
2019-10-14 11:02:53 -04:00
|
|
|
|
|
|
|
// remainder of unparsed body
|
2020-01-16 06:08:39 -05:00
|
|
|
Rest hcl.Body
|
|
|
|
}
|
|
|
|
|
|
|
|
func newHCL2Ref(block *hcl.Block, rest hcl.Body) HCL2Ref {
|
|
|
|
return HCL2Ref{
|
|
|
|
Rest: rest,
|
|
|
|
DefRange: block.DefRange,
|
|
|
|
TypeRange: block.TypeRange,
|
|
|
|
LabelsRanges: block.LabelRanges,
|
|
|
|
}
|
2019-10-14 11:02:53 -04:00
|
|
|
}
|