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

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

Issue 9327001: Implement super initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 10 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) 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 visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCatchBlock(CatchBlock node); 8 R visitCatchBlock(CatchBlock node);
9 R visitClassNode(ClassNode node); 9 R visitClassNode(ClassNode node);
10 R visitConditional(Conditional node); 10 R visitConditional(Conditional node);
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 1435
1436 visitChildren(Visitor visitor) { 1436 visitChildren(Visitor visitor) {
1437 formals.accept(visitor); 1437 formals.accept(visitor);
1438 block.accept(visitor); 1438 block.accept(visitor);
1439 } 1439 }
1440 1440
1441 Token getBeginToken() => catchKeyword; 1441 Token getBeginToken() => catchKeyword;
1442 1442
1443 Token getEndToken() => block.getEndToken(); 1443 Token getEndToken() => block.getEndToken();
1444 } 1444 }
1445
1446 class Initializers {
1447 static bool isSuperConstructorCall(Send node) {
1448 return (node.receiver === null &&
1449 node.selector.asIdentifier() !== null &&
1450 node.selector.asIdentifier().isSuper()) ||
1451 (node.receiver !== null &&
1452 node.receiver.asIdentifier() !== null &&
1453 node.receiver.asIdentifier().isSuper() &&
1454 node.selector.asIdentifier() !== null);
1455 }
1456
1457 static bool isConstructorRedirect(Send node) {
1458 return (node.receiver === null &&
1459 node.selector.asIdentifier() !== null &&
1460 node.selector.asIdentifier().isThis()) ||
1461 (node.receiver !== null &&
1462 node.receiver.asIdentifier() !== null &&
1463 node.receiver.asIdentifier().isThis() &&
1464 node.selector.asIdentifier() !== null);
1465 }
1466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698