| Index: pkg/dartino_compiler/lib/src/dartino_compiler_implementation.dart
|
| diff --git a/pkg/fletchc/lib/src/fletch_compiler_implementation.dart b/pkg/dartino_compiler/lib/src/dartino_compiler_implementation.dart
|
| similarity index 82%
|
| rename from pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| rename to pkg/dartino_compiler/lib/src/dartino_compiler_implementation.dart
|
| index 625f10164195ef0ed8f491df51de66d89274a08d..c0b49deb6b313213ac8dc07b1c26bfab191d4b56 100644
|
| --- a/pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| +++ b/pkg/dartino_compiler/lib/src/dartino_compiler_implementation.dart
|
| @@ -2,7 +2,7 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE.md file.
|
|
|
| -library fletchc.fletch_compiler_implementation;
|
| +library dartino_compiler.dartino_compiler_implementation;
|
|
|
| import 'dart:async' show
|
| EventSink;
|
| @@ -40,23 +40,23 @@ import 'package:compiler/src/diagnostics/diagnostic_listener.dart' show
|
| import 'package:compiler/src/diagnostics/spannable.dart' show
|
| Spannable;
|
|
|
| -import 'fletch_function_builder.dart';
|
| +import 'dartino_function_builder.dart';
|
| import 'debug_info.dart';
|
| import 'find_position_visitor.dart';
|
| -import 'fletch_context.dart';
|
| +import 'dartino_context.dart';
|
|
|
| -import 'fletch_enqueuer.dart' show
|
| - FletchEnqueueTask;
|
| +import 'dartino_enqueuer.dart' show
|
| + DartinoEnqueueTask;
|
|
|
| -import '../fletch_system.dart';
|
| +import '../dartino_system.dart';
|
| import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
|
| import 'package:compiler/src/elements/elements.dart';
|
|
|
| -import '../incremental/fletchc_incremental.dart' show
|
| +import '../incremental/dartino_compiler_incremental.dart' show
|
| IncrementalCompiler;
|
|
|
| -import 'fletch_diagnostic_reporter.dart' show
|
| - FletchDiagnosticReporter;
|
| +import 'dartino_diagnostic_reporter.dart' show
|
| + DartinoDiagnosticReporter;
|
|
|
| const EXTRA_DART2JS_OPTIONS = const <String>[
|
| // TODO(ahe): This doesn't completely disable type inference. Investigate.
|
| @@ -67,7 +67,7 @@ const EXTRA_DART2JS_OPTIONS = const <String>[
|
| '--generate-code-with-compile-time-errors',
|
| ];
|
|
|
| -const FLETCH_PATCHES = const <String, String>{
|
| +const DARTINO_PATCHES = const <String, String>{
|
| "_internal": "internal/internal_patch.dart",
|
| "collection": "collection/collection_patch.dart",
|
| "convert": "convert/convert_patch.dart",
|
| @@ -76,9 +76,9 @@ const FLETCH_PATCHES = const <String, String>{
|
| "typed_data": "typed_data/typed_data_patch.dart",
|
| };
|
|
|
| -const FLETCH_PLATFORM = 3;
|
| +const DARTINO_PLATFORM = 3;
|
|
|
| -DiagnosticOptions makeFletchDiagnosticOptions(
|
| +DiagnosticOptions makeDartinoDiagnosticOptions(
|
| {bool suppressWarnings: false,
|
| bool fatalWarnings: false,
|
| bool suppressHints: false,
|
| @@ -92,24 +92,24 @@ DiagnosticOptions makeFletchDiagnosticOptions(
|
| showPackageWarnings: true);
|
| }
|
|
|
| -class FletchCompilerImplementation extends CompilerImpl {
|
| - final Uri fletchVm;
|
| +class DartinoCompilerImplementation extends CompilerImpl {
|
| + final Uri dartinoVm;
|
|
|
| final Uri nativesJson;
|
|
|
| final IncrementalCompiler incrementalCompiler;
|
|
|
| Map<Uri, CompilationUnitElementX> compilationUnits;
|
| - FletchContext internalContext;
|
| + DartinoContext internalContext;
|
|
|
| - /// A reference to [../compiler.dart:FletchCompiler] used for testing.
|
| + /// A reference to [../compiler.dart:DartinoCompiler] used for testing.
|
| // TODO(ahe): Clean this up and remove this.
|
| var helper;
|
|
|
| @override
|
| - FletchEnqueueTask get enqueuer => super.enqueuer;
|
| + DartinoEnqueueTask get enqueuer => super.enqueuer;
|
|
|
| - FletchCompilerImplementation(
|
| + DartinoCompilerImplementation(
|
| api.CompilerInput provider,
|
| api.CompilerOutput outputProvider,
|
| api.CompilerDiagnostics handler,
|
| @@ -118,37 +118,37 @@ class FletchCompilerImplementation extends CompilerImpl {
|
| this.nativesJson,
|
| List<String> options,
|
| Map<String, dynamic> environment,
|
| - this.fletchVm,
|
| + this.dartinoVm,
|
| this.incrementalCompiler)
|
| : super(
|
| provider, outputProvider, handler, libraryRoot, null,
|
| EXTRA_DART2JS_OPTIONS.toList()..addAll(options), environment,
|
| - packageConfig, null, FletchBackend.createInstance,
|
| - FletchDiagnosticReporter.createInstance,
|
| - makeFletchDiagnosticOptions);
|
| + packageConfig, null, DartinoBackend.createInstance,
|
| + DartinoDiagnosticReporter.createInstance,
|
| + makeDartinoDiagnosticOptions);
|
|
|
| - FletchContext get context {
|
| + DartinoContext get context {
|
| if (internalContext == null) {
|
| - internalContext = new FletchContext(this);
|
| + internalContext = new DartinoContext(this);
|
| }
|
| return internalContext;
|
| }
|
|
|
| - String fletchPatchLibraryFor(String name) {
|
| + String dartinoPatchLibraryFor(String name) {
|
| // TODO(sigurdm): Try to remove this special casing.
|
| if (name == "core") {
|
| - return platformConfigUri.path.endsWith("fletch_embedded.platform")
|
| + return platformConfigUri.path.endsWith("dartino_embedded.platform")
|
| ? "core/embedded_core_patch.dart"
|
| : "core/core_patch.dart";
|
| }
|
| - return FLETCH_PATCHES[name];
|
| + return DARTINO_PATCHES[name];
|
| }
|
|
|
| @override
|
| Uri resolvePatchUri(String dartLibraryPath) {
|
| - String path = fletchPatchLibraryFor(dartLibraryPath);
|
| + String path = dartinoPatchLibraryFor(dartLibraryPath);
|
| if (path == null) return null;
|
| - // Fletch patches are located relative to [libraryRoot].
|
| + // Dartino patches are located relative to [libraryRoot].
|
| return libraryRoot.resolve(path);
|
| }
|
|
|
| @@ -167,19 +167,19 @@ class FletchCompilerImplementation extends CompilerImpl {
|
| DebugInfo debugInfoForPosition(
|
| Uri file,
|
| int position,
|
| - FletchSystem currentSystem) {
|
| + DartinoSystem currentSystem) {
|
| Uri uri = Uri.base.resolveUri(file);
|
| CompilationUnitElementX unit = compilationUnitForUri(uri);
|
| if (unit == null) return null;
|
| FindPositionVisitor visitor = new FindPositionVisitor(position, unit);
|
| unit.accept(visitor, null);
|
| - FletchFunctionBuilder builder =
|
| + DartinoFunctionBuilder builder =
|
| context.backend.systemBuilder.lookupFunctionBuilderByElement(
|
| visitor.element);
|
| if (builder == null) return null;
|
| // TODO(ajohnsen): We need a mapping from element to functionId, that can
|
| - // be looked up in the current fletch system.
|
| - FletchFunction function = builder.finalizeFunction(context, []);
|
| + // be looked up in the current dartino system.
|
| + DartinoFunction function = builder.finalizeFunction(context, []);
|
| return context.backend.createDebugInfo(function, currentSystem);
|
| }
|
|
|
| @@ -230,7 +230,7 @@ class FletchCompilerImplementation extends CompilerImpl {
|
|
|
| @override
|
| void compileLoadedLibraries() {
|
| - // TODO(ahe): Ensure fletchSystemLibrary is not null
|
| + // TODO(ahe): Ensure dartinoSystemLibrary is not null
|
| // (also when mainApp is null).
|
| if (mainApp == null) {
|
| return;
|
|
|