]> Cypherpunks repositories - gostls13.git/commit
text/scanner: accept new Go2 number literals
authorRobert Griesemer <gri@golang.org>
Tue, 5 Feb 2019 20:42:46 +0000 (12:42 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 11 Feb 2019 23:26:17 +0000 (23:26 +0000)
commit710417bc92af19379101acbcd4e0f79dba38c891
treeeff06388438b6f7e98bb18bcd4fe6a09f171d399
parent33ac854481c49632a4b924b184f83e068014b486
text/scanner: accept new Go2 number literals

This CL introduces text/scanner support for the new binary and octal integer
literals, hexadecimal floats, and digit separators for all number literals.
The new code is closely mirroring the respective code for number literals in
cmd/compile/internal/syntax/scanner.go.

Uniformly use the term "invalid" rather than "illegal" in error messages
to match the respective error messages in the other scanners directly.

R=Go1.13

Updates #12711.
Updates #19308.
Updates #28493.
Updates #29008.

Change-Id: I2f291de13ba5afc0e530cd8326e6bf4c3858ebac
Reviewed-on: https://go-review.googlesource.com/c/161199
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/text/scanner/scanner.go
src/text/scanner/scanner_test.go