diff options
author | Robert Griesemer <gri@golang.org> | 2016-12-02 16:22:45 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2016-12-09 01:35:23 +0000 |
commit | 4b8895e2ddb8b9aa324417a0d01e6c09c9822e75 (patch) | |
tree | ffd1484c50b28a9b20f0f05da6360d65abd56be9 /src/cmd/compile/internal/syntax/scanner_test.go | |
parent | 3d5df64b3fe16757c9f271c2421715ba6d79b02d (diff) | |
download | go-4b8895e2ddb8b9aa324417a0d01e6c09c9822e75.tar.gz go-4b8895e2ddb8b9aa324417a0d01e6c09c9822e75.zip |
[dev.inline] cmd/compile/internal/syntax: remove gcCompat uses in scanner
- make the scanner unconditionally gc compatible
- consistently use "invalid" instead "illegal" in errors
Reviewed in and cherry-picked from https://go-review.googlesource.com/#/c/33896/.
Change-Id: I4c4253e7392f3311b0d838bbe503576c9469b203
Reviewed-on: https://go-review.googlesource.com/34237
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/scanner_test.go')
-rw-r--r-- | src/cmd/compile/internal/syntax/scanner_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/syntax/scanner_test.go b/src/cmd/compile/internal/syntax/scanner_test.go index 988a74c287..5532780399 100644 --- a/src/cmd/compile/internal/syntax/scanner_test.go +++ b/src/cmd/compile/internal/syntax/scanner_test.go @@ -22,7 +22,7 @@ func TestScanner(t *testing.T) { defer src.Close() var s scanner - s.init(src, nil, nil, false) + s.init(src, nil, nil) for { s.next() if s.tok == _EOF { @@ -51,7 +51,7 @@ func TestTokens(t *testing.T) { // scan source var got scanner - got.init(&bytesReader{buf}, nil, nil, false) + got.init(&bytesReader{buf}, nil, nil) got.next() for i, want := range sampleTokens { nlsemi := false @@ -269,7 +269,7 @@ func TestScanErrors(t *testing.T) { // token-level errors {"x + ~y", "bitwise complement operator is ^", 1, 5}, - {"foo$bar = 0", "illegal character U+0024 '$'", 1, 4}, + {"foo$bar = 0", "invalid character U+0024 '$'", 1, 4}, {"const x = 0xyz", "malformed hex constant", 1, 13}, {"0123456789", "malformed octal constant", 1, 11}, {"0123456789. /* foobar", "comment not terminated", 1, 13}, // valid float constant @@ -348,7 +348,7 @@ func TestScanErrors(t *testing.T) { // TODO(gri) make this use position info t.Errorf("%q: got unexpected %q at line = %d", test.src, msg, line) } - }, nil, true) + }, nil) for { s.next() |