Floats and integers parsing fixes (#638)

* parser: fix scan of float with exp but no decimal
* decoder: validate leading zeros for decimals
This commit is contained in:
Thomas Pelletier
2021-10-22 22:25:56 -04:00
committed by GitHub
parent feb1830dcc
commit 4d7c9ddac7
4 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -958,7 +958,7 @@ byteLoop:
func (p *parser) scanIntOrFloat(b []byte) (ast.Reference, []byte, error) {
i := 0
if len(b) > 2 && b[0] == '0' && b[1] != '.' {
if len(b) > 2 && b[0] == '0' && b[1] != '.' && b[1] != 'e' {
var isValidRune validRuneFn
switch b[1] {