MCPcopy
hub / github.com/hashicorp/hcl / ExprCall

Method ExprCall

json/structure.go:586–606  ·  view source on GitHub ↗

Implementation for hcl.ExprCall.

()

Source from the content-addressed store, hash-verified

584
585// Implementation for hcl.ExprCall.
586func (e *expression) ExprCall() *hcl.StaticCall {
587 // In JSON-based syntax a static call is given as a string containing
588 // an expression in the native syntax that also supports ExprCall.
589
590 switch v := e.src.(type) {
591 case *stringVal:
592 expr, diags := hclsyntax.ParseExpression([]byte(v.Value), v.SrcRange.Filename, v.SrcRange.Start)
593 if diags.HasErrors() {
594 return nil
595 }
596
597 call, diags := hcl.ExprCall(expr)
598 if diags.HasErrors() {
599 return nil
600 }
601
602 return call
603 default:
604 return nil
605 }
606}
607
608// Implementation for hcl.ExprList.
609func (e *expression) ExprList() []hcl.Expression {

Callers

nothing calls this directly

Calls 3

ParseExpressionFunction · 0.92
HasErrorsMethod · 0.80
ExprCallMethod · 0.65

Tested by

no test coverage detected