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

Unified Diff: pkg/front_end/tool/fasta_perf.dart

Issue 2832353002: Add support for building patched_sdk and platform.dill for dart2js: (Closed)
Patch Set: review comments Created 3 years, 8 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/tool/fasta_perf.dart
diff --git a/pkg/front_end/tool/fasta_perf.dart b/pkg/front_end/tool/fasta_perf.dart
index 10eea4d10fb59f37bf01d85aeb9ceaf01cde2631..38d52b09480b88dcb756d6f34e4b6ab00d008fd5 100644
--- a/pkg/front_end/tool/fasta_perf.dart
+++ b/pkg/front_end/tool/fasta_perf.dart
@@ -13,12 +13,14 @@ import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget;
import 'package:front_end/src/fasta/kernel/kernel_target.dart'
show KernelTarget;
import 'package:front_end/src/fasta/parser.dart';
-import 'package:front_end/src/fasta/source/directive_listener.dart';
import 'package:front_end/src/fasta/scanner.dart';
import 'package:front_end/src/fasta/scanner/io.dart' show readBytesFromFileSync;
+import 'package:front_end/src/fasta/source/directive_listener.dart';
import 'package:front_end/src/fasta/ticker.dart' show Ticker;
import 'package:front_end/src/fasta/translate_uri.dart' show TranslateUri;
import 'package:front_end/src/fasta/translate_uri.dart';
+import 'package:front_end/src/fasta/parser/dart_vm_native.dart'
+ show skipNativeClause;
/// Cumulative total number of chars scanned.
int inputSize = 0;
@@ -157,7 +159,7 @@ Future<Null> collectSources(Uri start, Map<Uri, List<int>> files) async {
/// Parse [contents] as a Dart program and return the URIs that appear in its
/// import, export, and part directives.
Set<String> extractDirectiveUris(List<int> contents) {
- var listener = new DirectiveListener(acceptsNativeClause: true);
+ var listener = new DirectiveListenerWithNative();
new TopLevelParser(listener).parseUnit(tokenize(contents));
return new Set<String>()
..addAll(listener.imports)
@@ -165,6 +167,11 @@ Set<String> extractDirectiveUris(List<int> contents) {
..addAll(listener.parts);
}
+class DirectiveListenerWithNative extends DirectiveListener {
+ @override
+ Token handleNativeClause(Token token) => skipNativeClause(token);
+}
+
/// Parses every file in [files] and reports the time spent doing so.
void parseFiles(Map<Uri, List<int>> files) {
scanTimer = new Stopwatch();

Powered by Google App Engine
This is Rietveld 408576698