test(number): cover zero-prefixable exponent digits
Assisted-by: GLM 5.3
This commit is contained in:
@@ -104,7 +104,9 @@ func decodeFloat(tok string) (any, error) {
|
||||
build += "." + fp
|
||||
}
|
||||
// The ABNF requires at least one digit after the exponent marker, so a
|
||||
// trailing e or E is an error even though strconv would accept it.
|
||||
// trailing e or E is an error even though strconv would accept it. The
|
||||
// digits are a zero-prefixable integer, so leading zeros are fine here
|
||||
// (the corpus holds valid cases such as 1e06 and 0e00).
|
||||
if hasExp {
|
||||
esign, edigits := splitSign(exp)
|
||||
ed, err := joinDigits(edigits, isDecDigit)
|
||||
|
||||
Reference in New Issue
Block a user