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

Unified Diff: sdk/lib/core/pattern.dart

Issue 460613002: Add optional start index to Pattern.allMatches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add extra test. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/lib/string_helper.dart ('k') | sdk/lib/core/regexp.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/pattern.dart
diff --git a/sdk/lib/core/pattern.dart b/sdk/lib/core/pattern.dart
index 92ac07ef5c868ace6c4e68fcfbd1943501657428..ba6381ecb0a879d22a2fdf36a7ff6eab4ab5425e 100644
--- a/sdk/lib/core/pattern.dart
+++ b/sdk/lib/core/pattern.dart
@@ -8,9 +8,15 @@ part of dart.core;
* An interface for basic searches within strings.
*/
abstract class Pattern {
+ // NOTE: When using "start" index from the language library, call
+ // without an argument if start is zero. This allows backwards compatiblity
+ // with implementations of the older interface that didn't have the start
+ // index argument.
/**
* Match this pattern against the string repeatedly.
*
+ * If [start] is provided, matching will start at that index.
+ *
* The iterable will contain all the non-overlapping matches of the
* pattern on the string, ordered by start index.
*
@@ -21,7 +27,7 @@ abstract class Pattern {
* If the pattern matches the empty string at some point, the next
* match is found by starting at the previous match's end plus one.
*/
- Iterable<Match> allMatches(String str);
+ Iterable<Match> allMatches(String string, [int start = 0]);
/**
* Match this pattern against the start of string.
« no previous file with comments | « sdk/lib/_internal/lib/string_helper.dart ('k') | sdk/lib/core/regexp.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698