• Ben Hoyt's avatar
    text/scanner: don't allow Float exponents with no mantissa · 6c7e199e
    Ben Hoyt authored
    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: 's avatarRobert Griesemer <gri@golang.org>
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    6c7e199e
scanner_test.go 18 KB