| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |