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

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

Issue 1528983004: Add support for the "external" keyword to summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
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 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/element_handle.dart'; 9 import 'package:analyzer/src/generated/element_handle.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 executableElement.parameters = 460 executableElement.parameters =
461 serializedExecutable.parameters.map(buildParameter).toList(); 461 serializedExecutable.parameters.map(buildParameter).toList();
462 if (serializedExecutable.returnType != null) { 462 if (serializedExecutable.returnType != null) {
463 executableElement.returnType = buildType(serializedExecutable.returnType); 463 executableElement.returnType = buildType(serializedExecutable.returnType);
464 } else { 464 } else {
465 executableElement.returnType = VoidTypeImpl.instance; 465 executableElement.returnType = VoidTypeImpl.instance;
466 } 466 }
467 executableElement.type = new FunctionTypeImpl(executableElement); 467 executableElement.type = new FunctionTypeImpl(executableElement);
468 executableElement.hasImplicitReturnType = 468 executableElement.hasImplicitReturnType =
469 serializedExecutable.hasImplicitReturnType; 469 serializedExecutable.hasImplicitReturnType;
470 executableElement.external = serializedExecutable.isExternal;
470 } 471 }
471 472
472 /** 473 /**
473 * Resynthesize an [ExportElement], 474 * Resynthesize an [ExportElement],
474 */ 475 */
475 ExportElement buildExport(UnlinkedExport serializedExport) { 476 ExportElement buildExport(UnlinkedExport serializedExport) {
476 ExportElementImpl exportElement = new ExportElementImpl(0); 477 ExportElementImpl exportElement = new ExportElementImpl(0);
477 String exportedLibraryUri = summaryResynthesizer.sourceFactory 478 String exportedLibraryUri = summaryResynthesizer.sourceFactory
478 .resolveUri(librarySource, serializedExport.uri) 479 .resolveUri(librarySource, serializedExport.uri)
479 .uri 480 .uri
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 elementMap[cls.name] = cls; 917 elementMap[cls.name] = cls;
917 } 918 }
918 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) { 919 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) {
919 elementMap[typeAlias.name] = typeAlias; 920 elementMap[typeAlias.name] = typeAlias;
920 } 921 }
921 resummarizedElements[absoluteUri] = elementMap; 922 resummarizedElements[absoluteUri] = elementMap;
922 unitHolder = null; 923 unitHolder = null;
923 prelinkedUnit = null; 924 prelinkedUnit = null;
924 } 925 }
925 } 926 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698