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

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

Issue 2439573003: Experiment with new function-type syntax.
Patch Set: Change a few more typedefs. Created 4 years, 2 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/compiler/lib/compiler.dart
diff --git a/pkg/compiler/lib/compiler.dart b/pkg/compiler/lib/compiler.dart
index e0306730f4457d379fd51d524b8ff9b73ce953a1..aa619036a15bfc2d9d0d576eb719cea078dfc162 100644
--- a/pkg/compiler/lib/compiler.dart
+++ b/pkg/compiler/lib/compiler.dart
@@ -29,10 +29,10 @@ import 'src/options.dart' show CompilerOptions;
* expected to hold a zero element at the last position. If this is not the
* case, the entire data structure is copied before scanning.
*/
-typedef Future/*<String | List<int>>*/ CompilerInputProvider(Uri uri);
+typedef CompilerInputProvider = Uri->Future/*<String | List<int>>*/;
/// Deprecated, please use [CompilerInputProvider] instead.
-typedef Future<String> ReadStringFromUri(Uri uri);
+typedef ReadStringFromUri = Uri->Future<String>;
/**
* Returns an [EventSink] that will serve as compiler output for the given
@@ -54,7 +54,7 @@ typedef Future<String> ReadStringFromUri(Uri uri);
* As more features are added to the compiler, new names and
* extensions may be introduced.
*/
-typedef EventSink<String> CompilerOutputProvider(String name, String extension);
+typedef CompilerOutputProvider = (String name, String extension) -> EventSink<String>;
/**
* Invoked by the compiler to report diagnostics. If [uri] is
@@ -66,14 +66,14 @@ typedef EventSink<String> CompilerOutputProvider(String name, String extension);
* diagnostic message, and [kind] indicates indicates what kind of
* diagnostic it is.
*/
-typedef void DiagnosticHandler(
- Uri uri, int begin, int end, String message, Diagnostic kind);
+typedef DiagnosticHandler =
+ (Uri, int begin, int end, String message, Diagnostic kind) -> void;
/**
* Provides a package lookup mechanism in the case that no package root or
* package resolution configuration file are explicitly specified.
*/
-typedef Future<Packages> PackagesDiscoveryProvider(Uri uri);
+typedef PackagesDiscoveryProvider = Uri->Future<Packages>;
/// Information resulting from the compilation.
class CompilationResult {

Powered by Google App Engine
This is Rietveld 408576698