Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: runtime/lib/regexp.dart

Issue 8321024: Clean up (most) uses of Array. Still more to come in the VM corelib code base. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 JSRegExpMatch implements Match { 5 class JSRegExpMatch implements Match {
6 JSRegExpMatch(this.regexp, this.str, this._match); 6 JSRegExpMatch(this.regexp, this.str, this._match);
7 7
8 int start() { 8 int start() {
9 return _start(0); 9 return _start(0);
10 } 10 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 Match firstMatch(String str) { 58 Match firstMatch(String str) {
59 List match = _ExecuteMatch(str, 0); 59 List match = _ExecuteMatch(str, 0);
60 if (match === null) { 60 if (match === null) {
61 return null; 61 return null;
62 } 62 }
63 return new JSRegExpMatch(this, str, match); 63 return new JSRegExpMatch(this, str, match);
64 } 64 }
65 65
66 Iterable<Match> allMatches(String str) { 66 Iterable<Match> allMatches(String str) {
67 var jsregexMatches = new GrowableObjectArray<JSRegExpMatch>(); 67 var jsregexMatches = new List<JSRegExpMatch>();
68 List match = _ExecuteMatch(str, 0); 68 List match = _ExecuteMatch(str, 0);
69 if (match !== null) { 69 if (match !== null) {
70 jsregexMatches.add(new JSRegExpMatch(this, str, match)); 70 jsregexMatches.add(new JSRegExpMatch(this, str, match));
71 while (true) { 71 while (true) {
72 match = _ExecuteMatch(str, match[1]); 72 match = _ExecuteMatch(str, match[1]);
73 if (match === null) { 73 if (match === null) {
74 break; 74 break;
75 } 75 }
76 jsregexMatches.add(new JSRegExpMatch(this, str, match)); 76 jsregexMatches.add(new JSRegExpMatch(this, str, match));
77 } 77 }
(...skipping 18 matching lines...) Expand all
96 96
97 bool get multiLine() native "JSSyntaxRegExp_multiLine"; 97 bool get multiLine() native "JSSyntaxRegExp_multiLine";
98 98
99 bool get ignoreCase() native "JSSyntaxRegExp_ignoreCase"; 99 bool get ignoreCase() native "JSSyntaxRegExp_ignoreCase";
100 100
101 int get _groupCount() native "JSSyntaxRegExp_getGroupCount"; 101 int get _groupCount() native "JSSyntaxRegExp_getGroupCount";
102 102
103 List _ExecuteMatch(String str, int start_index) 103 List _ExecuteMatch(String str, int start_index)
104 native "JSSyntaxRegExp_ExecuteMatch"; 104 native "JSSyntaxRegExp_ExecuteMatch";
105 } 105 }
OLDNEW
« runtime/lib/arrays.dart ('K') | « runtime/lib/object.dart ('k') | runtime/lib/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698