We were letting bignum decide, which caused problems with float literals with a leading 0.
R=gri
CC=golang-dev
https://golang.org/cl/816047
}
func (a *exprInfo) compileFloatLit(lit string) *expr {
- f, _, n := bignum.RatFromString(lit, 0)
+ f, _, n := bignum.RatFromString(lit, 10)
if n != len(lit) {
log.Crashf("malformed float literal %s at %v passed parser", lit, a.pos)
}
Val("+1", bignum.Int(+1)),
Val("+1.0", bignum.Rat(1, 1)),
+ Val("01.5", bignum.Rat(15, 10)),
CErr("+\"x\"", opTypes),
Val("-42", bignum.Int(-42)),