cmd/compile/internal/syntax: accept "~" and "|" interface elements

Type lists continue to be accepted as before.

While at it, print missing filenames in error tests
(which uses an ad-hoc position representation).

Change-Id: I933b3acbc9cf1985ad8f70f6b206e3a1dbd64d1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/307371
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2021-04-05 19:10:22 -07:00
parent 1129a60f1c
commit 4638545d85
4 changed files with 126 additions and 17 deletions

View file

@ -164,7 +164,7 @@ func testSyntaxErrors(t *testing.T, filename string) {
// we have a match - eliminate this error
delete(declared, pos)
} else {
t.Errorf("%s: unexpected error: %s", orig, e.Msg)
t.Errorf("%s:%s: unexpected error: %s", filename, orig, e.Msg)
}
}, nil, mode)
@ -175,7 +175,7 @@ func testSyntaxErrors(t *testing.T, filename string) {
// report expected but not reported errors
for pos, pattern := range declared {
t.Errorf("%s: missing error: %s", pos, pattern)
t.Errorf("%s:%s: missing error: %s", filename, pos, pattern)
}
}