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 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * A sequence of characters. | 8 * A sequence of characters. |
9 * | 9 * |
10 * A string can be either single or multiline. Single line strings are | 10 * A string can be either single or multiline. Single line strings are |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 * Resets the iterator to the rune at the specified index of the string. | 671 * Resets the iterator to the rune at the specified index of the string. |
672 * | 672 * |
673 * Setting a negative [rawIndex], or one greater than or equal to | 673 * Setting a negative [rawIndex], or one greater than or equal to |
674 * [:string.length:], | 674 * [:string.length:], |
675 * is an error. So is setting it in the middle of a surrogate pair. | 675 * is an error. So is setting it in the middle of a surrogate pair. |
676 * | 676 * |
677 * Setting the position to the end of then string will set [current] to null. | 677 * Setting the position to the end of then string will set [current] to null. |
678 */ | 678 */ |
679 void set rawIndex(int rawIndex) { | 679 void set rawIndex(int rawIndex) { |
680 if (rawIndex >= string.length) { | 680 if (rawIndex >= string.length) { |
681 throw new RangeError.range(rawIndex, 0, string.length - 1); | 681 throw new RangeError.index(rawIndex, string); |
682 } | 682 } |
683 reset(rawIndex); | 683 reset(rawIndex); |
684 moveNext(); | 684 moveNext(); |
685 } | 685 } |
686 | 686 |
687 /** | 687 /** |
688 * Resets the iterator to the given index into the string. | 688 * Resets the iterator to the given index into the string. |
689 * | 689 * |
690 * After this the [current] value is unset. | 690 * After this the [current] value is unset. |
691 * You must call [moveNext] make the rune at the position current, | 691 * You must call [moveNext] make the rune at the position current, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 _position = position - 1; | 764 _position = position - 1; |
765 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 765 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
766 return true; | 766 return true; |
767 } | 767 } |
768 } | 768 } |
769 _position = position; | 769 _position = position; |
770 _currentCodePoint = codeUnit; | 770 _currentCodePoint = codeUnit; |
771 return true; | 771 return true; |
772 } | 772 } |
773 } | 773 } |
OLD | NEW |