parseFile is a wrapper around parser.ParseFile.
(path string, mode parser.Mode)
| 344 | |
| 345 | // parseFile is a wrapper around parser.ParseFile. |
| 346 | func (p *Package) parseFile(path string, mode parser.Mode) (*ast.File, error) { |
| 347 | originalPath := p.program.getOriginalPath(path) |
| 348 | data, err := os.ReadFile(path) |
| 349 | if err != nil { |
| 350 | return nil, err |
| 351 | } |
| 352 | sum := sha512.Sum512_224(data) |
| 353 | p.FileHashes[originalPath] = sum[:] |
| 354 | return parser.ParseFile(p.program.fset, originalPath, data, mode) |
| 355 | } |
| 356 | |
| 357 | // Parse parses and typechecks this package. |
| 358 | // |
no test coverage detected