Implementation for hcl.ExprCall.
()
| 584 | |
| 585 | // Implementation for hcl.ExprCall. |
| 586 | func (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. |
| 609 | func (e *expression) ExprList() []hcl.Expression { |
nothing calls this directly
no test coverage detected