From: Pieter Droogendijk Date: Mon, 24 Jan 2011 08:10:50 +0000 (+1000) Subject: json: handle capital floating point exponent (1E100). X-Git-Tag: weekly.2011-02-01~100 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c4513d3b6fc67d1e0525b008c6b34fe536ee74b6;p=gostls13.git 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 --- diff --git a/src/pkg/json/scanner.go b/src/pkg/json/scanner.go index 112c8f9c35..e98ddef5cc 100644 --- a/src/pkg/json/scanner.go +++ b/src/pkg/json/scanner.go @@ -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 }