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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 11783089: Fix VariableDefinitions.endToken for formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 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) 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 tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 TypeVariable asTypeVariable() => this; 1062 TypeVariable asTypeVariable() => this;
1063 1063
1064 Token getBeginToken() => name.getBeginToken(); 1064 Token getBeginToken() => name.getBeginToken();
1065 1065
1066 Token getEndToken() { 1066 Token getEndToken() {
1067 return (bound != null) ? bound.getEndToken() : name.getEndToken(); 1067 return (bound != null) ? bound.getEndToken() : name.getEndToken();
1068 } 1068 }
1069 } 1069 }
1070 1070
1071 class VariableDefinitions extends Statement { 1071 class VariableDefinitions extends Statement {
1072 final Token endToken;
1073 final TypeAnnotation type; 1072 final TypeAnnotation type;
1074 final Modifiers modifiers; 1073 final Modifiers modifiers;
1075 final NodeList definitions; 1074 final NodeList definitions;
1076 VariableDefinitions(this.type, this.modifiers, this.definitions, 1075 VariableDefinitions(this.type, this.modifiers, this.definitions) {
1077 this.endToken) {
1078 assert(modifiers != null); 1076 assert(modifiers != null);
1079 } 1077 }
1080 1078
1081 VariableDefinitions asVariableDefinitions() => this; 1079 VariableDefinitions asVariableDefinitions() => this;
1082 1080
1083 accept(Visitor visitor) => visitor.visitVariableDefinitions(this); 1081 accept(Visitor visitor) => visitor.visitVariableDefinitions(this);
1084 1082
1085 visitChildren(Visitor visitor) { 1083 visitChildren(Visitor visitor) {
1086 if (type != null) type.accept(visitor); 1084 if (type != null) type.accept(visitor);
1087 if (definitions != null) definitions.accept(visitor); 1085 if (definitions != null) definitions.accept(visitor);
1088 } 1086 }
1089 1087
1090 Token getBeginToken() { 1088 Token getBeginToken() {
1091 var token = firstBeginToken(modifiers, type); 1089 var token = firstBeginToken(modifiers, type);
1092 if (token == null) { 1090 if (token == null) {
1093 token = definitions.getBeginToken(); 1091 token = definitions.getBeginToken();
1094 } 1092 }
1095 return token; 1093 return token;
1096 } 1094 }
1097 1095
1098 Token getEndToken() => endToken; 1096 Token getEndToken() => definitions.getEndToken();
1099 } 1097 }
1100 1098
1101 abstract class Loop extends Statement { 1099 abstract class Loop extends Statement {
1102 Expression get condition; 1100 Expression get condition;
1103 final Statement body; 1101 final Statement body;
1104 1102
1105 Loop(this.body); 1103 Loop(this.body);
1106 1104
1107 bool isValidContinueTarget() => true; 1105 bool isValidContinueTarget() => true;
1108 } 1106 }
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 * argument). 2060 * argument).
2063 * 2061 *
2064 * TODO(ahe): This method is controversial, the team needs to discuss 2062 * TODO(ahe): This method is controversial, the team needs to discuss
2065 * if top-level methods are acceptable and what naming conventions to 2063 * if top-level methods are acceptable and what naming conventions to
2066 * use. 2064 * use.
2067 */ 2065 */
2068 initializerDo(Node node, f(Node node)) { 2066 initializerDo(Node node, f(Node node)) {
2069 SendSet send = node.asSendSet(); 2067 SendSet send = node.asSendSet();
2070 if (send != null) return f(send.arguments.head); 2068 if (send != null) return f(send.arguments.head);
2071 } 2069 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698