| 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 patch class RegExp { | 5 patch class RegExp { |
| 6 /* patch */ factory RegExp(String source, | 6 /* patch */ factory RegExp(String source, |
| 7 {bool multiLine: false, | 7 {bool multiLine: false, |
| 8 bool caseSensitive: true}) { | 8 bool caseSensitive: true}) { |
| 9 return new _JSSyntaxRegExp(source, | 9 return new _JSSyntaxRegExp(source, |
| 10 multiLine: multiLine, | 10 multiLine: multiLine, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 for (int i = 0; i < groupsSpec.length; i++) { | 48 for (int i = 0; i < groupsSpec.length; i++) { |
| 49 groupsList[i] = group(groupsSpec[i]); | 49 groupsList[i] = group(groupsSpec[i]); |
| 50 } | 50 } |
| 51 return groupsList; | 51 return groupsList; |
| 52 } | 52 } |
| 53 | 53 |
| 54 int get groupCount => _regexp._groupCount; | 54 int get groupCount => _regexp._groupCount; |
| 55 | 55 |
| 56 Pattern get pattern => _regexp; | 56 Pattern get pattern => _regexp; |
| 57 | 57 |
| 58 // TODO(12843): Remove when grace period is over. | |
| 59 String get str => input; | |
| 60 | |
| 61 final RegExp _regexp; | 58 final RegExp _regexp; |
| 62 final String input; | 59 final String input; |
| 63 final List<int> _match; | 60 final List<int> _match; |
| 64 static const int _MATCH_PAIR = 2; | 61 static const int _MATCH_PAIR = 2; |
| 65 } | 62 } |
| 66 | 63 |
| 67 | 64 |
| 68 class _JSSyntaxRegExp implements RegExp { | 65 class _JSSyntaxRegExp implements RegExp { |
| 69 factory _JSSyntaxRegExp( | 66 factory _JSSyntaxRegExp( |
| 70 String pattern, | 67 String pattern, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 var match = _re._ExecuteMatch(_str, nextIndex); | 154 var match = _re._ExecuteMatch(_str, nextIndex); |
| 158 if (match == null) { | 155 if (match == null) { |
| 159 _current = null; | 156 _current = null; |
| 160 _re = null; | 157 _re = null; |
| 161 return false; | 158 return false; |
| 162 } | 159 } |
| 163 _current = new _JSRegExpMatch(_re, _str, match); | 160 _current = new _JSRegExpMatch(_re, _str, match); |
| 164 return true; | 161 return true; |
| 165 } | 162 } |
| 166 } | 163 } |
| OLD | NEW |