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

Unified Diff: pkg/front_end/lib/src/incremental/file_state.dart

Issue 2879063002: Skip native clauses when parsing directives. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | pkg/front_end/test/src/incremental/mock_sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/incremental/file_state.dart
diff --git a/pkg/front_end/lib/src/incremental/file_state.dart b/pkg/front_end/lib/src/incremental/file_state.dart
index ab22dedced9613fa14b6441beb91c17a2d6b972b..3f353897463840f6dab6be37cef2ee59734140aa 100644
--- a/pkg/front_end/lib/src/incremental/file_state.dart
+++ b/pkg/front_end/lib/src/incremental/file_state.dart
@@ -8,6 +8,7 @@ import 'dart:typed_data';
import 'package:crypto/crypto.dart';
import 'package:front_end/file_system.dart';
import 'package:front_end/src/dependency_walker.dart' as graph;
+import 'package:front_end/src/fasta/parser/dart_vm_native.dart';
import 'package:front_end/src/fasta/parser/top_level_parser.dart';
import 'package:front_end/src/fasta/scanner.dart';
import 'package:front_end/src/fasta/source/directive_listener.dart';
@@ -115,7 +116,7 @@ class FileState {
// Parse directives.
ScannerResult scannerResults = _scan();
- var listener = new DirectiveListener();
+ var listener = new _DirectiveListenerWithNative();
new TopLevelParser(listener).parseUnit(scannerResults.tokens);
// Build the graph.
@@ -256,6 +257,12 @@ class LibraryCycle {
}
}
+/// [DirectiveListener] that skips native clauses.
+class _DirectiveListenerWithNative extends DirectiveListener {
+ @override
+ Token handleNativeClause(Token token) => skipNativeClause(token);
+}
+
/// [FileSystemState] based implementation of [FileSystem].
/// It provides a consistent view on the known file system state.
class _FileSystemView implements FileSystem {
« no previous file with comments | « no previous file | pkg/front_end/test/src/incremental/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698