1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // This file opens a back door to the parser for golang.org/x/tools/go/gccgoexportdata.
14 // Parse reads and parses gccgo export data from in and constructs a
15 // Package, inserting it into the imports map.
16 func Parse(in io.Reader, imports map[string]*types.Package, path string) (_ *types.Package, err error) {
18 p.init(path, in, imports)
20 switch x := recover().(type) {
26 panic(x) // resume unexpected panic
29 pkg := p.parsePackage()