When parsing method declarations in an interface, the parser has
for historic reasons gracefully handled a list of method names with
a single (common) signature, and then reported an error. For example
interface {
m1, m2, m3 (x int)
}
This code originally came from the very first parser for Go which
initially permitted such declarations (or at least assumed that
people would write such declarations). Nobody is doing this at this
point, so there's no need for being extra careful here. Remove the
respective code and adjust the corresponding test.
Change-Id: If6f9b398bbc9e425dcd4328a80d8bf77c37fe8b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/396654
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This restores go.errors from before 3af0d79 along with a fixed up
version of the bisonerrors AWK script, translated to Go.
However, this means Yyerror needs access to the yacc parser's state,
which is currently private. To workaround that, add a "state"
accessor method like the Lookahead method added in c7fa3c6.
Update issue #9968.
Change-Id: Ib868789e92fdb7d135442120a392457923e50121
Reviewed-on: https://go-review.googlesource.com/7270
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
These don't work with the new compiler, because the
new compiler doesn't have the custom syntax errors
that I built for the old compiler. It will, just not yet.
(Issue #9968.)
Change-Id: I658f7dab2c7f855340a501f9ae4479c097b28cd3
Reviewed-on: https://go-review.googlesource.com/5632
Reviewed-by: Rob Pike <r@golang.org>
bug121.go:12:3: error: name list not allowed in interface type
bug121.go:16:2: error: expected signature or type name
semi1.go:10:76: error: unexpected semicolon or newline before ‘{’
semi1.go:10:5: error: reference to undefined name ‘x’
semi1.go:10:8: error: reference to undefined name ‘y’
semi1.go:12:3: error: reference to undefined name ‘z’
semi2.go:10:79: error: unexpected semicolon or newline before ‘{’
semi2.go:10:9: error: reference to undefined name ‘x’
semi3.go:10:79: error: unexpected semicolon or newline before ‘{’
semi3.go:10:6: error: reference to undefined name ‘x’
semi3.go:10:9: error: reference to undefined name ‘y’
semi3.go:10:12: error: reference to undefined name ‘z’
semi3.go:12:3: error: reference to undefined name ‘z’
semi4.go:11:2: error: unexpected semicolon or newline before ‘{’
semi4.go:10:6: error: reference to undefined name ‘x’
semi4.go:12:3: error: reference to undefined name ‘z’
semi5.go:10:1: error: unexpected semicolon or newline before ‘{’
semi7.go:11:2: error: unexpected semicolon or newline before ‘else’
semi7.go:10:5: error: reference to undefined name ‘x’
slice.go:9:11: error: missing lower bound in slice expression
slice.go:9:9: error: reference to undefined name ‘y’
slice.go:9:12: error: reference to undefined name ‘z’
R=rsc
CC=golang-dev
https://golang.org/cl/201061
bug039.go:6:7: error: redefinition of 'x'
bug039.go:5:1: note: previous definition of 'x' was here
bug049.go:6:9: error: incompatible types in binary expression
bug062.go:6:7: error: incompatible type in initialization
bug086.go:5:1: error: control reaches end of non-void function
bug103.go:8:2: error: variable has no type
bug121.go:9:2: error: expected signature or type name
bug131.go:7:7: error: incompatible type in initialization
bug165.go:10:8: error: expected complete type
bug171.go:5:1: error: control reaches end of non-void function
bug171.go:6:1: error: control reaches end of non-void function
bug172.go:7:6: error: expected integer type
bug182.go:7:2: error: if statement expects boolean expression
bug183.go:10:5: error: incompatible types in assignment
bug183.go:19:5: error: incompatible types in assignment
R=rsc
DELTA=15 (0 added, 0 deleted, 15 changed)
OCL=33168
CL=33175