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

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

Issue 1117143004: Don't recurse into (external) compilation units. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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.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/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 /** 268 /**
269 * Updates name offsets of [Element]s according to the [map]. 269 * Updates name offsets of [Element]s according to the [map].
270 */ 270 */
271 class _UpdateElementOffsetsVisitor extends GeneralizingElementVisitor { 271 class _UpdateElementOffsetsVisitor extends GeneralizingElementVisitor {
272 final Map<int, int> map; 272 final Map<int, int> map;
273 273
274 _UpdateElementOffsetsVisitor(this.map); 274 _UpdateElementOffsetsVisitor(this.map);
275 275
276 visitElement(Element element) { 276 void visitElement(Element element) {
277 if (element is CompilationUnitElement) {
278 return;
279 }
280 if (element.isSynthetic) {
281 return;
282 }
277 int oldOffset = element.nameOffset; 283 int oldOffset = element.nameOffset;
278 if (oldOffset != -1) { 284 int newOffset = map[oldOffset];
279 int newOffset = map[oldOffset]; 285 assert(newOffset != null);
280 assert(newOffset != null); 286 (element as ElementImpl).nameOffset = newOffset;
281 (element as ElementImpl).nameOffset = newOffset;
282 }
283 if (element is! LibraryElement) { 287 if (element is! LibraryElement) {
284 super.visitElement(element); 288 super.visitElement(element);
285 } 289 }
286 } 290 }
287 } 291 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698