| 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 pattern, | 6 /* patch */ factory RegExp(String pattern, |
| 7 {bool multiLine: false, | 7 {bool multiLine: false, |
| 8 bool caseSensitive: true}) { | 8 bool caseSensitive: true}) { |
| 9 return new _JSSyntaxRegExp(pattern, | 9 return new _JSSyntaxRegExp(pattern, |
| 10 multiLine: multiLine, | 10 multiLine: multiLine, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 return null; | 37 return null; |
| 38 } | 38 } |
| 39 return str._substringUnchecked(startIndex, endIndex); | 39 return str._substringUnchecked(startIndex, endIndex); |
| 40 } | 40 } |
| 41 | 41 |
| 42 String operator [](int groupIdx) { | 42 String operator [](int groupIdx) { |
| 43 return this.group(groupIdx); | 43 return this.group(groupIdx); |
| 44 } | 44 } |
| 45 | 45 |
| 46 List<String> groups(List<int> groupsSpec) { | 46 List<String> groups(List<int> groupsSpec) { |
| 47 var groupsList = new List<String>.fixedLength(groupsSpec.length); | 47 var groupsList = new List<String>(groupsSpec.length); |
| 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 String get pattern => regexp.pattern; | 56 String get pattern => regexp.pattern; |
| 57 | 57 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 bool get isMultiLine native "JSSyntaxRegExp_getIsMultiLine"; | 117 bool get isMultiLine native "JSSyntaxRegExp_getIsMultiLine"; |
| 118 | 118 |
| 119 bool get isCaseSensitive native "JSSyntaxRegExp_getIsCaseSensitive"; | 119 bool get isCaseSensitive native "JSSyntaxRegExp_getIsCaseSensitive"; |
| 120 | 120 |
| 121 int get _groupCount native "JSSyntaxRegExp_getGroupCount"; | 121 int get _groupCount native "JSSyntaxRegExp_getGroupCount"; |
| 122 | 122 |
| 123 List _ExecuteMatch(String str, int start_index) | 123 List _ExecuteMatch(String str, int start_index) |
| 124 native "JSSyntaxRegExp_ExecuteMatch"; | 124 native "JSSyntaxRegExp_ExecuteMatch"; |
| 125 } | 125 } |
| OLD | NEW |