mirror of
https://github.com/golang/go
synced 2024-11-22 03:54:39 -07:00
go/scanner: delete unnecessary type declarations
R=rsc, r2 CC=golang-dev https://golang.org/cl/2735041
This commit is contained in:
parent
5556f733c7
commit
c77f090085
@ -427,14 +427,11 @@ func TestSemis(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type seg struct {
|
var segments = []struct {
|
||||||
srcline string // a line of source text
|
srcline string // a line of source text
|
||||||
filename string // filename for current token
|
filename string // filename for current token
|
||||||
line int // line number for current token
|
line int // line number for current token
|
||||||
}
|
}{
|
||||||
|
|
||||||
|
|
||||||
var segments = []seg{
|
|
||||||
// exactly one token per line since the test consumes one token per segment
|
// exactly one token per line since the test consumes one token per segment
|
||||||
{" line1", "TestLineComments", 1},
|
{" line1", "TestLineComments", 1},
|
||||||
{"\nline2", "TestLineComments", 2},
|
{"\nline2", "TestLineComments", 2},
|
||||||
@ -604,14 +601,12 @@ func checkError(t *testing.T, src string, tok token.Token, pos int, err string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type srcerr struct {
|
var errors = []struct {
|
||||||
src string
|
src string
|
||||||
tok token.Token
|
tok token.Token
|
||||||
pos int
|
pos int
|
||||||
err string
|
err string
|
||||||
}
|
}{
|
||||||
|
|
||||||
var errors = []srcerr{
|
|
||||||
{"\"\"", token.STRING, 0, ""},
|
{"\"\"", token.STRING, 0, ""},
|
||||||
{"\"", token.STRING, 0, "string not terminated"},
|
{"\"", token.STRING, 0, "string not terminated"},
|
||||||
{"/**/", token.COMMENT, 0, ""},
|
{"/**/", token.COMMENT, 0, ""},
|
||||||
|
Loading…
Reference in New Issue
Block a user