2017-09-11 23:40:37 +00:00
|
|
|
package hclsyntax
|
2017-05-23 15:05:44 +00:00
|
|
|
|
|
|
|
import (
|
2019-09-09 23:08:19 +00:00
|
|
|
"github.com/hashicorp/hcl/v2"
|
2017-05-23 15:05:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Node is the abstract type that every AST node implements.
|
|
|
|
//
|
|
|
|
// This is a closed interface, so it cannot be implemented from outside of
|
|
|
|
// this package.
|
|
|
|
type Node interface {
|
|
|
|
// This is the mechanism by which the public-facing walk functions
|
|
|
|
// are implemented. Implementations should call the given function
|
|
|
|
// for each child node and then replace that node with its return value.
|
|
|
|
// The return value might just be the same node, for non-transforming
|
|
|
|
// walks.
|
|
|
|
walkChildNodes(w internalWalkFunc)
|
|
|
|
|
2017-09-11 23:40:37 +00:00
|
|
|
Range() hcl.Range
|
2017-05-23 15:05:44 +00:00
|
|
|
}
|
|
|
|
|
2018-09-26 14:38:43 +00:00
|
|
|
type internalWalkFunc func(Node)
|