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

Unified Diff: dart/frog/leg/api.dart

Issue 9639012: Implement the compiler API and use it in frog_leg.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments and created separate implementation library Created 8 years, 9 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 | « no previous file | dart/frog/leg/apiimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/api.dart
diff --git a/dart/frog/leg/api.dart b/dart/frog/leg/api.dart
index 306093135c7bb2c1bb1c055558b5eeecca11e3a2..26185a020a79a5a6613d1728afb7c7c23de7009f 100644
--- a/dart/frog/leg/api.dart
+++ b/dart/frog/leg/api.dart
@@ -3,7 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
#library('leg_api');
-#import('dart:uri');
+
+#import('../../lib/uri/uri.dart');
+#import('apiimpl.dart');
// Unless explicitly allowed, passing null for any argument to the
// methods of library will result in a NullPointerException being
@@ -34,6 +36,14 @@ typedef void DiagnosticHandler(Uri uri, int begin, int end,
* null is returned and [handler] will have been invoked at least once
* with [:fatal == true:].
*/
-Future<String> compile(Uri script, Uri libraryRoot,
- ReadUriFromString provider, DiagnosticHandler handler);
-// TODO(ahe): Document libraryRoot argument.
+Future<String> compile(Uri script,
+ Uri libraryRoot,
+ ReadUriFromString provider,
+ DiagnosticHandler handler) {
+ Compiler compiler = new Compiler(provider, handler, libraryRoot);
+ compiler.run(script);
+ String code = compiler.assembledCode;
+ Completer<String> completer = new Completer<String>();
+ completer.complete(code);
+ return completer.future;
+}
« no previous file with comments | « no previous file | dart/frog/leg/apiimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698