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

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

Issue 2953703002: Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service (Closed)
Patch Set: cl review updates: cleanup in kernel deserialization 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 9780586561adbaba105ddb751b2a3ffb51b5ce1c..bd5acdf9a1a47643d479749f18e3088d4fb3c3f3 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -28,7 +28,8 @@ import 'source_library_builder.dart' show SourceLibraryBuilder;
import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener;
-import '../parser/dart_vm_native.dart' show removeNativeClause;
+import '../parser/native_support.dart'
+ show extractNativeMethodName, removeNativeClause, skipNativeClause;
import '../operator.dart'
show
@@ -49,6 +50,7 @@ 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
@@ -60,7 +62,10 @@ class OutlineBuilder extends UnhandledListener {
OutlineBuilder(SourceLibraryBuilder library)
: library = library,
- enableNative = library.loader.target.enableNative(library);
+ enableNative =
+ library.loader.target.backendTarget.enableNative(library.uri),
+ stringExpectedAfterNative =
+ library.loader.target.backendTarget.nativeExtensionExpectsString;
@override
Uri get uri => library.fileUri;
@@ -839,10 +844,10 @@ class OutlineBuilder extends UnhandledListener {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
if (enableNative && message.code == codeExpectedBlockToSkip) {
- var target = library.loader.target;
- Token recover = target.skipNativeClause(token);
+ Token recover = skipNativeClause(token, stringExpectedAfterNative);
if (recover != null) {
- nativeMethodName = target.extractNativeMethodName(token);
+ nativeMethodName =
+ stringExpectedAfterNative ? extractNativeMethodName(token) : "";
return recover;
}
}
@@ -858,7 +863,7 @@ class OutlineBuilder extends UnhandledListener {
@override
Link<Token> handleMemberName(Link<Token> identifiers) {
if (!enableNative || identifiers.isEmpty) return identifiers;
- return removeNativeClause(identifiers);
+ return removeNativeClause(identifiers, stringExpectedAfterNative);
}
@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