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

Method parseRoot

hclsyntax/parser_template.go:69–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69func (p *templateParser) parseRoot() ([]Expression, hcl.Diagnostics) {
70 var exprs []Expression
71 var diags hcl.Diagnostics
72
73 for {
74 next := p.Peek()
75 if _, isEnd := next.(*templateEndToken); isEnd {
76 break
77 }
78
79 expr, exprDiags := p.parseExpr()
80 diags = append(diags, exprDiags...)
81 exprs = append(exprs, expr)
82 }
83
84 return exprs, diags
85}
86
87func (p *templateParser) parseExpr() (Expression, hcl.Diagnostics) {
88 next := p.Peek()

Callers 1

parseTemplateInnerMethod · 0.95

Calls 2

PeekMethod · 0.95
parseExprMethod · 0.95

Tested by

no test coverage detected