OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.generated.resolver; | 5 library analyzer.src.generated.resolver; |
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'; |
11 import 'package:analyzer/dart/ast/visitor.dart'; | 11 import 'package:analyzer/dart/ast/visitor.dart'; |
12 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
13 import 'package:analyzer/dart/element/type.dart'; | 13 import 'package:analyzer/dart/element/type.dart'; |
14 import 'package:analyzer/dart/element/visitor.dart'; | 14 import 'package:analyzer/dart/element/visitor.dart'; |
| 15 import 'package:analyzer/exception/exception.dart'; |
15 import 'package:analyzer/src/dart/ast/ast.dart'; | 16 import 'package:analyzer/src/dart/ast/ast.dart'; |
16 import 'package:analyzer/src/dart/ast/utilities.dart'; | 17 import 'package:analyzer/src/dart/ast/utilities.dart'; |
17 import 'package:analyzer/src/dart/element/element.dart'; | 18 import 'package:analyzer/src/dart/element/element.dart'; |
18 import 'package:analyzer/src/dart/element/type.dart'; | 19 import 'package:analyzer/src/dart/element/type.dart'; |
19 import 'package:analyzer/src/dart/element/utilities.dart'; | 20 import 'package:analyzer/src/dart/element/utilities.dart'; |
20 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; | 21 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
21 import 'package:analyzer/src/dart/resolver/scope.dart'; | 22 import 'package:analyzer/src/dart/resolver/scope.dart'; |
22 import 'package:analyzer/src/generated/constant.dart'; | 23 import 'package:analyzer/src/generated/constant.dart'; |
23 import 'package:analyzer/src/generated/element_resolver.dart'; | 24 import 'package:analyzer/src/generated/element_resolver.dart'; |
24 import 'package:analyzer/src/generated/engine.dart'; | 25 import 'package:analyzer/src/generated/engine.dart'; |
25 import 'package:analyzer/src/generated/error.dart'; | 26 import 'package:analyzer/src/generated/error.dart'; |
26 import 'package:analyzer/src/generated/error_verifier.dart'; | 27 import 'package:analyzer/src/generated/error_verifier.dart'; |
27 import 'package:analyzer/src/generated/java_core.dart'; | 28 import 'package:analyzer/src/generated/java_core.dart'; |
28 import 'package:analyzer/src/generated/java_engine.dart'; | |
29 import 'package:analyzer/src/generated/source.dart'; | 29 import 'package:analyzer/src/generated/source.dart'; |
30 import 'package:analyzer/src/generated/static_type_analyzer.dart'; | 30 import 'package:analyzer/src/generated/static_type_analyzer.dart'; |
31 import 'package:analyzer/src/generated/type_system.dart'; | 31 import 'package:analyzer/src/generated/type_system.dart'; |
32 import 'package:analyzer/src/generated/utilities_dart.dart'; | 32 import 'package:analyzer/src/generated/utilities_dart.dart'; |
33 | 33 |
34 export 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; | 34 export 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
35 export 'package:analyzer/src/dart/resolver/scope.dart'; | 35 export 'package:analyzer/src/dart/resolver/scope.dart'; |
36 export 'package:analyzer/src/generated/type_system.dart'; | 36 export 'package:analyzer/src/generated/type_system.dart'; |
37 | 37 |
38 /** | 38 /** |
(...skipping 8508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8547 token = token.next; | 8547 token = token.next; |
8548 } | 8548 } |
8549 } | 8549 } |
8550 | 8550 |
8551 /** | 8551 /** |
8552 * Look for user defined tasks in comments and convert them into info level an
alysis issues. | 8552 * Look for user defined tasks in comments and convert them into info level an
alysis issues. |
8553 * | 8553 * |
8554 * @param commentToken the comment token to analyze | 8554 * @param commentToken the comment token to analyze |
8555 */ | 8555 */ |
8556 void _scrapeTodoComment(Token commentToken) { | 8556 void _scrapeTodoComment(Token commentToken) { |
8557 Iterable<Match> matches = TodoCode.TODO_REGEX.allMatches(commentToken.lexeme
); | 8557 Iterable<Match> matches = |
| 8558 TodoCode.TODO_REGEX.allMatches(commentToken.lexeme); |
8558 for (Match match in matches) { | 8559 for (Match match in matches) { |
8559 int offset = | 8560 int offset = commentToken.offset + match.start + match.group(1).length; |
8560 commentToken.offset + match.start + match.group(1).length; | |
8561 int length = match.group(2).length; | 8561 int length = match.group(2).length; |
8562 _errorReporter.reportErrorForOffset( | 8562 _errorReporter.reportErrorForOffset( |
8563 TodoCode.TODO, offset, length, [match.group(2)]); | 8563 TodoCode.TODO, offset, length, [match.group(2)]); |
8564 } | 8564 } |
8565 } | 8565 } |
8566 } | 8566 } |
8567 | 8567 |
8568 /** | 8568 /** |
8569 * Helper for resolving [TypeName]s. | 8569 * Helper for resolving [TypeName]s. |
8570 * | 8570 * |
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11158 return null; | 11158 return null; |
11159 } | 11159 } |
11160 if (identical(node.staticElement, variable)) { | 11160 if (identical(node.staticElement, variable)) { |
11161 if (node.inSetterContext()) { | 11161 if (node.inSetterContext()) { |
11162 result = true; | 11162 result = true; |
11163 } | 11163 } |
11164 } | 11164 } |
11165 return null; | 11165 return null; |
11166 } | 11166 } |
11167 } | 11167 } |
OLD | NEW |