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 class StringImplementation implements String native "String" { | 5 class StringImplementation implements String native "String" { |
6 factory StringImplementation.fromValues(List<int> values) { | 6 factory StringImplementation.fromValues(List<int> values) { |
7 return _newFromValues(values); | 7 return _newFromValues(values); |
8 } | 8 } |
9 | 9 |
10 String operator[](int index) { | 10 String operator[](int index) { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 class _StringMatch implements Match { | 207 class _StringMatch implements Match { |
208 const _StringMatch(int this._start, | 208 const _StringMatch(int this._start, |
209 String this.str, | 209 String this.str, |
210 String this.pattern); | 210 String this.pattern); |
211 | 211 |
212 int start() => _start; | 212 int start() => _start; |
213 int end() => _start + pattern.length; | 213 int end() => _start + pattern.length; |
214 String operator[](int g) => group(g); | 214 String operator[](int g) => group(g); |
215 int groupCount() => 0; | 215 int groupCount() => 0; |
216 | 216 |
217 String group(int group) { | 217 String group(int group_) { |
218 if (group != 0) { | 218 if (group_ != 0) { |
219 throw new IndexOutOfRangeException(group); | 219 throw new IndexOutOfRangeException(group_); |
220 } | 220 } |
221 return pattern; | 221 return pattern; |
222 } | 222 } |
223 | 223 |
224 List<String> groups(List<int> groups) { | 224 List<String> groups(List<int> groups_) { |
225 List<String> result = new List<String>(); | 225 List<String> result = new List<String>(); |
226 for (int g in groups) { | 226 for (int g in groups_) { |
227 result.add(group(g)); | 227 result.add(group(g)); |
228 } | 228 } |
229 return result; | 229 return result; |
230 } | 230 } |
231 | 231 |
232 final int _start; | 232 final int _start; |
233 final String str; | 233 final String str; |
234 final String pattern; | 234 final String pattern; |
235 } | 235 } |
OLD | NEW |