| 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'; |
| (...skipping 8536 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 JavaPatternMatcher matcher = | 8557 Iterable<Match> matches = TodoCode.TODO_REGEX.allMatches(commentToken.lexeme
); |
| 8558 new JavaPatternMatcher(TodoCode.TODO_REGEX, commentToken.lexeme); | 8558 for (Match match in matches) { |
| 8559 if (matcher.find()) { | |
| 8560 int offset = | 8559 int offset = |
| 8561 commentToken.offset + matcher.start() + matcher.group(1).length; | 8560 commentToken.offset + match.start + match.group(1).length; |
| 8562 int length = matcher.group(2).length; | 8561 int length = match.group(2).length; |
| 8563 _errorReporter.reportErrorForOffset( | 8562 _errorReporter.reportErrorForOffset( |
| 8564 TodoCode.TODO, offset, length, [matcher.group(2)]); | 8563 TodoCode.TODO, offset, length, [match.group(2)]); |
| 8565 } | 8564 } |
| 8566 } | 8565 } |
| 8567 } | 8566 } |
| 8568 | 8567 |
| 8569 /** | 8568 /** |
| 8570 * Helper for resolving [TypeName]s. | 8569 * Helper for resolving [TypeName]s. |
| 8571 * | 8570 * |
| 8572 * The client must set [nameScope] before calling [resolveTypeName]. | 8571 * The client must set [nameScope] before calling [resolveTypeName]. |
| 8573 */ | 8572 */ |
| 8574 class TypeNameResolver { | 8573 class TypeNameResolver { |
| (...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11159 return null; | 11158 return null; |
| 11160 } | 11159 } |
| 11161 if (identical(node.staticElement, variable)) { | 11160 if (identical(node.staticElement, variable)) { |
| 11162 if (node.inSetterContext()) { | 11161 if (node.inSetterContext()) { |
| 11163 result = true; | 11162 result = true; |
| 11164 } | 11163 } |
| 11165 } | 11164 } |
| 11166 return null; | 11165 return null; |
| 11167 } | 11166 } |
| 11168 } | 11167 } |
| OLD | NEW |