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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2070553002: Fix "ignore:" handling with upper case error codes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/error_suppression_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 */ 3162 */
3163 static IgnoreInfo calculateIgnores(String content, LineInfo info) { 3163 static IgnoreInfo calculateIgnores(String content, LineInfo info) {
3164 Iterable<Match> matches = _IGNORE_MATCHER.allMatches(content); 3164 Iterable<Match> matches = _IGNORE_MATCHER.allMatches(content);
3165 if (matches.isEmpty) { 3165 if (matches.isEmpty) {
3166 return _EMPTY_INFO; 3166 return _EMPTY_INFO;
3167 } 3167 }
3168 3168
3169 IgnoreInfo ignoreInfo = new IgnoreInfo(); 3169 IgnoreInfo ignoreInfo = new IgnoreInfo();
3170 for (Match match in matches) { 3170 for (Match match in matches) {
3171 // See _IGNORE_MATCHER for format --- note the possibility of error lists. 3171 // See _IGNORE_MATCHER for format --- note the possibility of error lists.
3172 Iterable<String> codes = 3172 Iterable<String> codes = match
3173 match.group(1).split(',').map((String code) => code.trim()); 3173 .group(1)
3174 .split(',')
3175 .map((String code) => code.trim().toLowerCase());
3174 ignoreInfo.addAll(info.getLocation(match.start).lineNumber, codes); 3176 ignoreInfo.addAll(info.getLocation(match.start).lineNumber, codes);
3175 } 3177 }
3176 return ignoreInfo; 3178 return ignoreInfo;
3177 } 3179 }
3178 } 3180 }
3179 3181
3180 /** 3182 /**
3181 * A task that ensures that all of the inferable instance members in a 3183 * A task that ensures that all of the inferable instance members in a
3182 * compilation unit have had their type inferred. 3184 * compilation unit have had their type inferred.
3183 */ 3185 */
(...skipping 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after
6135 6137
6136 @override 6138 @override
6137 bool moveNext() { 6139 bool moveNext() {
6138 if (_newSources.isEmpty) { 6140 if (_newSources.isEmpty) {
6139 return false; 6141 return false;
6140 } 6142 }
6141 currentTarget = _newSources.removeLast(); 6143 currentTarget = _newSources.removeLast();
6142 return true; 6144 return true;
6143 } 6145 }
6144 } 6146 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/error_suppression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698