MCPcopy
hub / github.com/tinygo-org/tinygo / Parse

Method Parse

loader/loader.go:318–337  ·  view source on GitHub ↗

Parse parses all packages and typechecks them. The returned error may be an Errors error, which contains a list of errors. Idempotent.

()

Source from the content-addressed store, hash-verified

316//
317// Idempotent.
318func (p *Program) Parse() error {
319 // Parse all packages.
320 // TODO: do this in parallel.
321 for _, pkg := range p.sorted {
322 err := pkg.Parse()
323 if err != nil {
324 return err
325 }
326 }
327
328 // Typecheck all packages.
329 for _, pkg := range p.sorted {
330 err := pkg.Check()
331 if err != nil {
332 return err
333 }
334 }
335
336 return nil
337}
338
339// OriginalDir returns the real directory name. It is the same as p.Dir except
340// that if it is part of the cached GOROOT, its real location is returned.

Callers 15

TestWebAssemblyFunction · 0.45
parseGoLinkFlagFunction · 0.45
mainFunction · 0.45
writeGoFunction · 0.45
writeAsmFunction · 0.45
mainFunction · 0.45
writeGoFunction · 0.45
writeAsmFunction · 0.45
writeLDFunction · 0.45
mainFunction · 0.45
testCompilePackageFunction · 0.45

Calls 1

CheckMethod · 0.80

Tested by 5

TestWebAssemblyFunction · 0.36
testCompilePackageFunction · 0.36
TestExampleTemplateFunction · 0.36
compileGoFileForTestingFunction · 0.36