1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:54:42 -07:00

json: handle capital floating point exponent (1E100).

When parsing numbers with an exponent (like "12e-1"), the JSON scanner
would only allow a lowercase 'e', while the RFC also allows the
uppercase 'E'.

R=adg
CC=golang-dev, rsc
https://golang.org/cl/3986042
This commit is contained in:
Pieter Droogendijk 2011-01-24 18:10:50 +10:00 committed by Andrew Gerrand
parent 850ed709ff
commit c4513d3b6f

View File

@ -416,7 +416,7 @@ func state0(s *scanner, c int) int {
s.step = stateDot
return scanContinue
}
if c == 'e' {
if c == 'e' || c == 'E' {
s.step = stateE
return scanContinue
}
@ -440,7 +440,7 @@ func stateDot0(s *scanner, c int) int {
s.step = stateDot0
return scanContinue
}
if c == 'e' {
if c == 'e' || c == 'E' {
s.step = stateE
return scanContinue
}