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

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

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

Powered by Google App Engine
This is Rietveld 408576698