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

Unified Diff: pkg/front_end/lib/src/fasta/source/diet_listener.dart

Issue 2979463002: Revert "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service." (Closed)
Patch Set: Created 3 years, 5 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/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();
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698