From c4513d3b6fc67d1e0525b008c6b34fe536ee74b6 Mon Sep 17 00:00:00 2001 From: Pieter Droogendijk Date: Mon, 24 Jan 2011 18:10:50 +1000 Subject: [PATCH] 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 --- src/pkg/json/scanner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } -- 2.50.0