]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/syntax: better scanner error messages
authorRobert Griesemer <gri@golang.org>
Tue, 11 Feb 2020 06:02:47 +0000 (22:02 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 5 Mar 2020 00:40:38 +0000 (00:40 +0000)
commitbfb903f2521ff24639aa7a5219330df38b06f412
treec63369cd3ccf4bc9c91c21be02e1ba841e7bf4eb
parent17e6252c051e09a3a433620182fc54952a402d73
cmd/compile/internal/syntax: better scanner error messages

This is one of several changes that were part of a larger rewrite
which I made in early 2019 after switching to the new number literal
syntax implementation. The purpose of the rewrite was to simplify
reading of source code (Unicode character by character) and speed up
the scanner but was never submitted for review due to other priorities.

Part 2 of 3:

This change contains improvements to the scanner error messages:

- Use "rune literal" rather than "character literal" to match the
  spec nomenclature.

- Shorter, more to the point error messages.
  (For instance, "more than one character in rune literal" rather
  than "invalid character literal (more than one character)", etc.)

Change-Id: I1aaf79003374a68dbb05926437ed305cf2a8ec96
Reviewed-on: https://go-review.googlesource.com/c/go/+/221602
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/syntax/scanner.go
src/cmd/compile/internal/syntax/scanner_test.go
test/fixedbugs/bug169.go
test/fixedbugs/issue15611.go
test/fixedbugs/issue32133.go