Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1170)

Side by Side Diff: lib/json/json.dart

Issue 10307003: Update locale char when moving position in number parsing in the JSON parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/utils/json_test.dart » ('j') | tests/utils/json_test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("json"); 5 #library("json");
6 6
7 // Pure Dart implementation of JSON protocol. 7 // Pure Dart implementation of JSON protocol.
8 8
9 /** 9 /**
10 * Utility class to parse JSON and serialize objects to JSON. 10 * Utility class to parse JSON and serialize objects to JSON.
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 char = _nextChar(); 297 char = _nextChar();
298 isInt = false; 298 isInt = false;
299 while (_isDigit(char)) char = _nextChar(); 299 while (_isDigit(char)) char = _nextChar();
300 } else { 300 } else {
301 _error('Expected digit following comma'); 301 _error('Expected digit following comma');
302 } 302 }
303 } 303 }
304 304
305 if (char === CHAR_E || char === CHAR_CAPITAL_E) { 305 if (char === CHAR_E || char === CHAR_CAPITAL_E) {
306 char = _nextChar(); 306 char = _nextChar();
307 if (char === MINUS || char === PLUS) position++; 307 if (char === MINUS || char === PLUS) char = _nextChar();
308 if (_isDigit(char)) { 308 if (_isDigit(char)) {
309 char = _nextChar(); 309 char = _nextChar();
310 isInt = false; 310 isInt = false;
311 while (_isDigit(char)) char = _nextChar(); 311 while (_isDigit(char)) char = _nextChar();
312 } else { 312 } else {
313 _error('Expected digit following \'e\' or \'E\''); 313 _error('Expected digit following \'e\' or \'E\'');
314 } 314 }
315 } 315 }
316 316
317 String number = json.substring(startPos, position); 317 String number = json.substring(startPos, position);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 }); 520 });
521 _sb.add('}'); 521 _sb.add('}');
522 _seen.removeLast(); 522 _seen.removeLast();
523 return; 523 return;
524 524
525 default: 525 default:
526 throw const JsonUnsupportedObjectType(); 526 throw const JsonUnsupportedObjectType();
527 } 527 }
528 } 528 }
529 } 529 }
OLDNEW
« no previous file with comments | « no previous file | tests/utils/json_test.dart » ('j') | tests/utils/json_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698