1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:50:22 -07:00

cmd/compile: fix old comment references to go.y

Change-Id: Iec323998133ef20ff962f06a46d15dd342a82f5f
Reviewed-on: https://go-review.googlesource.com/20390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2016-03-08 18:57:19 +00:00
parent f128b5421e
commit b330987711
2 changed files with 23 additions and 24 deletions

View File

@ -4,7 +4,7 @@
// Binary package export.
// Based loosely on x/tools/go/importer.
// (see fmt.go, go.y as "documentation" for how to use/setup data structures)
// (see fmt.go, parser.go as "documentation" for how to use/setup data structures)
//
// Use "-newexport" flag to enable.
@ -155,7 +155,6 @@ func Export(out *obj.Biobuf, trace bool) int {
p.pkg(localpkg)
// write compiler-specific flags
// go.y:import_safety
{
var flags string
if safemode != 0 {

View File

@ -53,7 +53,7 @@ func Import(in *obj.Biobuf) {
importpkg.Safe = p.string() == "safe"
// defer some type-checking until all types are read in completely
// (go.y:import_there)
// (parser.go:import_package)
tcok := typecheckok
typecheckok = true
defercheckwidth()
@ -75,7 +75,7 @@ func Import(in *obj.Biobuf) {
// read funcs
for i := p.int(); i > 0; i-- {
// go.y:hidden_fndcl
// parser.go:hidden_fndcl
sym := p.localname()
typ := p.typ()
inl := p.int()
@ -90,7 +90,7 @@ func Import(in *obj.Biobuf) {
declare(n, PFUNC)
funchdr(n)
// go.y:hidden_import
// parser.go:hidden_import
n.Func.Inl.Set(nil)
if inl >= 0 {
if inl != len(p.inlined) {
@ -190,12 +190,12 @@ func (p *importer) pkg() *Pkg {
}
func (p *importer) localname() *Sym {
// go.y:hidden_importsym
// parser.go:hidden_importsym
name := p.string()
if name == "" {
Fatalf("importer: unexpected anonymous name")
}
structpkg = importpkg // go.y:hidden_pkg_importsym
structpkg = importpkg // parser.go:hidden_pkg_importsym
return importpkg.Lookup(name)
}
@ -216,18 +216,18 @@ func (p *importer) typ() *Type {
var t *Type
switch i {
case namedTag:
// go.y:hidden_importsym
// parser.go:hidden_importsym
tsym := p.qualifiedName()
// go.y:hidden_pkgtype
// parser.go:hidden_pkgtype
t = pkgtype(tsym)
importsym(tsym, OTYPE)
p.typList = append(p.typList, t)
// read underlying type
// go.y:hidden_type
// parser.go:hidden_type
t0 := p.typ()
importtype(t, t0) // go.y:hidden_import
importtype(t, t0) // parser.go:hidden_import
// interfaces don't have associated methods
if t0.Etype == TINTER {
@ -236,7 +236,7 @@ func (p *importer) typ() *Type {
// read associated methods
for i := p.int(); i > 0; i-- {
// go.y:hidden_fndcl
// parser.go:hidden_fndcl
name := p.string()
recv := p.paramList() // TODO(gri) do we need a full param list for the receiver?
params := p.paramList()
@ -261,14 +261,14 @@ func (p *importer) typ() *Type {
}
funchdr(n)
// (comment from go.y)
// (comment from parser.go)
// inl.C's inlnode in on a dotmeth node expects to find the inlineable body as
// (dotmeth's type).Nname.Inl, and dotmeth's type has been pulled
// out by typecheck's lookdot as this $$.ttype. So by providing
// this back link here we avoid special casing there.
n.Type.Nname = n
// go.y:hidden_import
// parser.go:hidden_import
n.Func.Inl.Set(nil)
if inl >= 0 {
if inl != len(p.inlined) {
@ -341,7 +341,7 @@ func (p *importer) qualifiedName() *Sym {
return pkg.Lookup(name)
}
// go.y:hidden_structdcl_list
// parser.go:hidden_structdcl_list
func (p *importer) fieldList() []*Node {
i := p.int()
if i == 0 {
@ -354,7 +354,7 @@ func (p *importer) fieldList() []*Node {
return n
}
// go.y:hidden_structdcl
// parser.go:hidden_structdcl
func (p *importer) field() *Node {
sym := p.fieldName()
typ := p.typ()
@ -388,7 +388,7 @@ func (p *importer) note() (v Val) {
return
}
// go.y:hidden_interfacedcl_list
// parser.go:hidden_interfacedcl_list
func (p *importer) methodList() []*Node {
i := p.int()
if i == 0 {
@ -401,7 +401,7 @@ func (p *importer) methodList() []*Node {
return n
}
// go.y:hidden_interfacedcl
// parser.go:hidden_interfacedcl
func (p *importer) method() *Node {
sym := p.fieldName()
params := p.paramList()
@ -409,13 +409,13 @@ func (p *importer) method() *Node {
return Nod(ODCLFIELD, newname(sym), typenod(functype(fakethis(), params, result)))
}
// go.y:sym,hidden_importsym
// parser.go:sym,hidden_importsym
func (p *importer) fieldName() *Sym {
name := p.string()
pkg := localpkg
if name == "_" {
// During imports, unqualified non-exported identifiers are from builtinpkg
// (see go.y:sym). The binary exporter only exports blank as a non-exported
// (see parser.go:sym). The binary exporter only exports blank as a non-exported
// identifier without qualification.
pkg = builtinpkg
} else if name == "?" || name != "" && !exportname(name) {
@ -427,7 +427,7 @@ func (p *importer) fieldName() *Sym {
return pkg.Lookup(name)
}
// go.y:ohidden_funarg_list
// parser.go:ohidden_funarg_list
func (p *importer) paramList() []*Node {
i := p.int()
if i == 0 {
@ -447,7 +447,7 @@ func (p *importer) paramList() []*Node {
return n
}
// go.y:hidden_funarg
// parser.go:hidden_funarg
func (p *importer) param(named bool) *Node {
typ := p.typ()
@ -467,7 +467,7 @@ func (p *importer) param(named bool) *Node {
Fatalf("importer: expected named parameter")
}
// The parameter package doesn't matter; it's never consulted.
// We use the builtinpkg per go.y:sym (line 1181).
// We use the builtinpkg per parser.go:sym (line 1181).
n.Left = newname(builtinpkg.Lookup(name))
}
@ -548,7 +548,7 @@ func (p *importer) float(x *Mpflt) {
// ----------------------------------------------------------------------------
// Inlined function bodies
// go.y:stmt_list
// parser.go:stmt_list
func (p *importer) nodeList() []*Node {
c := p.int()
s := make([]*Node, 0, c)