OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Legpad is used to compile .dart files to javascript, using the dart2js compiler. | 8 Legpad is used to compile .dart files to javascript, using the dart2js compiler. |
9 | 9 |
10 This is accomplished by creating an html file (usually called | 10 This is accomplished by creating an html file (usually called |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 # match.group(2) = url of file being imported | 117 # match.group(2) = url of file being imported |
118 DIRECTIVE_RE = re.compile(r"^#(import|source|native)\([\"']([^\"']*)[\"']") | 118 DIRECTIVE_RE = re.compile(r"^#(import|source|native)\([\"']([^\"']*)[\"']") |
119 | 119 |
120 # id of script tag that holds name of the top dart file to be compiled, | 120 # id of script tag that holds name of the top dart file to be compiled, |
121 # (This file name passed will be passed to the leg compiler by legpad.dart.) | 121 # (This file name passed will be passed to the leg compiler by legpad.dart.) |
122 MAIN_ID = "main_id" | 122 MAIN_ID = "main_id" |
123 | 123 |
124 # TODO(mattsh): read this from some config file once ahe/zundel create it | 124 # TODO(mattsh): read this from some config file once ahe/zundel create it |
125 DART_LIBRARIES = { | 125 DART_LIBRARIES = { |
126 "core": "lib/compiler/implementation/lib/core.dart", | 126 "core": "lib/compiler/implementation/lib/core.dart", |
127 "coreimpl": "lib/compiler/implementation/lib/coreimpl.dart", | |
128 "_js_helper": "lib/compiler/implementation/lib/js_helper.dart", | 127 "_js_helper": "lib/compiler/implementation/lib/js_helper.dart", |
129 "_interceptors": "lib/compiler/implementation/lib/interceptors.dart", | 128 "_interceptors": "lib/compiler/implementation/lib/interceptors.dart", |
130 "dom": "lib/dom/frog/dom_frog.dart", | 129 "dom": "lib/dom/frog/dom_frog.dart", |
131 "html": "lib/html/frog/html_frog.dart", | 130 "html": "lib/html/frog/html_frog.dart", |
132 "io": "lib/compiler/implementation/lib/io.dart", | 131 "io": "lib/compiler/implementation/lib/io.dart", |
133 "isolate": "lib/isolate/isolate_leg.dart", | 132 "isolate": "lib/isolate/isolate_leg.dart", |
134 "json": "lib/json/json.dart", | 133 "json": "lib/json/json.dart", |
135 "uri": "lib/uri/uri.dart", | 134 "uri": "lib/uri/uri.dart", |
136 "utf": "lib/utf/utf.dart", | 135 "utf": "lib/utf/utf.dart", |
137 } | 136 } |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 raise CommandFailedException(msg) | 358 raise CommandFailedException(msg) |
360 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) | 359 logging.debug("SUCCEEDED (%d bytes)" % len(stdout)) |
361 return stdout | 360 return stdout |
362 | 361 |
363 | 362 |
364 def main(argv): | 363 def main(argv): |
365 Pad(argv) | 364 Pad(argv) |
366 | 365 |
367 if __name__ == "__main__": | 366 if __name__ == "__main__": |
368 sys.exit(main(sys.argv)) | 367 sys.exit(main(sys.argv)) |
OLD | NEW |