go.tools/go/types: fix build (gc export format changed)
Revision f280b8a485fd of the std library changed the gc export format: anonymous fields may be qualified with a package. R=rsc TBR=rsc CC=golang-dev https://golang.org/cl/14312043
This commit is contained in:
parent
63365376db
commit
b9b3bed16e
|
@ -349,13 +349,18 @@ func (p *gcParser) parseDotIdent() string {
|
||||||
return ident
|
return ident
|
||||||
}
|
}
|
||||||
|
|
||||||
// QualifiedName = "@" PackageId "." dotIdentifier .
|
// QualifiedName = "@" PackageId "." ( "?" | dotIdentifier ) .
|
||||||
//
|
//
|
||||||
func (p *gcParser) parseQualifiedName() (id, name string) {
|
func (p *gcParser) parseQualifiedName() (id, name string) {
|
||||||
p.expect('@')
|
p.expect('@')
|
||||||
id = p.parsePackageId()
|
id = p.parsePackageId()
|
||||||
p.expect('.')
|
p.expect('.')
|
||||||
|
// Per rev f280b8a485fd (10/2/2013), qualified names may be used for anoymous fields.
|
||||||
|
if p.tok == '?' {
|
||||||
|
p.next()
|
||||||
|
} else {
|
||||||
name = p.parseDotIdent()
|
name = p.parseDotIdent()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +484,7 @@ func (p *gcParser) parseField() (*Var, string) {
|
||||||
pkg = nil
|
pkg = nil
|
||||||
name = typ.name
|
name = typ.name
|
||||||
case *Named:
|
case *Named:
|
||||||
pkg = typ.obj.pkg
|
pkg = typ.obj.pkg // TODO(gri) is this still correct?
|
||||||
name = typ.obj.name
|
name = typ.obj.name
|
||||||
default:
|
default:
|
||||||
p.errorf("anonymous field expected")
|
p.errorf("anonymous field expected")
|
||||||
|
|
Loading…
Reference in New Issue