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

Side by Side Diff: frog/leg/api.dart

Issue 9873021: Move frog/leg to lib/compiler/implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/leg/README.txt ('k') | frog/leg/apiimpl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #library('leg_api');
6
7 #import('../../lib/uri/uri.dart');
8 #import('apiimpl.dart');
9
10 // Unless explicitly allowed, passing null for any argument to the
11 // methods of library will result in a NullPointerException being
12 // thrown.
13
14 /**
15 * Returns the source corresponding to [uri]. If no such source exists
16 * or if an error occur while fetching it, this method must throw an
17 * exception.
18 */
19 typedef Future<String> ReadUriFromString(Uri uri);
20
21 /**
22 * Invoked by the compiler to report diagnostics. If [uri] is null, so
23 * is [begin] and [end]. No other arguments may be null. If [uri] is
24 * not null, neither are [begin] and [end]. [uri] indicates the
25 * compilation unit from where the diagnostic originates. [begin] and
26 * [end] are zero-based character offsets from the beginning of the
27 * compilaton unit. [message] is the diagnostic message, and [fatal]
28 * indicates whether or not this diagnostic will prevent the compiler
29 * from returning null.
30 */
31 typedef void DiagnosticHandler(Uri uri, int begin, int end,
32 String message, bool fatal);
33
34 /**
35 * Returns [script] compiled to JavaScript. If the compilation fails,
36 * null is returned and [handler] will have been invoked at least once
37 * with [:fatal == true:].
38 */
39 Future<String> compile(Uri script,
40 Uri libraryRoot,
41 ReadUriFromString provider,
42 DiagnosticHandler handler,
43 [List<String> options = const []]) {
44 Compiler compiler = new Compiler(provider, handler, libraryRoot, options);
45 compiler.run(script);
46 String code = compiler.assembledCode;
47 Completer<String> completer = new Completer<String>();
48 completer.complete(code);
49 return completer.future;
50 }
OLDNEW
« no previous file with comments | « frog/leg/README.txt ('k') | frog/leg/apiimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698