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

Unified Diff: pkg/compiler/lib/src/resolution/send_structure.dart

Issue 1238783003: Handle deferred access as pre-step in SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 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/compiler/lib/src/resolution/send_structure.dart
diff --git a/pkg/compiler/lib/src/resolution/send_structure.dart b/pkg/compiler/lib/src/resolution/send_structure.dart
index cc4a9ab079d5fcc48c7e5d581a9d91fd22c072d1..a64c2931ea32e33004877f464fae83afedd2e50c 100644
--- a/pkg/compiler/lib/src/resolution/send_structure.dart
+++ b/pkg/compiler/lib/src/resolution/send_structure.dart
@@ -2304,6 +2304,30 @@ class PostfixStructure<R, A> implements SendStructure<R, A> {
String toString() => 'postfix($operator,$semantics)';
}
+
+/// The structure for a [Send] whose prefix is a prefix for a deferred library.
+/// For instance `deferred.a` where `deferred` is a deferred prefix.
+class DeferredPrefixStructure<R, A> implements SendStructure<R, A> {
+ /// The deferred prefix element.
+ final PrefixElement prefix;
+
+ /// The send structure for the whole [Send] node. For instance a
+ /// [GetStructure] for `deferred.a` where `a` is a top level member of the
+ /// deferred library.
+ final SendStructure sendStructure;
+
+ DeferredPrefixStructure(this.prefix, this.sendStructure) {
+ assert(sendStructure != null);
+ }
+
+ @override
+ R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg) {
+ visitor.previsitDeferredAccess(send, prefix, arg);
+ return sendStructure.dispatch(visitor, send, arg);
+ }
+}
+
+
/// The structure for a [NewExpression] of a new invocation.
abstract class NewStructure<R, A> implements SemanticSendStructure<R, A> {
/// Calls the matching visit method on [visitor] with [node] and [arg].
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart ('k') | pkg/compiler/lib/src/resolved_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698