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

@ -154,11 +154,11 @@ func testSyntaxErrors(t *testing.T, filename string) {
if found {
rx, err := regexp.Compile(pattern)
if err != nil {
t.Errorf("%s: %v", pos, err)
t.Errorf("%s:%s: %v", filename, pos, err)
return
}
if match := rx.MatchString(e.Msg); !match {
t.Errorf("%s: %q does not match %q", pos, e.Msg, pattern)
t.Errorf("%s:%s: %q does not match %q", filename, pos, e.Msg, pattern)
return
}
// we have a match - eliminate this error