mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:20:36 +00:00
Remove dartdoc specific methods from dart2js_mirror.
BUG= Review URL: https://codereview.chromium.org//13956028 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21921 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
98f87a545e
commit
314a922c9e
|
@ -6,25 +6,18 @@ library mirrors_dart2js;
|
|||
|
||||
import 'dart:async';
|
||||
import 'dart:collection' show LinkedHashMap;
|
||||
import 'dart:io' show Path;
|
||||
import 'dart:uri';
|
||||
|
||||
import '../../compiler.dart' as api;
|
||||
import '../elements/elements.dart';
|
||||
import '../resolution/resolution.dart' show ResolverTask, ResolverVisitor;
|
||||
import '../apiimpl.dart' as apiimpl;
|
||||
import '../scanner/scannerlib.dart' hide SourceString;
|
||||
import '../ssa/ssa.dart';
|
||||
import '../dart2jslib.dart';
|
||||
import '../dart_types.dart';
|
||||
import '../filenames.dart';
|
||||
import '../source_file.dart';
|
||||
import '../tree/tree.dart';
|
||||
import '../util/util.dart';
|
||||
import '../util/uri_extras.dart';
|
||||
import '../dart2js.dart';
|
||||
import '../util/characters.dart';
|
||||
import '../source_file_provider.dart';
|
||||
import '../util/util.dart' show Spannable, Link;
|
||||
import '../util/characters.dart' show $CR, $LF;
|
||||
|
||||
import 'mirrors.dart';
|
||||
import 'mirrors_util.dart';
|
||||
|
@ -192,50 +185,20 @@ String _getOperatorFromOperatorName(String name) {
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Compilation implementation
|
||||
// Analysis entry point.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// TODO(johnniwinther): Support client configurable providers.
|
||||
|
||||
/**
|
||||
* Returns a future that completes to a non-null String when [script]
|
||||
* has been successfully compiled.
|
||||
*
|
||||
* TODO(johnniwinther): The method is deprecated but here to support [Path]
|
||||
* which is used through dartdoc.
|
||||
*/
|
||||
Future<String> compile(Path script,
|
||||
Path libraryRoot,
|
||||
{Path packageRoot,
|
||||
List<String> options: const <String>[],
|
||||
api.DiagnosticHandler diagnosticHandler}) {
|
||||
SourceFileProvider provider = new SourceFileProvider();
|
||||
if (diagnosticHandler == null) {
|
||||
diagnosticHandler =
|
||||
new FormattingDiagnosticHandler(provider).diagnosticHandler;
|
||||
}
|
||||
Uri scriptUri = currentDirectory.resolve(script.toString());
|
||||
Uri libraryUri = currentDirectory.resolve(appendSlash('$libraryRoot'));
|
||||
Uri packageUri = null;
|
||||
if (packageRoot != null) {
|
||||
packageUri = currentDirectory.resolve(appendSlash('$packageRoot'));
|
||||
}
|
||||
return api.compile(scriptUri, libraryUri, packageUri,
|
||||
provider.readStringFromUri, diagnosticHandler, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyzes set of libraries and provides a mirror system which can be used for
|
||||
* static inspection of the source code.
|
||||
*/
|
||||
// TODO(johnniwinther): Move this to [compiler/compiler.dart] and rename to
|
||||
// [:analyze:].
|
||||
Future<MirrorSystem> analyzeUri(List<Uri> libraries,
|
||||
Uri libraryRoot,
|
||||
Uri packageRoot,
|
||||
api.CompilerInputProvider inputProvider,
|
||||
api.DiagnosticHandler diagnosticHandler,
|
||||
[List<String> options = const <String>[]]) {
|
||||
// TODO(johnniwinther): Move this to [compiler/compiler.dart].
|
||||
Future<MirrorSystem> analyze(List<Uri> libraries,
|
||||
Uri libraryRoot,
|
||||
Uri packageRoot,
|
||||
api.CompilerInputProvider inputProvider,
|
||||
api.DiagnosticHandler diagnosticHandler,
|
||||
[List<String> options = const <String>[]]) {
|
||||
if (!libraryRoot.path.endsWith("/")) {
|
||||
throw new ArgumentError("libraryRoot must end with a /");
|
||||
}
|
||||
|
@ -270,35 +233,6 @@ Future<MirrorSystem> analyzeUri(List<Uri> libraries,
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyzes set of libraries and provides a mirror system which can be used for
|
||||
* static inspection of the source code.
|
||||
*/
|
||||
// TODO(johnniwinther): Move dart:io dependent parts outside
|
||||
// dart2js_mirror.dart.
|
||||
Future<MirrorSystem> analyze(List<Path> libraries,
|
||||
Path libraryRoot,
|
||||
{Path packageRoot,
|
||||
List<String> options: const <String>[],
|
||||
api.DiagnosticHandler diagnosticHandler}) {
|
||||
SourceFileProvider provider = new SourceFileProvider();
|
||||
if (diagnosticHandler == null) {
|
||||
diagnosticHandler =
|
||||
new FormattingDiagnosticHandler(provider).diagnosticHandler;
|
||||
}
|
||||
Uri libraryUri = currentDirectory.resolve(appendSlash('$libraryRoot'));
|
||||
Uri packageUri = null;
|
||||
if (packageRoot != null) {
|
||||
packageUri = currentDirectory.resolve(appendSlash('$packageRoot'));
|
||||
}
|
||||
List<Uri> librariesUri = <Uri>[];
|
||||
for (Path library in libraries) {
|
||||
librariesUri.add(currentDirectory.resolve(library.toString()));
|
||||
}
|
||||
return analyzeUri(librariesUri, libraryUri, packageUri,
|
||||
provider.readStringFromUri, diagnosticHandler, options);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Dart2Js specific extensions of mirror interfaces
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
@ -35,7 +35,7 @@ import 'src/export_map.dart';
|
|||
import 'src/json_serializer.dart' as json_serializer;
|
||||
|
||||
// TODO(rnystrom): Use "package:" URL (#4968).
|
||||
import '../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js;
|
||||
import 'src/dart2js_mirrors.dart' as dart2js;
|
||||
import '../../compiler/implementation/mirrors/mirrors.dart';
|
||||
import '../../compiler/implementation/mirrors/mirrors_util.dart';
|
||||
import '../../libraries.dart';
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -93,7 +93,7 @@ class HtmlDiff {
|
|||
var result = new Completer();
|
||||
var provider = new SourceFileProvider();
|
||||
var handler = new FormattingDiagnosticHandler(provider);
|
||||
Future<MirrorSystem> analysis = analyzeUri(
|
||||
Future<MirrorSystem> analysis = analyze(
|
||||
HTML_LIBRARY_URIS, libraryRoot, null,
|
||||
provider.readStringFromUri,
|
||||
handler.diagnosticHandler);
|
||||
|
|
Loading…
Reference in a new issue