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

Unified Diff: pkg/front_end/lib/src/fasta/target_implementation.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/target_implementation.dart
diff --git a/pkg/front_end/lib/src/fasta/target_implementation.dart b/pkg/front_end/lib/src/fasta/target_implementation.dart
index 4bf7ed8dfea85b29e4ce14cf8eb17d80f70687f2..58781f6c1f174de970228bfff5e244d876dff0c6 100644
--- a/pkg/front_end/lib/src/fasta/target_implementation.dart
+++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
@@ -8,8 +8,14 @@ import 'package:kernel/target/targets.dart' as backend show Target;
import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder;
+import 'parser/dart_vm_native.dart' as vm show skipNativeClause;
+
+import '../scanner/token.dart' show Token;
+
import 'loader.dart' show Loader;
+import 'quote.dart' show unescapeString;
+
import 'target.dart' show Target;
import 'ticker.dart' show Ticker;
@@ -96,6 +102,25 @@ abstract class TargetImplementation extends Target {
}
}
+ /// Whether the `native` language extension is supported within [library].
+ ///
+ /// The `native` language extension is not part of the language specification,
+ /// means something else to each target, and is enabled differently for each
+ /// target implementation. For example, the VM target enables it everywhere
+ /// because of existing support for "dart-ext:" native extensions, but targets
+ /// like dart2js only enable it on the core libraries.
+ ///
+ /// This default implementation assumes a VM target, but it can be overriden
+ /// in subclasses to change the behavior.
+ // TODO(sigmund,ahe): limit this to `dart-ext` libraries only (see
+ // https://github.com/dart-lang/sdk/issues/29763).
+ bool enableNative(LibraryBuilder library) => true;
+
+ Token skipNativeClause(Token token) => vm.skipNativeClause(token);
+
+ String extractNativeMethodName(Token token) =>
+ unescapeString(token.next.lexeme);
+
void addSourceInformation(
Uri uri, List<int> lineStarts, List<int> sourceCode);
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/source_loader.dart ('k') | pkg/front_end/lib/src/fasta/testing/kernel_chain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698