]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: accept 'i' suffix orthogonally on all numbers
authorRobert Griesemer <gri@golang.org>
Fri, 15 Feb 2019 01:34:29 +0000 (17:34 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 19 Feb 2019 22:45:09 +0000 (22:45 +0000)
commit4ad5537bfa47a3cb55bb8194c3b6fa46de938fed
tree5986cf674d69c2c1d872226d857fa7082fdaaba7
parentc3b49186a6781de58a07bc49ae289354ae98e3be
cmd/compile: accept 'i' suffix orthogonally on all numbers

This change accepts the 'i' suffix on binary and octal integer
literals as well as hexadecimal floats. The suffix was already
accepted on decimal integers and floats.

Note that 0123i == 123i for backward-compatibility (and 09i is
valid).

See also the respective language in the spec change:
https://golang.org/cl/161098

Change-Id: I9d2d755cba36a3fa7b9e24308c73754d4568daaf
Reviewed-on: https://go-review.googlesource.com/c/162878
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/gc/mpfloat.go
src/cmd/compile/internal/syntax/scanner.go
src/cmd/compile/internal/syntax/scanner_test.go
src/cmd/compile/internal/syntax/tokens.go
test/literal2.go