Commit b3309877 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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

Change-Id: Iec323998133ef20ff962f06a46d15dd342a82f5f
Reviewed-on: https://go-review.googlesource.com/20390Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent f128b542
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// Binary package export. // Binary package export.
// Based loosely on x/tools/go/importer. // 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. // Use "-newexport" flag to enable.
...@@ -155,7 +155,6 @@ func Export(out *obj.Biobuf, trace bool) int { ...@@ -155,7 +155,6 @@ func Export(out *obj.Biobuf, trace bool) int {
p.pkg(localpkg) p.pkg(localpkg)
// write compiler-specific flags // write compiler-specific flags
// go.y:import_safety
{ {
var flags string var flags string
if safemode != 0 { if safemode != 0 {
......
...@@ -53,7 +53,7 @@ func Import(in *obj.Biobuf) { ...@@ -53,7 +53,7 @@ func Import(in *obj.Biobuf) {
importpkg.Safe = p.string() == "safe" importpkg.Safe = p.string() == "safe"
// defer some type-checking until all types are read in completely // defer some type-checking until all types are read in completely
// (go.y:import_there) // (parser.go:import_package)
tcok := typecheckok tcok := typecheckok
typecheckok = true typecheckok = true
defercheckwidth() defercheckwidth()
...@@ -75,7 +75,7 @@ func Import(in *obj.Biobuf) { ...@@ -75,7 +75,7 @@ func Import(in *obj.Biobuf) {
// read funcs // read funcs
for i := p.int(); i > 0; i-- { for i := p.int(); i > 0; i-- {
// go.y:hidden_fndcl // parser.go:hidden_fndcl
sym := p.localname() sym := p.localname()
typ := p.typ() typ := p.typ()
inl := p.int() inl := p.int()
...@@ -90,7 +90,7 @@ func Import(in *obj.Biobuf) { ...@@ -90,7 +90,7 @@ func Import(in *obj.Biobuf) {
declare(n, PFUNC) declare(n, PFUNC)
funchdr(n) funchdr(n)
// go.y:hidden_import // parser.go:hidden_import
n.Func.Inl.Set(nil) n.Func.Inl.Set(nil)
if inl >= 0 { if inl >= 0 {
if inl != len(p.inlined) { if inl != len(p.inlined) {
...@@ -190,12 +190,12 @@ func (p *importer) pkg() *Pkg { ...@@ -190,12 +190,12 @@ func (p *importer) pkg() *Pkg {
} }
func (p *importer) localname() *Sym { func (p *importer) localname() *Sym {
// go.y:hidden_importsym // parser.go:hidden_importsym
name := p.string() name := p.string()
if name == "" { if name == "" {
Fatalf("importer: unexpected anonymous name") Fatalf("importer: unexpected anonymous name")
} }
structpkg = importpkg // go.y:hidden_pkg_importsym structpkg = importpkg // parser.go:hidden_pkg_importsym
return importpkg.Lookup(name) return importpkg.Lookup(name)
} }
...@@ -216,18 +216,18 @@ func (p *importer) typ() *Type { ...@@ -216,18 +216,18 @@ func (p *importer) typ() *Type {
var t *Type var t *Type
switch i { switch i {
case namedTag: case namedTag:
// go.y:hidden_importsym // parser.go:hidden_importsym
tsym := p.qualifiedName() tsym := p.qualifiedName()
// go.y:hidden_pkgtype // parser.go:hidden_pkgtype
t = pkgtype(tsym) t = pkgtype(tsym)
importsym(tsym, OTYPE) importsym(tsym, OTYPE)
p.typList = append(p.typList, t) p.typList = append(p.typList, t)
// read underlying type // read underlying type
// go.y:hidden_type // parser.go:hidden_type
t0 := p.typ() t0 := p.typ()
importtype(t, t0) // go.y:hidden_import importtype(t, t0) // parser.go:hidden_import
// interfaces don't have associated methods // interfaces don't have associated methods
if t0.Etype == TINTER { if t0.Etype == TINTER {
...@@ -236,7 +236,7 @@ func (p *importer) typ() *Type { ...@@ -236,7 +236,7 @@ func (p *importer) typ() *Type {
// read associated methods // read associated methods
for i := p.int(); i > 0; i-- { for i := p.int(); i > 0; i-- {
// go.y:hidden_fndcl // parser.go:hidden_fndcl
name := p.string() name := p.string()
recv := p.paramList() // TODO(gri) do we need a full param list for the receiver? recv := p.paramList() // TODO(gri) do we need a full param list for the receiver?
params := p.paramList() params := p.paramList()
...@@ -261,14 +261,14 @@ func (p *importer) typ() *Type { ...@@ -261,14 +261,14 @@ func (p *importer) typ() *Type {
} }
funchdr(n) 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 // 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 // (dotmeth's type).Nname.Inl, and dotmeth's type has been pulled
// out by typecheck's lookdot as this $$.ttype. So by providing // out by typecheck's lookdot as this $$.ttype. So by providing
// this back link here we avoid special casing there. // this back link here we avoid special casing there.
n.Type.Nname = n n.Type.Nname = n
// go.y:hidden_import // parser.go:hidden_import
n.Func.Inl.Set(nil) n.Func.Inl.Set(nil)
if inl >= 0 { if inl >= 0 {
if inl != len(p.inlined) { if inl != len(p.inlined) {
...@@ -341,7 +341,7 @@ func (p *importer) qualifiedName() *Sym { ...@@ -341,7 +341,7 @@ func (p *importer) qualifiedName() *Sym {
return pkg.Lookup(name) return pkg.Lookup(name)
} }
// go.y:hidden_structdcl_list // parser.go:hidden_structdcl_list
func (p *importer) fieldList() []*Node { func (p *importer) fieldList() []*Node {
i := p.int() i := p.int()
if i == 0 { if i == 0 {
...@@ -354,7 +354,7 @@ func (p *importer) fieldList() []*Node { ...@@ -354,7 +354,7 @@ func (p *importer) fieldList() []*Node {
return n return n
} }
// go.y:hidden_structdcl // parser.go:hidden_structdcl
func (p *importer) field() *Node { func (p *importer) field() *Node {
sym := p.fieldName() sym := p.fieldName()
typ := p.typ() typ := p.typ()
...@@ -388,7 +388,7 @@ func (p *importer) note() (v Val) { ...@@ -388,7 +388,7 @@ func (p *importer) note() (v Val) {
return return
} }
// go.y:hidden_interfacedcl_list // parser.go:hidden_interfacedcl_list
func (p *importer) methodList() []*Node { func (p *importer) methodList() []*Node {
i := p.int() i := p.int()
if i == 0 { if i == 0 {
...@@ -401,7 +401,7 @@ func (p *importer) methodList() []*Node { ...@@ -401,7 +401,7 @@ func (p *importer) methodList() []*Node {
return n return n
} }
// go.y:hidden_interfacedcl // parser.go:hidden_interfacedcl
func (p *importer) method() *Node { func (p *importer) method() *Node {
sym := p.fieldName() sym := p.fieldName()
params := p.paramList() params := p.paramList()
...@@ -409,13 +409,13 @@ func (p *importer) method() *Node { ...@@ -409,13 +409,13 @@ func (p *importer) method() *Node {
return Nod(ODCLFIELD, newname(sym), typenod(functype(fakethis(), params, result))) 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 { func (p *importer) fieldName() *Sym {
name := p.string() name := p.string()
pkg := localpkg pkg := localpkg
if name == "_" { if name == "_" {
// During imports, unqualified non-exported identifiers are from builtinpkg // 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. // identifier without qualification.
pkg = builtinpkg pkg = builtinpkg
} else if name == "?" || name != "" && !exportname(name) { } else if name == "?" || name != "" && !exportname(name) {
...@@ -427,7 +427,7 @@ func (p *importer) fieldName() *Sym { ...@@ -427,7 +427,7 @@ func (p *importer) fieldName() *Sym {
return pkg.Lookup(name) return pkg.Lookup(name)
} }
// go.y:ohidden_funarg_list // parser.go:ohidden_funarg_list
func (p *importer) paramList() []*Node { func (p *importer) paramList() []*Node {
i := p.int() i := p.int()
if i == 0 { if i == 0 {
...@@ -447,7 +447,7 @@ func (p *importer) paramList() []*Node { ...@@ -447,7 +447,7 @@ func (p *importer) paramList() []*Node {
return n return n
} }
// go.y:hidden_funarg // parser.go:hidden_funarg
func (p *importer) param(named bool) *Node { func (p *importer) param(named bool) *Node {
typ := p.typ() typ := p.typ()
...@@ -467,7 +467,7 @@ func (p *importer) param(named bool) *Node { ...@@ -467,7 +467,7 @@ func (p *importer) param(named bool) *Node {
Fatalf("importer: expected named parameter") Fatalf("importer: expected named parameter")
} }
// The parameter package doesn't matter; it's never consulted. // 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)) n.Left = newname(builtinpkg.Lookup(name))
} }
...@@ -548,7 +548,7 @@ func (p *importer) float(x *Mpflt) { ...@@ -548,7 +548,7 @@ func (p *importer) float(x *Mpflt) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Inlined function bodies // Inlined function bodies
// go.y:stmt_list // parser.go:stmt_list
func (p *importer) nodeList() []*Node { func (p *importer) nodeList() []*Node {
c := p.int() c := p.int()
s := make([]*Node, 0, c) s := make([]*Node, 0, c)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment