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

Side by Side Diff: frog/leg/tree/nodes.dart

Issue 8974014: Resolve initializers in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't call function that does not exist. Created 9 years 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 interface Visitor<R> { 5 interface Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitClassNode(ClassNode node); 7 R visitClassNode(ClassNode node);
8 R visitConditional(Conditional node); 8 R visitConditional(Conditional node);
9 R visitDoWhile(DoWhile node); 9 R visitDoWhile(DoWhile node);
10 R visitExpressionStatement(ExpressionStatement node); 10 R visitExpressionStatement(ExpressionStatement node);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 accept(Visitor visitor) => visitor.visitSendSet(this); 244 accept(Visitor visitor) => visitor.visitSendSet(this);
245 245
246 visitChildren(Visitor visitor) { 246 visitChildren(Visitor visitor) {
247 super.visitChildren(visitor); 247 super.visitChildren(visitor);
248 if (assignmentOperator !== null) assignmentOperator.accept(visitor); 248 if (assignmentOperator !== null) assignmentOperator.accept(visitor);
249 } 249 }
250 250
251 Send copyWithReceiver(Node receiver) { 251 Send copyWithReceiver(Node receiver) {
252 throw 'not implemented'; 252 throw 'not implemented';
253 } 253 }
254
255 bool isInitializer() {
ngeoffray 2011/12/21 11:52:11 Not sure I understand: how can you be sure a SendS
karlklose 2011/12/21 16:33:46 Done, moved the helpers.
256 if (selector.asIdentifier() == null) return false;
257 if (receiver == null) return true;
258 return receiver.asIdentifier() != null;
259 return receiver.asIdentifier().source.stringValue() == 'this';
ahe 2011/12/21 12:01:58 == -> === Also, stringValue is a getter, not a fu
karlklose 2011/12/21 16:33:46 Done.
260 }
261
262 SourceString getInitializerFieldName(errorHandler()) {
ahe 2011/12/21 12:01:58 How about "onError" instead of "errorHandler"?
karlklose 2011/12/21 16:33:46 Done.
263 if (!isInitializer()) errorHandler();
264 return selector.asIdentifier().source;
265 }
254 } 266 }
255 267
256 class NewExpression extends Expression { 268 class NewExpression extends Expression {
257 /** The token NEW or CONST */ 269 /** The token NEW or CONST */
258 final Token newToken; 270 final Token newToken;
259 271
260 // Note: we expect that send.receiver is null. 272 // Note: we expect that send.receiver is null.
261 final Send send; 273 final Send send;
262 274
263 NewExpression([this.newToken, this.send]); 275 NewExpression([this.newToken, this.send]);
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 908
897 UnimplementedStatement(this.description, List<Node> nodes) 909 UnimplementedStatement(this.description, List<Node> nodes)
898 : this.nodes = new NodeList(null, new Link<Node>.fromList(nodes)); 910 : this.nodes = new NodeList(null, new Link<Node>.fromList(nodes));
899 911
900 toString() => '$description($nodes)'; 912 toString() => '$description($nodes)';
901 913
902 Token getBeginToken() => nodes.getBeginToken(); 914 Token getBeginToken() => nodes.getBeginToken();
903 915
904 Token getEndToken() => nodes.getEndToken(); 916 Token getEndToken() => nodes.getEndToken();
905 } 917 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698