Index: pkg/analyzer/lib/src/dart/ast/utilities.dart |
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart |
index 654772c5f6e6190509861ce57111b67e60adda48..e4e2008a10b701deb8c1a6bd49348310d161d9e2 100644 |
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart |
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart |
@@ -143,6 +143,16 @@ class AstCloner implements AstVisitor<AstNode> { |
cloneNode(node.type)); |
@override |
+ AstNode visitAssertInitializer(AssertInitializer node) => |
+ new AssertInitializer( |
+ cloneToken(node.assertKeyword), |
+ cloneToken(node.leftParenthesis), |
+ cloneNode(node.condition), |
+ cloneToken(node.comma), |
+ cloneNode(node.message), |
+ cloneToken(node.rightParenthesis)); |
+ |
+ @override |
AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( |
cloneToken(node.assertKeyword), |
cloneToken(node.leftParenthesis), |
@@ -1116,6 +1126,17 @@ class AstComparator implements AstVisitor<bool> { |
} |
@override |
+ bool visitAssertInitializer(AssertInitializer node) { |
+ AssertStatement other = _other as AssertStatement; |
+ return isEqualTokens(node.assertKeyword, other.assertKeyword) && |
+ isEqualTokens(node.leftParenthesis, other.leftParenthesis) && |
+ isEqualNodes(node.condition, other.condition) && |
+ isEqualTokens(node.comma, other.comma) && |
+ isEqualNodes(node.message, other.message) && |
+ isEqualTokens(node.rightParenthesis, other.rightParenthesis); |
+ } |
+ |
+ @override |
bool visitAssertStatement(AssertStatement node) { |
AssertStatement other = _other as AssertStatement; |
return isEqualTokens(node.assertKeyword, other.assertKeyword) && |
@@ -2763,6 +2784,16 @@ class IncrementalAstCloner implements AstVisitor<AstNode> { |
} |
@override |
+ AstNode visitAssertInitializer(AssertInitializer node) => |
+ new AssertInitializer( |
+ _mapToken(node.assertKeyword), |
+ _mapToken(node.leftParenthesis), |
+ _cloneNode(node.condition), |
+ _mapToken(node.comma), |
+ _cloneNode(node.message), |
+ _mapToken(node.rightParenthesis)); |
+ |
+ @override |
AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( |
_mapToken(node.assertKeyword), |
_mapToken(node.leftParenthesis), |
@@ -4043,6 +4074,19 @@ class NodeReplacer implements AstVisitor<bool> { |
} |
@override |
+ bool visitAssertInitializer(AssertInitializer node) { |
+ if (identical(node.condition, _oldNode)) { |
+ node.condition = _newNode as Expression; |
+ return true; |
+ } |
+ if (identical(node.message, _oldNode)) { |
+ node.message = _newNode as Expression; |
+ return true; |
+ } |
+ return visitNode(node); |
+ } |
+ |
+ @override |
bool visitAssertStatement(AssertStatement node) { |
if (identical(node.condition, _oldNode)) { |
node.condition = _newNode as Expression; |
@@ -5221,6 +5265,18 @@ class ResolutionCopier implements AstVisitor<bool> { |
} |
@override |
+ bool visitAssertInitializer(AssertInitializer node) { |
+ AssertInitializer toNode = this._toNode as AssertInitializer; |
+ return _and( |
+ _isEqualTokens(node.assertKeyword, toNode.assertKeyword), |
+ _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), |
+ _isEqualNodes(node.condition, toNode.condition), |
+ _isEqualTokens(node.comma, toNode.comma), |
+ _isEqualNodes(node.message, toNode.message), |
+ _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis)); |
+ } |
+ |
+ @override |
bool visitAssertStatement(AssertStatement node) { |
AssertStatement toNode = this._toNode as AssertStatement; |
return _and( |
@@ -6817,6 +6873,18 @@ class ToSourceVisitor implements AstVisitor<Object> { |
} |
@override |
+ bool visitAssertInitializer(AssertInitializer node) { |
+ _writer.print("assert ("); |
+ _visitNode(node.condition); |
+ if (node.message != null) { |
+ _writer.print(', '); |
+ _visitNode(node.message); |
+ } |
+ _writer.print(")"); |
+ return null; |
+ } |
+ |
+ @override |
Object visitAssertStatement(AssertStatement node) { |
_writer.print("assert ("); |
_visitNode(node.condition); |