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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart

Issue 2992053002: Resynthesize combinators for import/export directives from Kernel. (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
index eb98e56e3ff80a12c2e1757d2c9d0fd60c13cc9c..eb7a89993d1e2e14cc9b39bf73c997a7d45ba42f 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
@@ -5,6 +5,7 @@
library fasta.kernel_library_builder;
import 'package:front_end/src/fasta/dill/dill_library_builder.dart';
+import 'package:front_end/src/fasta/combinator.dart' as fasta;
import 'package:front_end/src/fasta/export.dart';
import 'package:front_end/src/fasta/import.dart';
import 'package:kernel/ast.dart';
@@ -733,6 +734,17 @@ class KernelLibraryBuilder
@override
Library build(LibraryBuilder coreLibrary) {
super.build(coreLibrary);
+
+ List<Combinator> toKernelCombinators(
+ Iterable<fasta.Combinator> fastaCombinators) {
+ return fastaCombinators?.map((c) {
+ List<String> nameList = c.names.toList();
+ return c.isShow
+ ? new Combinator.show(nameList)
+ : new Combinator.hide(nameList);
+ })?.toList();
+ }
+
for (Import import in imports) {
var importedBuilder = import.imported;
Library importedLibrary;
@@ -742,12 +754,13 @@ class KernelLibraryBuilder
importedLibrary = importedBuilder.library;
}
if (importedLibrary != null) {
- library.addDependency(
- new LibraryDependency.import(importedLibrary, name: import.prefix));
+ library.addDependency(new LibraryDependency.import(importedLibrary,
+ name: import.prefix,
+ combinators: toKernelCombinators(import.combinators)));
}
}
- for (Export import in exports) {
- var exportedBuilder = import.exported;
+ for (Export export in exports) {
+ var exportedBuilder = export.exported;
Library exportedLibrary;
if (exportedBuilder is DillLibraryBuilder) {
exportedLibrary = exportedBuilder.library;
@@ -755,7 +768,8 @@ class KernelLibraryBuilder
exportedLibrary = exportedBuilder.library;
}
if (exportedLibrary != null) {
- library.addDependency(new LibraryDependency.export(exportedLibrary));
+ library.addDependency(new LibraryDependency.export(exportedLibrary,
+ combinators: toKernelCombinators(export.combinators)));
}
}
library.name = name;
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698