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

Unified Diff: pkg/front_end/lib/src/fasta/parser/main.dart

Issue 2722223006: Move all main methods to tool/. (Closed)
Patch Set: Update tools/patch_sdk.dart. Created 3 years, 10 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: pkg/front_end/lib/src/fasta/parser/main.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/main.dart b/pkg/front_end/lib/src/fasta/parser/main.dart
deleted file mode 100644
index df3bfc7f2885257136e06db917df09f8ea4acc72..0000000000000000000000000000000000000000
--- a/pkg/front_end/lib/src/fasta/parser/main.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2016, 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 fasta.parser.main;
-
-import 'dart:convert' show LineSplitter, UTF8;
-
-import 'dart:io' show File;
-
-import '../scanner/token.dart' show Token;
-
-import '../scanner/io.dart' show readBytesFromFileSync;
-
-import '../scanner.dart' show scan;
-
-import 'listener.dart' show Listener;
-
-import 'top_level_parser.dart' show TopLevelParser;
-
-import 'identifier_context.dart' show IdentifierContext;
-
-class DebugListener extends Listener {
- void handleIdentifier(Token token, IdentifierContext context) {
- logEvent("Identifier: ${token.value}");
- }
-
- void logEvent(String name) {
- print(name);
- }
-}
-
-main(List<String> arguments) async {
- for (String argument in arguments) {
- if (argument.startsWith("@")) {
- Uri uri = Uri.base.resolve(argument.substring(1));
- await for (String file in new File.fromUri(uri)
- .openRead()
- .transform(UTF8.decoder)
- .transform(const LineSplitter())) {
- outLine(uri.resolve(file));
- }
- } else {
- outLine(Uri.base.resolve(argument));
- }
- }
-}
-
-void outLine(Uri uri) {
- new TopLevelParser(new DebugListener())
- .parseUnit(scan(readBytesFromFileSync(uri)).tokens);
-}
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/bin/parser.dart ('k') | pkg/front_end/lib/src/fasta/parser/parser_main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698