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 class String { | 10 @patch class String { |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 | 1280 |
1281 int codeUnitAt(int index) native "String_codeUnitAt"; | 1281 int codeUnitAt(int index) native "String_codeUnitAt"; |
1282 | 1282 |
1283 bool operator ==(Object other) { | 1283 bool operator ==(Object other) { |
1284 return super == other; | 1284 return super == other; |
1285 } | 1285 } |
1286 } | 1286 } |
1287 | 1287 |
1288 | 1288 |
1289 class _StringMatch implements Match { | 1289 class _StringMatch implements Match { |
1290 const _StringMatch(int this.start, | 1290 const _StringMatch(this.start, this.input, this.pattern); |
1291 String this.input, | |
1292 String this.pattern); | |
1293 | 1291 |
1294 int get end => start + pattern.length; | 1292 int get end => start + pattern.length; |
1295 String operator[](int g) => group(g); | 1293 String operator[](int g) => group(g); |
1296 int get groupCount => 0; | 1294 int get groupCount => 0; |
1297 | 1295 |
1298 String group(int group) { | 1296 String group(int group) { |
1299 if (group != 0) { | 1297 if (group != 0) { |
1300 throw new RangeError.value(group); | 1298 throw new RangeError.value(group); |
1301 } | 1299 } |
1302 return pattern; | 1300 return pattern; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 int end = index + _pattern.length; | 1355 int end = index + _pattern.length; |
1358 _current = new _StringMatch(index, _input, _pattern); | 1356 _current = new _StringMatch(index, _input, _pattern); |
1359 // Empty match, don't start at same location again. | 1357 // Empty match, don't start at same location again. |
1360 if (end == _index) end++; | 1358 if (end == _index) end++; |
1361 _index = end; | 1359 _index = end; |
1362 return true; | 1360 return true; |
1363 } | 1361 } |
1364 | 1362 |
1365 Match get current => _current; | 1363 Match get current => _current; |
1366 } | 1364 } |
OLD | NEW |