func (p *Program) parseFile(path string, mode parser.Mode) (*ast.File, error) {
	if p.fset == nil {
		p.fset = token.NewFileSet()
	}

	rd, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer rd.Close()
	relpath := path
	if filepath.IsAbs(path) {
		relpath, err = filepath.Rel(p.Dir, path)
		if err != nil {
			return nil, err
		}
	}
	return parser.ParseFile(p.fset, relpath, rd, mode)
}
// parseFile is a wrapper around parser.ParseFile.
parseFile is a wrapper around parser.ParseFile.
// parseFile is a wrapper around parser . ParseFile .
func (p *Program) parseFile(path string, mode parser.Mode) (*ast.File, error) {
	if p.fset == nil {
		p.fset = token.NewFileSet()
	}
	rd, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer rd.Close()
	relpath := path
	if filepath.IsAbs(path) {
		relpath, err = filepath.Rel(p.Dir, path)
		if err != nil {
			return nil, err
		}
	}
	return parser.ParseFile(p.fset, relpath, rd, mode)
}
func ( p * Program ) parseFile ( path string , mode parser . Mode ) ( * ast . File , error ) { if p . fset == nil { p . fset = token . NewFileSet ( ) } rd , err := os . Open ( path ) if err != nil { return nil , err } defer rd . Close ( ) relpath := path if filepath . IsAbs ( path ) { relpath , err = filepath . Rel ( p . Dir , path ) if err != nil { return nil , err } } return parser . ParseFile ( p . fset , relpath , rd , mode ) }
parseFile is a wrapper around parser.ParseFile.
parseFile is a wrapper around parser . ParseFile .