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

Unified Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 1083093002: Don't permit annotations inside variable declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a bogus comment. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/ast.dart
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index 909400d3a8e3f151dd3f1f576165795b7b1769ed..94e89eb02a7ffe342b37ec6810725970282236d6 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -1612,8 +1612,7 @@ class AstCloner implements AstVisitor<AstNode> {
@override
VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
- new VariableDeclaration(null, cloneNodeList(node.metadata),
- cloneNode(node.name), cloneToken(node.equals),
+ new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals),
cloneNode(node.initializer));
@override
@@ -10177,8 +10176,7 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
@override
VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
- new VariableDeclaration(null, _cloneNodeList(node.metadata),
- _cloneNode(node.name), _mapToken(node.equals),
+ new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals),
_cloneNode(node.initializer));
@override
@@ -19568,6 +19566,10 @@ class UriValidationCode {
*
* > variableDeclaration ::=
* > [SimpleIdentifier] ('=' [Expression])?
+ *
+ * TODO(paulberry): a VariableDeclaration can never be associated with a
+ * comment or metadata. Consider changing the class hierarchy so that
+ * [VariableDeclaration] does not extend [Declaration].
Brian Wilkerson 2015/04/14 18:02:36 I don't understand why we would disallow associati
Paul Berry 2015/04/14 18:47:13 To clarify, we aren't disallowing comments, we're
Brian Wilkerson 2015/04/14 19:00:23 Not really. I already understood that. I just don'
*/
class VariableDeclaration extends Declaration {
/**
@@ -19588,14 +19590,12 @@ class VariableDeclaration extends Declaration {
Expression _initializer;
/**
- * Initialize a newly created variable declaration. Either or both of the
- * [comment] and [metadata] can be `null` if the declaration does not have the
- * corresponding attribute. The [equals] and [initializer] can be `null` if
- * there is no initializer.
+ * Initialize a newly created variable declaration. The [equals] and
+ * [initializer] can be `null` if there is no initializer.
*/
- VariableDeclaration(Comment comment, List<Annotation> metadata,
+ VariableDeclaration(
SimpleIdentifier name, this.equals, Expression initializer)
- : super(comment, metadata) {
+ : super(null, null) {
_name = _becomeParentOf(name);
_initializer = _becomeParentOf(initializer);
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | pkg/analyzer/lib/src/generated/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698