text/scanner: don't allow Float exponents with no mantissa
Previously Scanner would allow float literals like "1.5e" and "1e+" that weren't actually valid Go float literals, and also not valid when passed to ParseFloat. This commit fixes that behaviour to match the documentation ("recognizes all literals as defined by the Go language specification"), and Scanner emits an error in these cases. Fixes #26374 Change-Id: I6855402ea43febb448c6dff105b9578e31803c01 Reviewed-on: https://go-review.googlesource.com/129095Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Showing
Please
register
or
sign in
to comment