diff --git a/src/cmd/compile/internal/gc/parser.go b/src/cmd/compile/internal/gc/parser.go index a3f30793939..c3f131fe764 100644 --- a/src/cmd/compile/internal/gc/parser.go +++ b/src/cmd/compile/internal/gc/parser.go @@ -142,7 +142,6 @@ func (p *parser) syntax_error(msg string) { var tok string switch p.tok { case LLITERAL: - // this is also done in Yyerror but it's cleaner to do it here tok = litbuf case LNAME: if p.sym_ != nil && p.sym_.Name != "" { diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index 163ecbc34c1..0d25ddf2af9 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -134,16 +134,6 @@ func Yyerror(format string, args ...interface{}) { return } - // The grammar has { and LBRACE but both show up as {. - // Rewrite syntax error referring to "{ or {" to say just "{". - // The grammar has ? and @ but only for reading imports. - // Silence them in ordinary errors. - msg = strings.Replace(msg, "{ or {", "{", -1) - msg = strings.Replace(msg, " or ?", "", -1) - msg = strings.Replace(msg, " or @", "", -1) - - msg = strings.Replace(msg, "LLITERAL", litbuf, -1) - yyerrorl(int(lexlineno), "%s", msg) return }