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 5a2d6e04e00ab2c2f9d113373964c9f1ed50c1ad..1b1d4c75ab89e2f255c9db0ffaaf90e76e1ae71f 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(); |