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

Unified Diff: lib/dartdoc/frog/frog_leg.dart

Issue 10696191: Frog removed from dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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: lib/dartdoc/frog/frog_leg.dart
diff --git a/lib/dartdoc/frog/frog_leg.dart b/lib/dartdoc/frog/frog_leg.dart
deleted file mode 100644
index a56932acbdb496b69b02481cd9a7c91d8ebc7c4e..0000000000000000000000000000000000000000
--- a/lib/dartdoc/frog/frog_leg.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012, 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.
-
-#library('frog_leg');
-
-#import('dart:io');
-#import('dart:uri');
-
-#import('lang.dart', prefix: 'frog');
-#import('../../compiler/compiler.dart', prefix: 'compiler');
-#import('../../compiler/implementation/filenames.dart');
-#import('../../compiler/implementation/util/uri_extras.dart');
-
-bool compile(frog.World world) {
- final throwOnError = frog.options.throwOnErrors;
- final showWarnings = frog.options.showWarnings;
- final allowMockCompilation = frog.options.allowMockCompilation;
- Uri cwd = getCurrentDirectory();
- Uri uri = cwd.resolve(nativeToUriPath(frog.options.dartScript));
- String frogLibDir = nativeToUriPath(frog.options.libDir);
- if (!frogLibDir.endsWith("/")) frogLibDir = "$frogLibDir/";
- Uri frogLib = new Uri(scheme: 'file', path: frogLibDir);
- Uri libraryRoot = frogLib.resolve('../../');
- Map<String, frog.SourceFile> sourceFiles = <frog.SourceFile>{};
-
- Future<String> provider(Uri uri) {
- if (uri.scheme != 'file') {
- throw new IllegalArgumentException(uri);
- }
- String source = world.files.readAll(uriPathToNative(uri.path));
- world.dartBytesRead += source.length;
- sourceFiles[uri.toString()] =
- new frog.SourceFile(relativize(cwd, uri), source);
- Completer<String> completer = new Completer<String>();
- completer.complete(source);
- return completer.future;
- }
-
- void handler(Uri uri, int begin, int end, String message, bool fatal) {
- if (uri === null && !fatal) {
- world.info('[leg] $message');
- return;
- }
- if (uri === null) {
- assert(fatal);
- print(message);
- } else if (fatal || showWarnings) {
- frog.SourceFile file = sourceFiles[uri.toString()];
- print(file.getLocationMessage(message, begin, end, true));
- }
- if (fatal && throwOnError) throw new AbortLeg(message);
- }
-
- List<String> options = new List<String>();
- if (allowMockCompilation) options.add('--allow-mock-compilation');
-
- // TODO(ahe): We expect the future to be complete and call value
- // directly. In effect, we don't support truly asynchronous API.
- String code =
- compiler.compile(uri, libraryRoot, provider, handler, options).value;
- if (code === null) return false;
- world.legCode = code;
- world.jsBytesWritten = code.length;
- return true;
-}
-
-class AbortLeg {
- final message;
- AbortLeg(this.message);
- toString() => 'Aborted due to --throw-on-error: $message';
-}

Powered by Google App Engine
This is Rietveld 408576698