MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / parseFile

Method parseFile

loader/loader.go:346–355  ·  view source on GitHub ↗

parseFile is a wrapper around parser.ParseFile.

(path string, mode parser.Mode)

Source from the content-addressed store, hash-verified

344
345// parseFile is a wrapper around parser.ParseFile.
346func (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//

Callers 1

parseFilesMethod · 0.95

Calls 1

getOriginalPathMethod · 0.80

Tested by

no test coverage detected