| 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 const int _maxAscii = 0x7f; | 5 const int _maxAscii = 0x7f; |
| 6 const int _maxLatin1 = 0xff; | 6 const int _maxLatin1 = 0xff; |
| 7 const int _maxUtf16 = 0xffff; | 7 const int _maxUtf16 = 0xffff; |
| 8 const int _maxUnicode = 0x10ffff; | 8 const int _maxUnicode = 0x10ffff; |
| 9 | 9 |
| 10 @patch | 10 @patch |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Alternatively return false and override it on one-byte string classes. | 94 // Alternatively return false and override it on one-byte string classes. |
| 95 int id = ClassID.getID(this); | 95 int id = ClassID.getID(this); |
| 96 return id == ClassID.cidOneByteString || | 96 return id == ClassID.cidOneByteString || |
| 97 id == ClassID.cidExternalOneByteString; | 97 id == ClassID.cidExternalOneByteString; |
| 98 } | 98 } |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * Create the most efficient string representation for specified | 101 * Create the most efficient string representation for specified |
| 102 * [charCodes]. | 102 * [charCodes]. |
| 103 * | 103 * |
| 104 * Only uses the character codes betwen index [start] and index [end] of | 104 * Only uses the character codes between index [start] and index [end] of |
| 105 * `charCodes`. They must satisfy `0 <= start <= end <= charCodes.length`. | 105 * `charCodes`. They must satisfy `0 <= start <= end <= charCodes.length`. |
| 106 * | 106 * |
| 107 * The [limit] is an upper limit on the character codes in the iterable. | 107 * The [limit] is an upper limit on the character codes in the iterable. |
| 108 * It's `null` if unknown. | 108 * It's `null` if unknown. |
| 109 */ | 109 */ |
| 110 static String createFromCharCodes( | 110 static String createFromCharCodes( |
| 111 Iterable<int> charCodes, int start, int end, int limit) { | 111 Iterable<int> charCodes, int start, int end, int limit) { |
| 112 if (start == null) throw new ArgumentError.notNull("start"); | 112 if (start == null) throw new ArgumentError.notNull("start"); |
| 113 if (charCodes == null) throw new ArgumentError(charCodes); | 113 if (charCodes == null) throw new ArgumentError(charCodes); |
| 114 // TODO(srdjan): Also skip copying of wide typed arrays. | 114 // TODO(srdjan): Also skip copying of wide typed arrays. |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 int end = index + _pattern.length; | 1337 int end = index + _pattern.length; |
| 1338 _current = new _StringMatch(index, _input, _pattern); | 1338 _current = new _StringMatch(index, _input, _pattern); |
| 1339 // Empty match, don't start at same location again. | 1339 // Empty match, don't start at same location again. |
| 1340 if (end == _index) end++; | 1340 if (end == _index) end++; |
| 1341 _index = end; | 1341 _index = end; |
| 1342 return true; | 1342 return true; |
| 1343 } | 1343 } |
| 1344 | 1344 |
| 1345 Match get current => _current; | 1345 Match get current => _current; |
| 1346 } | 1346 } |
| OLD | NEW |