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

Unified Diff: pkg/front_end/lib/src/fasta/source/outline_builder.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/outline_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/outline_builder.dart b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
index 047524e76fea50667c396de2f814fe1e620ab264..5f01274ac372eba64136889fb58f675d4620bf24 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -28,8 +28,7 @@ import 'source_library_builder.dart' show SourceLibraryBuilder;
import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener;
-import '../parser/native_support.dart'
- show extractNativeMethodName, removeNativeClause, skipNativeClause;
+import '../parser/dart_vm_native.dart' show removeNativeClause;
import '../operator.dart'
show
@@ -50,7 +49,6 @@ class OutlineBuilder extends UnhandledListener {
final SourceLibraryBuilder library;
final bool enableNative;
- final bool stringExpectedAfterNative;
/// When true, recoverable parser errors are silently ignored. This is
/// because they will be reported by the BodyBuilder later. However, typedefs
@@ -62,10 +60,7 @@ class OutlineBuilder extends UnhandledListener {
OutlineBuilder(SourceLibraryBuilder library)
: library = library,
- enableNative =
- library.loader.target.backendTarget.enableNative(library.uri),
- stringExpectedAfterNative =
- library.loader.target.backendTarget.nativeExtensionExpectsString;
+ enableNative = library.loader.target.enableNative(library);
@override
Uri get uri => library.fileUri;
@@ -854,10 +849,10 @@ class OutlineBuilder extends UnhandledListener {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
if (enableNative && message.code == codeExpectedBlockToSkip) {
- Token recover = skipNativeClause(token, stringExpectedAfterNative);
+ var target = library.loader.target;
+ Token recover = target.skipNativeClause(token);
if (recover != null) {
- nativeMethodName =
- stringExpectedAfterNative ? extractNativeMethodName(token) : "";
+ nativeMethodName = target.extractNativeMethodName(token);
return recover;
}
}
@@ -873,7 +868,7 @@ class OutlineBuilder extends UnhandledListener {
@override
Link<Token> handleMemberName(Link<Token> identifiers) {
if (!enableNative || identifiers.isEmpty) return identifiers;
- return removeNativeClause(identifiers, stringExpectedAfterNative);
+ return removeNativeClause(identifiers);
}
@override
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_listener.dart ('k') | pkg/front_end/lib/src/fasta/source/source_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698