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

Side by Side Diff: pkg/compiler/lib/src/resolved_visitor.dart

Issue 1043723002: Handle NewExpression in SemanticSendVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased+fix modely.dart Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 /// Enum for the visit methods added in [ResolvedVisitor]. 7 /// Enum for the visit methods added in [ResolvedVisitor].
8 // TODO(johnniwinther): Remove this. 8 // TODO(johnniwinther): Remove this.
9 enum ResolvedKind { 9 enum ResolvedKind {
10 ASSERT, 10 ASSERT,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 GetBulkMixin<R, dynamic>, 137 GetBulkMixin<R, dynamic>,
138 SetBulkMixin<R, dynamic>, 138 SetBulkMixin<R, dynamic>,
139 ErrorBulkMixin<R, dynamic>, 139 ErrorBulkMixin<R, dynamic>,
140 InvokeBulkMixin<R, dynamic>, 140 InvokeBulkMixin<R, dynamic>,
141 IndexSetBulkMixin<R, dynamic>, 141 IndexSetBulkMixin<R, dynamic>,
142 CompoundBulkMixin<R, dynamic>, 142 CompoundBulkMixin<R, dynamic>,
143 UnaryBulkMixin<R, dynamic>, 143 UnaryBulkMixin<R, dynamic>,
144 BaseBulkMixin<R, dynamic>, 144 BaseBulkMixin<R, dynamic>,
145 BinaryBulkMixin<R, dynamic>, 145 BinaryBulkMixin<R, dynamic>,
146 PrefixBulkMixin<R, dynamic>, 146 PrefixBulkMixin<R, dynamic>,
147 PostfixBulkMixin<R, dynamic> { 147 PostfixBulkMixin<R, dynamic>,
148 NewBulkMixin<R, dynamic> {
148 149
149 final ResolvedSemanticDispatcher<R> _semanticDispatcher = 150 final ResolvedSemanticDispatcher<R> _semanticDispatcher =
150 new ResolvedSemanticDispatcher<R>(); 151 new ResolvedSemanticDispatcher<R>();
151 152
152 final ResolvedSemanticDispatcher<ResolvedKind> _resolvedKindDispatcher = 153 final ResolvedSemanticDispatcher<ResolvedKind> _resolvedKindDispatcher =
153 new ResolvedSemanticDispatcher<ResolvedKind>(); 154 new ResolvedSemanticDispatcher<ResolvedKind>();
154 155
155 NewResolvedVisitor(TreeElements elements) : super(elements); 156 NewResolvedVisitor(TreeElements elements) : super(elements);
156 157
157 /// Dispatch using the new [SemanticSendVisitor] logic. 158 /// Dispatch using the new [SemanticSendVisitor] logic.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 /// visit methods in [ResolvedVisitor]. 215 /// visit methods in [ResolvedVisitor].
215 class ResolvedSemanticDispatcher<R> extends Object 216 class ResolvedSemanticDispatcher<R> extends Object
216 with GetBulkMixin<R, ResolvedKindVisitor<R>>, 217 with GetBulkMixin<R, ResolvedKindVisitor<R>>,
217 SetBulkMixin<R, ResolvedKindVisitor<R>>, 218 SetBulkMixin<R, ResolvedKindVisitor<R>>,
218 InvokeBulkMixin<R, ResolvedKindVisitor<R>>, 219 InvokeBulkMixin<R, ResolvedKindVisitor<R>>,
219 PrefixBulkMixin<R, ResolvedKindVisitor<R>>, 220 PrefixBulkMixin<R, ResolvedKindVisitor<R>>,
220 PostfixBulkMixin<R, ResolvedKindVisitor<R>>, 221 PostfixBulkMixin<R, ResolvedKindVisitor<R>>,
221 SuperBulkMixin<R, ResolvedKindVisitor<R>>, 222 SuperBulkMixin<R, ResolvedKindVisitor<R>>,
222 CompoundBulkMixin<R, ResolvedKindVisitor<R>>, 223 CompoundBulkMixin<R, ResolvedKindVisitor<R>>,
223 IndexSetBulkMixin<R, ResolvedKindVisitor<R>>, 224 IndexSetBulkMixin<R, ResolvedKindVisitor<R>>,
225 NewBulkMixin<R, ResolvedKindVisitor<R>>,
224 ErrorBulkMixin<R, ResolvedKindVisitor<R>> 226 ErrorBulkMixin<R, ResolvedKindVisitor<R>>
225 implements SemanticSendVisitor<R, ResolvedKindVisitor<R>> { 227 implements SemanticSendVisitor<R, ResolvedKindVisitor<R>> {
226 228
227 ResolvedSemanticDispatcher(); 229 ResolvedSemanticDispatcher();
228 230
229 @override 231 @override
230 R apply(Node node, ResolvedKindVisitor<R> visitor) { 232 R apply(Node node, ResolvedKindVisitor<R> visitor) {
231 return visitor.internalError( 233 return visitor.internalError(
232 node, "ResolvedSemanticDispatcher.apply unsupported."); 234 node, "ResolvedSemanticDispatcher.apply unsupported.");
233 } 235 }
234 236
235 @override 237 @override
236 R bulkHandleNode( 238 R bulkHandleNode(
237 Node node, 239 Node node,
238 String message, 240 String message,
239 ResolvedKindVisitor<R> visitor) { 241 ResolvedKindVisitor<R> visitor) {
240 // Set, Compound and IndexSet are not handled by [ResolvedVisitor]. 242 // Set, Compound, IndexSet, and NewExpression are not handled by
243 // [ResolvedVisitor].
241 return bulkHandleError(node, visitor); 244 return bulkHandleError(node, visitor);
242 } 245 }
243 246
244 R bulkHandleError(Node node, ResolvedKindVisitor<R> visitor) { 247 R bulkHandleError(Node node, ResolvedKindVisitor<R> visitor) {
245 return visitor.internalError(node, "No resolved kind for node."); 248 return visitor.internalError(node, "No resolved kind for node.");
246 } 249 }
247 250
248 @override 251 @override
249 R bulkHandleGet(Node node, ResolvedKindVisitor<R> visitor) { 252 R bulkHandleGet(Node node, ResolvedKindVisitor<R> visitor) {
250 return visitor.visitGetterSend(node); 253 return visitor.visitGetterSend(node);
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 698
696 @override 699 @override
697 R errorUnresolvedSuperIndex( 700 R errorUnresolvedSuperIndex(
698 Send node, 701 Send node,
699 Element function, 702 Element function,
700 Node index, 703 Node index,
701 ResolvedKindVisitor<R> visitor) { 704 ResolvedKindVisitor<R> visitor) {
702 return visitor.visitSuperSend(node); 705 return visitor.visitSuperSend(node);
703 } 706 }
704 } 707 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_structure.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698