Index: pkg/front_end/tool/perf.dart |
diff --git a/pkg/front_end/tool/perf.dart b/pkg/front_end/tool/perf.dart |
index ec306caf644c524656e26d9c687eef8ef50b2d3c..4d61e9bdfb5f6e5cdce755ef7172cd241d0d97a9 100644 |
--- a/pkg/front_end/tool/perf.dart |
+++ b/pkg/front_end/tool/perf.dart |
@@ -9,15 +9,12 @@ import 'dart:async'; |
import 'dart:io' show exit, stderr; |
import 'package:analyzer/dart/ast/ast.dart'; |
-import 'package:analyzer/dart/ast/token.dart'; |
import 'package:analyzer/error/listener.dart'; |
import 'package:analyzer/file_system/file_system.dart' show ResourceUriResolver; |
import 'package:analyzer/file_system/physical_file_system.dart' |
show PhysicalResourceProvider; |
import 'package:analyzer/source/package_map_resolver.dart'; |
import 'package:analyzer/src/context/builder.dart'; |
-import 'package:analyzer/src/dart/scanner/reader.dart'; |
-import 'package:analyzer/src/dart/scanner/scanner.dart'; |
import 'package:analyzer/src/dart/sdk/sdk.dart' show FolderBasedDartSdk; |
import 'package:analyzer/src/generated/parser.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
@@ -26,6 +23,10 @@ import 'package:kernel/analyzer/loader.dart'; |
import 'package:kernel/kernel.dart'; |
import 'package:package_config/discovery.dart'; |
+import 'package:front_end/src/scanner/reader.dart'; |
+import 'package:front_end/src/scanner/scanner.dart'; |
+import 'package:front_end/src/scanner/token.dart'; |
+ |
/// Cumulative total number of chars scanned. |
int scanTotalChars = 0; |
@@ -205,13 +206,23 @@ Token tokenize(Source source) { |
scanTotalChars += contents.length; |
// TODO(sigmund): is there a way to scan from a random-access-file without |
// first converting to String? |
- var scanner = new Scanner(source, new CharSequenceReader(contents), |
- AnalysisErrorListener.NULL_LISTENER)..preserveComments = false; |
+ var scanner = new _Scanner(contents); |
var token = scanner.tokenize(); |
scanTimer.stop(); |
return token; |
} |
+class _Scanner extends Scanner { |
+ _Scanner(String contents) : super(new CharSequenceReader(contents)) { |
+ preserveComments = false; |
+ } |
+ |
+ @override |
+ void reportError(errorCode, int offset, List<Object> arguments) { |
+ // ignore errors. |
+ } |
+} |
+ |
/// Report that metric [name] took [time] micro-seconds to process |
/// [scanTotalChars] characters. |
void report(String name, int time) { |