Chromium Code Reviews| Index: pkg/compiler/lib/src/source_file_provider.dart |
| diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart |
| index cbc6ff3383cb5be3d3422cfebbf71900054185de..1b3b44b9e6171848a3af04df237b8d79c1486fa9 100644 |
| --- a/pkg/compiler/lib/src/source_file_provider.dart |
| +++ b/pkg/compiler/lib/src/source_file_provider.dart |
| @@ -10,12 +10,14 @@ import 'dart:io'; |
| import 'dart:math' as math; |
| import '../compiler.dart' as api show Diagnostic, DiagnosticHandler; |
| +import '../compiler_new.dart' as api show CompilerInput, CompilerDiagnostics; |
| import 'dart2js.dart' show AbortLeg; |
| import 'colors.dart' as colors; |
| import 'io/source_file.dart'; |
| import 'filenames.dart'; |
| import 'util/uri_extras.dart'; |
| import 'dart:typed_data'; |
| +import '../compiler_new.dart'; |
| List<int> readAll(String filename) { |
| var file = (new File(filename)).openSync(); |
| @@ -27,7 +29,7 @@ List<int> readAll(String filename) { |
| return buffer; |
| } |
| -abstract class SourceFileProvider { |
| +abstract class SourceFileProvider implements CompilerInput { |
| bool isWindows = (Platform.operatingSystem == 'windows'); |
| Uri cwd = currentDirectory; |
| Map<Uri, SourceFile> sourceFiles = <Uri, SourceFile>{}; |
| @@ -110,10 +112,14 @@ abstract class SourceFileProvider { |
| } |
| class CompilerSourceFileProvider extends SourceFileProvider { |
| - Future<List<int>> call(Uri resourceUri) => readUtf8BytesFromUri(resourceUri); |
| + |
| + Future<List<int>> call(Uri resourceUri) => readFromUri(resourceUri); |
|
Siggi Cherem (dart-lang)
2015/07/13 17:28:37
After we are done with the refactor, will we need
Johnni Winther
2015/07/13 17:45:19
These _are_ going away. Adding TODOs.
|
| + |
| + @override |
| + Future readFromUri(Uri uri) => readUtf8BytesFromUri(uri); |
| } |
| -class FormattingDiagnosticHandler { |
| +class FormattingDiagnosticHandler implements CompilerDiagnostics { |
| final SourceFileProvider provider; |
| bool showWarnings = true; |
| bool showHints = true; |
| @@ -160,8 +166,9 @@ class FormattingDiagnosticHandler { |
| throw 'Unexpected diagnostic kind: $kind (${kind.ordinal})'; |
| } |
| - void diagnosticHandler(Uri uri, int begin, int end, String message, |
| - api.Diagnostic kind) { |
| + @override |
| + void reportDiagnostic(Uri uri, int begin, int end, String message, |
| + api.Diagnostic kind) { |
| // TODO(ahe): Remove this when source map is handled differently. |
| if (identical(kind.name, 'source map')) return; |
| @@ -224,7 +231,7 @@ class FormattingDiagnosticHandler { |
| } |
| void call(Uri uri, int begin, int end, String message, api.Diagnostic kind) { |
|
Siggi Cherem (dart-lang)
2015/07/13 17:28:37
same here
Johnni Winther
2015/07/13 19:02:22
Done.
|
| - return diagnosticHandler(uri, begin, end, message, kind); |
| + return reportDiagnostic(uri, begin, end, message, kind); |
| } |
| } |