| OLD | NEW |
| 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.incremental_element_builder; | 5 library analyzer.src.task.incremental_element_builder; |
| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 break; | 296 break; |
| 297 } | 297 } |
| 298 oldToken = oldToken.next; | 298 oldToken = oldToken.next; |
| 299 newToken = newToken.next; | 299 newToken = newToken.next; |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 static Token getBeginTokenNotComment(AstNode node) { | 303 static Token getBeginTokenNotComment(AstNode node) { |
| 304 Token oldBeginToken = node.beginToken; | 304 Token oldBeginToken = node.beginToken; |
| 305 if (oldBeginToken is CommentToken) { | 305 if (oldBeginToken is CommentToken) { |
| 306 oldBeginToken = (oldBeginToken as CommentToken).parent; | 306 return oldBeginToken.parent; |
| 307 } | 307 } |
| 308 return oldBeginToken; | 308 return oldBeginToken; |
| 309 } | 309 } |
| 310 | 310 |
| 311 /** | 311 /** |
| 312 * Return the token string of all the [node] tokens. | 312 * Return the token string of all the [node] tokens. |
| 313 */ | 313 */ |
| 314 static String getFullCode(AstNode node) { | 314 static String getFullCode(AstNode node) { |
| 315 List<Token> tokens = getTokens(node); | 315 List<Token> tokens = getTokens(node); |
| 316 return joinTokens(tokens); | 316 return joinTokens(tokens); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 int oldOffset = element.nameOffset; | 364 int oldOffset = element.nameOffset; |
| 365 int newOffset = map[oldOffset]; | 365 int newOffset = map[oldOffset]; |
| 366 assert(newOffset != null); | 366 assert(newOffset != null); |
| 367 (element as ElementImpl).nameOffset = newOffset; | 367 (element as ElementImpl).nameOffset = newOffset; |
| 368 if (element is! LibraryElement) { | 368 if (element is! LibraryElement) { |
| 369 super.visitElement(element); | 369 super.visitElement(element); |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 } | 372 } |
| OLD | NEW |