(end TokenType, flushHeredoc bool)
| 18 | } |
| 19 | |
| 20 | func (p *parser) parseTemplate(end TokenType, flushHeredoc bool) (Expression, hcl.Diagnostics) { |
| 21 | exprs, passthru, rng, diags := p.parseTemplateInner(end, flushHeredoc) |
| 22 | |
| 23 | if passthru { |
| 24 | if len(exprs) != 1 { |
| 25 | panic("passthru set with len(exprs) != 1") |
| 26 | } |
| 27 | return &TemplateWrapExpr{ |
| 28 | Wrapped: exprs[0], |
| 29 | SrcRange: rng, |
| 30 | }, diags |
| 31 | } |
| 32 | |
| 33 | return &TemplateExpr{ |
| 34 | Parts: exprs, |
| 35 | SrcRange: rng, |
| 36 | }, diags |
| 37 | } |
| 38 | |
| 39 | func (p *parser) parseTemplateInner(end TokenType, flushHeredoc bool) ([]Expression, bool, hcl.Range, hcl.Diagnostics) { |
| 40 | parts, diags := p.parseTemplateParts(end) |
no test coverage detected