cmd/compile/internal/syntax: assume generic code for std lib

Also: improve some error message prints in testSyntaxErrors.
Change-Id: Iaa1d642398fa82975fefb4bde54f476dd5229eb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/351791
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Robert Griesemer 2021-09-23 20:50:48 -07:00
parent 483533df9e
commit aa878ee49b
2 changed files with 4 additions and 7 deletions

View file

@ -51,10 +51,7 @@ func TestParseGo2(t *testing.T) {
}
}
func TestStdLib(t *testing.T) { testStdLib(t, 0) }
func TestStdLibGeneric(t *testing.T) { testStdLib(t, AllowGenerics) }
func testStdLib(t *testing.T, mode Mode) {
func TestStdLib(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode")
}
@ -93,7 +90,7 @@ func testStdLib(t *testing.T, mode Mode) {
if debug {
fmt.Printf("parsing %s\n", filename)
}
ast, err := ParseFile(filename, nil, nil, mode)
ast, err := ParseFile(filename, nil, nil, AllowGenerics)
if err != nil {
t.Error(err)
return