Index: pkg/front_end/lib/src/fasta/source/diet_listener.dart |
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart |
index 5ee99455cdd48491a63628fd4e044614702818b0..ec1cd61e1b9835231519b9326ad5932a03de9179 100644 |
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart |
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart |
@@ -25,8 +25,7 @@ import '../parser/parser.dart' show MemberKind, Parser, optional; |
import '../../scanner/token.dart' show BeginToken, Token; |
-import '../parser/native_support.dart' |
- show removeNativeClause, skipNativeClause; |
+import '../parser/dart_vm_native.dart' show removeNativeClause; |
import '../util/link.dart' show Link; |
@@ -49,8 +48,6 @@ class DietListener extends StackListener { |
final bool enableNative; |
- final bool stringExpectedAfterNative; |
- |
final TypeInferenceEngine typeInferenceEngine; |
ClassBuilder currentClass; |
@@ -67,10 +64,7 @@ class DietListener extends StackListener { |
: library = library, |
uri = library.fileUri, |
memberScope = library.scope, |
- enableNative = |
- library.loader.target.backendTarget.enableNative(library.uri), |
- stringExpectedAfterNative = |
- library.loader.target.backendTarget.nativeExtensionExpectsString; |
+ enableNative = library.loader.target.enableNative(library); |
void discard(int n) { |
for (int i = 0; i < n; i++) { |
@@ -521,7 +515,7 @@ class DietListener extends StackListener { |
@override |
Token handleUnrecoverableError(Token token, FastaMessage message) { |
if (enableNative && message.code == codeExpectedBlockToSkip) { |
- Token recover = skipNativeClause(token, stringExpectedAfterNative); |
+ Token recover = library.loader.target.skipNativeClause(token); |
if (recover != null) return recover; |
} |
return super.handleUnrecoverableError(token, message); |
@@ -530,7 +524,7 @@ class DietListener extends StackListener { |
@override |
Link<Token> handleMemberName(Link<Token> identifiers) { |
if (!enableNative || identifiers.isEmpty) return identifiers; |
- return removeNativeClause(identifiers, stringExpectedAfterNative); |
+ return removeNativeClause(identifiers); |
} |
AsyncMarker getAsyncMarker(StackListener listener) => listener.pop(); |