| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface Scanner { | 5 interface Scanner { |
| 6 Token tokenize(); | 6 Token tokenize(); |
| 7 } | 7 } |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Common base class for a Dart scanner. | 10 * Common base class for a Dart scanner. |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 next = tokenizeExponent(advance()); | 455 next = tokenizeExponent(advance()); |
| 456 done = true; | 456 done = true; |
| 457 continue LOOP; | 457 continue LOOP; |
| 458 } else { | 458 } else { |
| 459 done = true; | 459 done = true; |
| 460 continue LOOP; | 460 continue LOOP; |
| 461 } | 461 } |
| 462 next = advance(); | 462 next = advance(); |
| 463 } | 463 } |
| 464 if (!hasDigit) { | 464 if (!hasDigit) { |
| 465 appendByteStringToken(INT_INFO, asciiString(start, -2)); | 465 appendByteStringToken(INT_INFO, asciiString(start, -1)); |
| 466 // TODO(ahe): Wrong offset for the period. | 466 // TODO(ahe): Wrong offset for the period. |
| 467 appendPrecenceToken(PERIOD_INFO); | 467 appendPrecenceToken(PERIOD_INFO); |
| 468 return bigSwitch(next); | 468 return bigSwitch(next); |
| 469 } | 469 } |
| 470 if (next === $d || next === $D) { | 470 if (next === $d || next === $D) { |
| 471 next = advance(); | 471 next = advance(); |
| 472 } | 472 } |
| 473 appendByteStringToken(DOUBLE_INFO, asciiString(start, 0)); | 473 appendByteStringToken(DOUBLE_INFO, asciiString(start, 0)); |
| 474 return next; | 474 return next; |
| 475 } | 475 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 charOffset); | 748 charOffset); |
| 749 } | 749 } |
| 750 } | 750 } |
| 751 | 751 |
| 752 class MalformedInputException { | 752 class MalformedInputException { |
| 753 final String message; | 753 final String message; |
| 754 final position; | 754 final position; |
| 755 MalformedInputException(this.message, this.position); | 755 MalformedInputException(this.message, this.position); |
| 756 toString() => message; | 756 toString() => message; |
| 757 } | 757 } |
| OLD | NEW |