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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2329463002: Remove JavaPatternMatcher from java_core. (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/analyzer/lib/src/generated/java_core.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index e26126f0c2db470b9e0ebc52b5a40f0b6b1cee7a..bd862163a0e8be05497d4cd90ddafb3508d24232 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8554,14 +8554,13 @@ class ToDoFinder {
* @param commentToken the comment token to analyze
*/
void _scrapeTodoComment(Token commentToken) {
- JavaPatternMatcher matcher =
- new JavaPatternMatcher(TodoCode.TODO_REGEX, commentToken.lexeme);
- if (matcher.find()) {
+ Iterable<Match> matches = TodoCode.TODO_REGEX.allMatches(commentToken.lexeme);
+ for (Match match in matches) {
int offset =
- commentToken.offset + matcher.start() + matcher.group(1).length;
- int length = matcher.group(2).length;
+ commentToken.offset + match.start + match.group(1).length;
+ int length = match.group(2).length;
_errorReporter.reportErrorForOffset(
- TodoCode.TODO, offset, length, [matcher.group(2)]);
+ TodoCode.TODO, offset, length, [match.group(2)]);
}
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_core.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698