4 "github.com/hashicorp/terraform/tfdiags"
7 // EvalSequence is an EvalNode that evaluates in sequence.
8 type EvalSequence struct {
12 func (n *EvalSequence) Eval(ctx EvalContext) (interface{}, error) {
13 var diags tfdiags.Diagnostics
15 for _, n := range n.Nodes {
20 if _, err := EvalRaw(n, ctx); err != nil {
21 if _, isEarlyExit := err.(EvalEarlyExitError); isEarlyExit {
22 // In this path we abort early, losing any non-error
23 // diagnostics we saw earlier.
26 diags = diags.Append(err)
27 if diags.HasErrors() {
28 // Halt if we get some errors, but warnings are okay.
34 return nil, diags.ErrWithWarnings()
37 // EvalNodeFilterable impl.
38 func (n *EvalSequence) Filter(fn EvalNodeFilterFunc) {
39 for i, node := range n.Nodes {