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

Unified Diff: pkg/servicec/lib/compiler.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 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 | « pkg/immi_samples/lib/sliding_window.immi ('k') | pkg/servicec/lib/converter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/servicec/lib/compiler.dart
diff --git a/pkg/servicec/lib/compiler.dart b/pkg/servicec/lib/compiler.dart
deleted file mode 100644
index 9b5e641c161a545597a502152d903646c2356573..0000000000000000000000000000000000000000
--- a/pkg/servicec/lib/compiler.dart
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2015, the Dartino 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 servicec.compiler;
-
-import 'dart:async' show
- Future;
-
-import 'dart:io';
-
-import 'package:compiler/src/tokens/token.dart' show
- Token;
-
-import 'error_handling_listener.dart' show
- ErrorHandlingListener;
-
-import 'errors.dart' show
- CompilationError,
- ErrorReporter,
- UndefinedServiceError,
- InternalCompilerError;
-
-import 'listener.dart' show
- DebugListener,
- Listener;
-
-import 'parser.dart' show
- Parser;
-
-import 'scanner.dart' show
- Scanner;
-
-import 'targets.dart' show
- Target;
-
-import 'validator.dart' show
- validate;
-
-import 'converter.dart' show
- convert;
-
-import 'package:old_servicec/compiler.dart' as old_servicec;
-import 'package:old_servicec/src/parser.dart' show
- Unit;
-
-// Temporary output type
-Future<Iterable<CompilationError>> compile(
- String path,
- String resourcesDirectory,
- String outputDirectory,
- {Target target: Target.ALL}) async {
- String input = new File(path).readAsStringSync();
- return compileInput(input,
- path,
- resourcesDirectory,
- outputDirectory,
- target: target);
-}
-
-// Temporary output type
-Future<Iterable<CompilationError>> compileInput(
- String input,
- String path,
- String resourcesDirectory,
- String outputDirectory,
- {Target target: Target.ALL}) async {
- if (input.isEmpty) {
- return [new UndefinedServiceError()];
- }
-
- Scanner scanner = new Scanner(input);
- Token tokens = scanner.tokenize();
-
- ErrorHandlingListener listener = new ErrorHandlingListener();
- Parser parser = new Parser(listener);
- parser.parseUnit(tokens);
-
- Iterable<CompilationError> errors = validate(listener.parsedUnitNode);
-
- if (errors.isEmpty) {
- Unit unit = convert(listener.parsedUnitNode);
- try {
- old_servicec.compile(path, unit, resourcesDirectory, outputDirectory);
- } catch (e, stackTrace) {
- String message = "Original error:\n$e\n$stackTrace";
- throw new InternalCompilerError(message);
- }
- }
-
- return errors;
-}
-
-Future<bool> compileAndReportErrors(
- String path,
- String relativePath,
- String resourcesDirectory,
- String outputDirectory,
- {Target target: Target.ALL}) async {
- String input = new File(path).readAsStringSync();
- Iterable<CompilationError> errors = await compileInput(
- input, path, resourcesDirectory, outputDirectory, target: target);
- if (errors.isNotEmpty) {
- new ErrorReporter(path, relativePath).report(errors);
- return false;
- }
- return true;
-}
« no previous file with comments | « pkg/immi_samples/lib/sliding_window.immi ('k') | pkg/servicec/lib/converter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698