When a function had no body, Yyerror was called with an extra
argument, leading to extraneous printouts.
Add the missing verb to the Yyerror call and display the name of the
bodiless function.
Fixes #10030
Change-Id: I76d76c4547fb9cad1782cb11f7a5c63065a6e0c5
Reviewed-on: https://go-review.googlesource.com/6263
Reviewed-by: Rob Pike <r@golang.org>
var gclocals *Sym
if fn.Nbody == nil {
if pure_go != 0 || strings.HasPrefix(fn.Nname.Sym.Name, "init.") {
- Yyerror("missing function body", fn)
+ Yyerror("missing function body for %q", fn.Nname.Sym.Name)
goto ret
}