Commit c4513d3b authored by Pieter Droogendijk's avatar Pieter Droogendijk Committed by Andrew Gerrand

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
parent 850ed709
...@@ -416,7 +416,7 @@ func state0(s *scanner, c int) int { ...@@ -416,7 +416,7 @@ func state0(s *scanner, c int) int {
s.step = stateDot s.step = stateDot
return scanContinue return scanContinue
} }
if c == 'e' { if c == 'e' || c == 'E' {
s.step = stateE s.step = stateE
return scanContinue return scanContinue
} }
...@@ -440,7 +440,7 @@ func stateDot0(s *scanner, c int) int { ...@@ -440,7 +440,7 @@ func stateDot0(s *scanner, c int) int {
s.step = stateDot0 s.step = stateDot0
return scanContinue return scanContinue
} }
if c == 'e' { if c == 'e' || c == 'E' {
s.step = stateE s.step = stateE
return scanContinue return scanContinue
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment