| Index: lib/src/codegen/dart_codegen.dart
|
| diff --git a/lib/src/codegen/dart_codegen.dart b/lib/src/codegen/dart_codegen.dart
|
| index 3fa931bcf087c67a44c747c0a8eeda042eed5cdc..a25b9e21992822bc6c61c1b321eebf4f6b40ad2d 100644
|
| --- a/lib/src/codegen/dart_codegen.dart
|
| +++ b/lib/src/codegen/dart_codegen.dart
|
| @@ -435,28 +435,23 @@ class DartGenerator extends codegenerator.CodeGenerator {
|
| out.finalize();
|
| }
|
|
|
| - void _generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
|
| - CheckerReporter reporter) {
|
| + void _generateLibrary(
|
| + LibraryUnit unit, LibraryInfo info, CheckerReporter reporter) {
|
| doOne(unit) {
|
| var outputDir = makeOutputDirectory(info, unit);
|
| reporter.enterSource(unit.element.source);
|
| generateUnit(unit, info, outputDir);
|
| reporter.leaveSource();
|
| }
|
| - isLib(unit) => unit.directives.any((d) => d is LibraryDirective);
|
| - isNotLib(unit) => !isLib(unit);
|
| - var libs = units.where(isLib);
|
| - var parts = units.where(isNotLib);
|
| - assert(libs.length == 1 || (libs.length == 0 && parts.length == 1));
|
| - parts.forEach(doOne);
|
| - libs.forEach(doOne);
|
| + unit.parts.forEach(doOne);
|
| + doOne(unit.library);
|
| }
|
|
|
| - String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
|
| - CheckerReporter reporter) {
|
| + String generateLibrary(
|
| + LibraryUnit unit, LibraryInfo info, CheckerReporter reporter) {
|
| _vm = new reifier.VariableManager();
|
| _extraImports = new Set<LibraryElement>();
|
| - _generateLibrary(units, info, reporter);
|
| + _generateLibrary(unit, info, reporter);
|
| _extraImports = null;
|
| _vm = null;
|
| return null;
|
| @@ -486,9 +481,9 @@ class EmptyDartGenerator extends codegenerator.CodeGenerator {
|
| EmptyDartGenerator(String outDir, Uri root, TypeRules rules, this.options)
|
| : super(outDir, root, rules);
|
|
|
| - String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
|
| - CheckerReporter reporter) {
|
| - for (var unit in units) {
|
| + String generateLibrary(
|
| + LibraryUnit library, LibraryInfo info, CheckerReporter reporter) {
|
| + for (var unit in library.units) {
|
| var outputDir = makeOutputDirectory(info, unit);
|
| reporter.enterSource(unit.element.source);
|
| generateUnit(unit, info, outputDir);
|
|
|