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

Unified Diff: pkg/dart2js_incremental/lib/compiler.dart

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 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
Index: pkg/dart2js_incremental/lib/compiler.dart
diff --git a/pkg/dart2js_incremental/lib/compiler.dart b/pkg/dart2js_incremental/lib/compiler.dart
index 6e866674542ea5fb4b222cd7475ef45eba2efe3d..8704b7c9b6c6f522c730776298b5dcbade2f08b4 100644
--- a/pkg/dart2js_incremental/lib/compiler.dart
+++ b/pkg/dart2js_incremental/lib/compiler.dart
@@ -15,6 +15,13 @@ import 'package:dart2js_incremental/dart2js_incremental.dart' show
IncrementalCompilationFailed,
IncrementalCompiler;
+import 'package:compiler/compiler_new.dart' show
+ CompilerOutput;
+
+import 'package:compiler/src/old_to_new_api.dart' show
+ LegacyCompilerDiagnostics,
+ LegacyCompilerInput;
+
import 'package:compiler/src/source_file_provider.dart' show
FormattingDiagnosticHandler;
@@ -104,8 +111,9 @@ compileToStream(
IncrementalCompiler compiler = new IncrementalCompiler(
libraryRoot: libraryRoot,
packageRoot: packageRoot,
- inputProvider: inputProvider,
- diagnosticHandler: resilientDiagnosticHandler,
+ inputProvider: new LegacyCompilerInput(inputProvider),
+ diagnosticHandler:
+ new LegacyCompilerDiagnostics(resilientDiagnosticHandler),
outputProvider: outputProvider);
bool success = await compiler.compile(originalInput);
@@ -142,10 +150,10 @@ compileToStream(
}
/// Output provider which collects output in [output].
-class OutputProvider {
+class OutputProvider implements CompilerOutput {
final Map<String, String> output = new Map<String, String>();
- EventSink<String> call(String name, String extension) {
+ EventSink<String> createSink(String name, String extension) {
return new StringEventSink((String data) {
output['$name.$extension'] = data;
});
« no previous file with comments | « pkg/dart2js_incremental/lib/caching_compiler.dart ('k') | pkg/dart2js_incremental/lib/dart2js_incremental.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698