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()
// 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()
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) {
}
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)
}
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 {
// 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()
}
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) {
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 {
return n
}
-// go.y:hidden_structdcl
+// parser.go:hidden_structdcl
func (p *importer) field() *Node {
sym := p.fieldName()
typ := p.typ()
return
}
-// go.y:hidden_interfacedcl_list
+// parser.go:hidden_interfacedcl_list
func (p *importer) methodList() []*Node {
i := p.int()
if i == 0 {
return n
}
-// go.y:hidden_interfacedcl
+// parser.go:hidden_interfacedcl
func (p *importer) method() *Node {
sym := p.fieldName()
params := p.paramList()
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) {
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 {
return n
}
-// go.y:hidden_funarg
+// parser.go:hidden_funarg
func (p *importer) param(named bool) *Node {
typ := p.typ()
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))
}
// ----------------------------------------------------------------------------
// Inlined function bodies
-// go.y:stmt_list
+// parser.go:stmt_list
func (p *importer) nodeList() []*Node {
c := p.int()
s := make([]*Node, 0, c)