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

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2694403003: Add CompilationUnitElement.lineInfo and resynthesize it. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/task/dart.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 summary_resynthesizer; 5 library summary_resynthesizer;
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/standard_ast_factory.dart'; 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1501
1502 _UnitResynthesizer(this.libraryResynthesizer, this.unlinkedUnit, 1502 _UnitResynthesizer(this.libraryResynthesizer, this.unlinkedUnit,
1503 this.linkedUnit, Source unitSource, UnlinkedPart unlinkedPart) { 1503 this.linkedUnit, Source unitSource, UnlinkedPart unlinkedPart) {
1504 _resynthesizerContext = new _ResynthesizerContext(this); 1504 _resynthesizerContext = new _ResynthesizerContext(this);
1505 unit = new CompilationUnitElementImpl.forSerialized( 1505 unit = new CompilationUnitElementImpl.forSerialized(
1506 libraryResynthesizer.library, 1506 libraryResynthesizer.library,
1507 _resynthesizerContext, 1507 _resynthesizerContext,
1508 unlinkedUnit, 1508 unlinkedUnit,
1509 unlinkedPart, 1509 unlinkedPart,
1510 unitSource.shortName); 1510 unitSource.shortName);
1511
1512 {
1513 List<int> lineStarts = unlinkedUnit.lineStarts;
1514 if (lineStarts.isEmpty) {
1515 lineStarts = const <int>[0];
1516 }
1517 unit.lineInfo = new LineInfo(lineStarts);
1518 }
1519
1511 for (EntityRef t in linkedUnit.types) { 1520 for (EntityRef t in linkedUnit.types) {
1512 linkedTypeMap[t.slot] = t; 1521 linkedTypeMap[t.slot] = t;
1513 } 1522 }
1514 constCycles = linkedUnit.constCycles.toSet(); 1523 constCycles = linkedUnit.constCycles.toSet();
1515 parametersInheritingCovariant = 1524 parametersInheritingCovariant =
1516 linkedUnit.parametersInheritingCovariant.toSet(); 1525 linkedUnit.parametersInheritingCovariant.toSet();
1517 numLinkedReferences = linkedUnit.references.length; 1526 numLinkedReferences = linkedUnit.references.length;
1518 numUnlinkedReferences = unlinkedUnit.references.length; 1527 numUnlinkedReferences = unlinkedUnit.references.length;
1519 referenceInfos = new List<_ReferenceInfo>(numLinkedReferences); 1528 referenceInfos = new List<_ReferenceInfo>(numLinkedReferences);
1520 } 1529 }
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 static String _getElementIdentifier(String name, ReferenceKind kind) { 1936 static String _getElementIdentifier(String name, ReferenceKind kind) {
1928 if (kind == ReferenceKind.topLevelPropertyAccessor || 1937 if (kind == ReferenceKind.topLevelPropertyAccessor ||
1929 kind == ReferenceKind.propertyAccessor) { 1938 kind == ReferenceKind.propertyAccessor) {
1930 if (!name.endsWith('=')) { 1939 if (!name.endsWith('=')) {
1931 return name + '?'; 1940 return name + '?';
1932 } 1941 }
1933 } 1942 }
1934 return name; 1943 return name;
1935 } 1944 }
1936 } 1945 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698