ParseHCL parses the given buffer (which is assumed to have been loaded from the given filename) as a native-syntax configuration file and returns the hcl.File object representing it.
(src []byte, filename string)
| 53 | // the given filename) as a native-syntax configuration file and returns the |
| 54 | // hcl.File object representing it. |
| 55 | func (p *Parser) ParseHCL(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { |
| 56 | if existing := p.files[filename]; existing != nil { |
| 57 | return existing, nil |
| 58 | } |
| 59 | |
| 60 | file, diags := hclsyntax.ParseConfig(src, filename, hcl.Pos{Byte: 0, Line: 1, Column: 1}) |
| 61 | p.files[filename] = file |
| 62 | return file, diags |
| 63 | } |
| 64 | |
| 65 | // ParseHCLFile reads the given filename and parses it as a native-syntax HCL |
| 66 | // configuration file. An error diagnostic is returned if the given file |
no test coverage detected