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

Unified Diff: samples/pond/compiler.dart

Issue 10204007: Remove many things that depend on frog. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/pond/build_pond.sh ('k') | samples/pond/editors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/pond/compiler.dart
===================================================================
--- samples/pond/compiler.dart (revision 6866)
+++ samples/pond/compiler.dart (working copy)
@@ -1,51 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/** Embeds the frog compiler as a worker isolate. */
-#library('compiler');
-
-#import('dart:isolate', prefix: 'isolate');
-#import("../../frog/file_system_dom.dart");
-#import("../../frog/lang.dart", prefix: 'frog');
-
-main() {
- final fileSystem = new DomFileSystem();
- isolate.port.receive((input, replyTo) {
- final watch = new Stopwatch.start();
- // Each message is a compilation request.
- fileSystem.writeString("user.dart", input['code']);
- frog.parseOptions('../../frog', ['dummyArg1', 'dummyArg2', 'user.dart'],
- fileSystem);
- frog.options.useColors = false;
- frog.options.warningsAsErrors = input['warningsAsErrors'];
- frog.initializeWorld(fileSystem);
-
- // Collect compilation messages
- final warnings = [];
- frog.world.messageHandler = (prefix, msg, span) {
- final warning = { 'prefix': prefix, 'msg': msg};
-
- if (span != null) {
- warning['filename'] = span.file.filename;
- warning['line'] = span.line;
- warning['column'] = span.column;
- warning['endLine'] = span.endLine;
- warning['endColumn'] = span.endColumn;
- warning['locationText'] = span.locationText;
- }
- warnings.add(warning);
- };
-
- bool success = frog.world.compile();
- watch.stop();
-
- // Send results back to the requester isolate.
- String output = success ? frog.world.getGeneratedCode() : null;
- replyTo.send({
- 'success': success,
- 'code': output,
- 'warnings': warnings,
- 'time': watch.elapsedInMs()});
- });
-}
« no previous file with comments | « samples/pond/build_pond.sh ('k') | samples/pond/editors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698