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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 970913002: API clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sort ast.dart Created 5 years, 9 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser; 8 library engine.parser;
9 9
10 import "dart:math" as math; 10 import "dart:math" as math;
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 //return parser.parseDeclaredIdentifier(); 1105 //return parser.parseDeclaredIdentifier();
1106 } else if (identical(_oldNode, node.identifier)) { 1106 } else if (identical(_oldNode, node.identifier)) {
1107 return _parser.parseSimpleIdentifier(); 1107 return _parser.parseSimpleIdentifier();
1108 } else if (identical(_oldNode, node.body)) { 1108 } else if (identical(_oldNode, node.body)) {
1109 return _parser.parseStatement2(); 1109 return _parser.parseStatement2();
1110 } 1110 }
1111 return _notAChild(node); 1111 return _notAChild(node);
1112 } 1112 }
1113 1113
1114 @override 1114 @override
1115 AstNode visitFormalParameterList(FormalParameterList node) {
1116 // We don't know which kind of parameter to parse.
1117 throw new InsufficientContextException();
1118 }
1119
1120 @override
1115 AstNode visitForStatement(ForStatement node) { 1121 AstNode visitForStatement(ForStatement node) {
1116 if (identical(_oldNode, node.variables)) { 1122 if (identical(_oldNode, node.variables)) {
1117 throw new InsufficientContextException(); 1123 throw new InsufficientContextException();
1118 } else if (identical(_oldNode, node.initialization)) { 1124 } else if (identical(_oldNode, node.initialization)) {
1119 throw new InsufficientContextException(); 1125 throw new InsufficientContextException();
1120 } else if (identical(_oldNode, node.condition)) { 1126 } else if (identical(_oldNode, node.condition)) {
1121 return _parser.parseExpression2(); 1127 return _parser.parseExpression2();
1122 } else if (node.updaters.contains(_oldNode)) { 1128 } else if (node.updaters.contains(_oldNode)) {
1123 return _parser.parseExpression2(); 1129 return _parser.parseExpression2();
1124 } else if (identical(_oldNode, node.body)) { 1130 } else if (identical(_oldNode, node.body)) {
1125 return _parser.parseStatement2(); 1131 return _parser.parseStatement2();
1126 } 1132 }
1127 return _notAChild(node); 1133 return _notAChild(node);
1128 } 1134 }
1129 1135
1130 @override 1136 @override
1131 AstNode visitFormalParameterList(FormalParameterList node) {
1132 // We don't know which kind of parameter to parse.
1133 throw new InsufficientContextException();
1134 }
1135
1136 @override
1137 AstNode visitFunctionDeclaration(FunctionDeclaration node) { 1137 AstNode visitFunctionDeclaration(FunctionDeclaration node) {
1138 if (identical(_oldNode, node.documentationComment)) { 1138 if (identical(_oldNode, node.documentationComment)) {
1139 throw new InsufficientContextException(); 1139 throw new InsufficientContextException();
1140 } else if (node.metadata.contains(_oldNode)) { 1140 } else if (node.metadata.contains(_oldNode)) {
1141 return _parser.parseAnnotation(); 1141 return _parser.parseAnnotation();
1142 } else if (identical(_oldNode, node.returnType)) { 1142 } else if (identical(_oldNode, node.returnType)) {
1143 return _parser.parseReturnType(); 1143 return _parser.parseReturnType();
1144 } else if (identical(_oldNode, node.name)) { 1144 } else if (identical(_oldNode, node.name)) {
1145 return _parser.parseSimpleIdentifier(); 1145 return _parser.parseSimpleIdentifier();
1146 } else if (identical(_oldNode, node.functionExpression)) { 1146 } else if (identical(_oldNode, node.functionExpression)) {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1475
1476 @override 1476 @override
1477 AstNode visitPostfixExpression(PostfixExpression node) { 1477 AstNode visitPostfixExpression(PostfixExpression node) {
1478 if (identical(_oldNode, node.operand)) { 1478 if (identical(_oldNode, node.operand)) {
1479 throw new InsufficientContextException(); 1479 throw new InsufficientContextException();
1480 } 1480 }
1481 return _notAChild(node); 1481 return _notAChild(node);
1482 } 1482 }
1483 1483
1484 @override 1484 @override
1485 AstNode visitPrefixExpression(PrefixExpression node) {
1486 if (identical(_oldNode, node.operand)) {
1487 throw new InsufficientContextException();
1488 }
1489 return _notAChild(node);
1490 }
1491
1492 @override
1493 AstNode visitPrefixedIdentifier(PrefixedIdentifier node) { 1485 AstNode visitPrefixedIdentifier(PrefixedIdentifier node) {
1494 if (identical(_oldNode, node.prefix)) { 1486 if (identical(_oldNode, node.prefix)) {
1495 return _parser.parseSimpleIdentifier(); 1487 return _parser.parseSimpleIdentifier();
1496 } else if (identical(_oldNode, node.identifier)) { 1488 } else if (identical(_oldNode, node.identifier)) {
1497 return _parser.parseSimpleIdentifier(); 1489 return _parser.parseSimpleIdentifier();
1498 } 1490 }
1499 return _notAChild(node); 1491 return _notAChild(node);
1500 } 1492 }
1501 1493
1502 @override 1494 @override
1495 AstNode visitPrefixExpression(PrefixExpression node) {
1496 if (identical(_oldNode, node.operand)) {
1497 throw new InsufficientContextException();
1498 }
1499 return _notAChild(node);
1500 }
1501
1502 @override
1503 AstNode visitPropertyAccess(PropertyAccess node) { 1503 AstNode visitPropertyAccess(PropertyAccess node) {
1504 if (identical(_oldNode, node.target)) { 1504 if (identical(_oldNode, node.target)) {
1505 throw new InsufficientContextException(); 1505 throw new InsufficientContextException();
1506 } else if (identical(_oldNode, node.propertyName)) { 1506 } else if (identical(_oldNode, node.propertyName)) {
1507 return _parser.parseSimpleIdentifier(); 1507 return _parser.parseSimpleIdentifier();
1508 } 1508 }
1509 return _notAChild(node); 1509 return _notAChild(node);
1510 } 1510 }
1511 1511
1512 @override 1512 @override
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 1818
1819 /** 1819 /**
1820 * Initialize a newly created exception to have no message and to have the giv en cause. 1820 * Initialize a newly created exception to have no message and to have the giv en cause.
1821 * 1821 *
1822 * @param cause the exception that caused this exception 1822 * @param cause the exception that caused this exception
1823 */ 1823 */
1824 IncrementalParseException.con2(Exception cause) : super(cause: cause); 1824 IncrementalParseException.con2(Exception cause) : super(cause: cause);
1825 } 1825 }
1826 1826
1827 /** 1827 /**
1828 * Visitor capable of inferring the correct parser state for incremental
1829 * parsing. This visitor visits each parent/child relationship in the chain of
1830 * ancestors of the node to be replaced (starting with the root of the parse
1831 * tree), updating the parser to the correct state for parsing the child of the
1832 * given parent. Once it has visited all of these relationships, the parser
1833 * will be in the correct state for reparsing the node to be replaced.
1834 *
1835 * TODO(paulberry): add support for other pieces of parser state (_inAsync,
1836 * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
1837 * affect error message generation.
1838 */
1839 class IncrementalParseStateBuilder extends SimpleAstVisitor {
1840 /**
1841 * The parser whose state should be built.
1842 */
1843 final Parser _parser;
1844
1845 /**
1846 * The child node in the parent/child relationship currently being visited.
1847 * (The corresponding parent is the node passed to the visit...() function.)
1848 */
1849 AstNode _childNode;
1850
1851 /**
1852 * Create an IncrementalParseStateBuilder which will build the correct state
1853 * for [_parser].
1854 */
1855 IncrementalParseStateBuilder(this._parser);
1856
1857 /**
1858 * Build the correct parser state for parsing a replacement for [node].
1859 */
1860 void buildState(AstNode node) {
1861 List<AstNode> ancestors = <AstNode>[];
1862 while (node != null) {
1863 ancestors.add(node);
1864 node = node.parent;
1865 }
1866 _parser._inInitializer = false;
1867 for (int i = ancestors.length - 2; i >= 0; i--) {
1868 _childNode = ancestors[i];
1869 ancestors[i + 1].accept(this);
1870 }
1871 }
1872
1873 @override
1874 void visitArgumentList(ArgumentList node) {
1875 _parser._inInitializer = false;
1876 }
1877
1878 @override
1879 void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
1880 if (identical(_childNode, node.expression)) {
1881 _parser._inInitializer = true;
1882 }
1883 }
1884
1885 @override
1886 void visitIndexExpression(IndexExpression node) {
1887 if (identical(_childNode, node.index)) {
1888 _parser._inInitializer = false;
1889 }
1890 }
1891
1892 @override
1893 void visitInterpolationExpression(InterpolationExpression node) {
1894 if (identical(_childNode, node.expression)) {
1895 _parser._inInitializer = false;
1896 }
1897 }
1898
1899 @override
1900 void visitListLiteral(ListLiteral node) {
1901 if (node.elements.contains(_childNode)) {
1902 _parser._inInitializer = false;
1903 }
1904 }
1905
1906 @override
1907 void visitMapLiteral(MapLiteral node) {
1908 if (node.entries.contains(_childNode)) {
1909 _parser._inInitializer = false;
1910 }
1911 }
1912
1913 @override
1914 void visitParenthesizedExpression(ParenthesizedExpression node) {
1915 if (identical(_childNode, node.expression)) {
1916 _parser._inInitializer = false;
1917 }
1918 }
1919 }
1920
1921 /**
1922 * Instances of the class `IncrementalParser` re-parse a single AST structure wi thin a larger 1828 * Instances of the class `IncrementalParser` re-parse a single AST structure wi thin a larger
1923 * AST structure. 1829 * AST structure.
1924 */ 1830 */
1925 class IncrementalParser { 1831 class IncrementalParser {
1926 /** 1832 /**
1927 * The source being parsed. 1833 * The source being parsed.
1928 */ 1834 */
1929 final Source _source; 1835 final Source _source;
1930 1836
1931 /** 1837 /**
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 */ 1995 */
2090 Token _findTokenAt(Token firstToken, int offset) { 1996 Token _findTokenAt(Token firstToken, int offset) {
2091 while (firstToken.offset > offset && firstToken.type != TokenType.EOF) { 1997 while (firstToken.offset > offset && firstToken.type != TokenType.EOF) {
2092 firstToken = firstToken.previous; 1998 firstToken = firstToken.previous;
2093 } 1999 }
2094 return firstToken; 2000 return firstToken;
2095 } 2001 }
2096 } 2002 }
2097 2003
2098 /** 2004 /**
2005 * Visitor capable of inferring the correct parser state for incremental
2006 * parsing. This visitor visits each parent/child relationship in the chain of
2007 * ancestors of the node to be replaced (starting with the root of the parse
2008 * tree), updating the parser to the correct state for parsing the child of the
2009 * given parent. Once it has visited all of these relationships, the parser
2010 * will be in the correct state for reparsing the node to be replaced.
2011 *
2012 * TODO(paulberry): add support for other pieces of parser state (_inAsync,
2013 * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
2014 * affect error message generation.
2015 */
2016 class IncrementalParseStateBuilder extends SimpleAstVisitor {
2017 /**
2018 * The parser whose state should be built.
2019 */
2020 final Parser _parser;
2021
2022 /**
2023 * The child node in the parent/child relationship currently being visited.
2024 * (The corresponding parent is the node passed to the visit...() function.)
2025 */
2026 AstNode _childNode;
2027
2028 /**
2029 * Create an IncrementalParseStateBuilder which will build the correct state
2030 * for [_parser].
2031 */
2032 IncrementalParseStateBuilder(this._parser);
2033
2034 /**
2035 * Build the correct parser state for parsing a replacement for [node].
2036 */
2037 void buildState(AstNode node) {
2038 List<AstNode> ancestors = <AstNode>[];
2039 while (node != null) {
2040 ancestors.add(node);
2041 node = node.parent;
2042 }
2043 _parser._inInitializer = false;
2044 for (int i = ancestors.length - 2; i >= 0; i--) {
2045 _childNode = ancestors[i];
2046 ancestors[i + 1].accept(this);
2047 }
2048 }
2049
2050 @override
2051 void visitArgumentList(ArgumentList node) {
2052 _parser._inInitializer = false;
2053 }
2054
2055 @override
2056 void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
2057 if (identical(_childNode, node.expression)) {
2058 _parser._inInitializer = true;
2059 }
2060 }
2061
2062 @override
2063 void visitIndexExpression(IndexExpression node) {
2064 if (identical(_childNode, node.index)) {
2065 _parser._inInitializer = false;
2066 }
2067 }
2068
2069 @override
2070 void visitInterpolationExpression(InterpolationExpression node) {
2071 if (identical(_childNode, node.expression)) {
2072 _parser._inInitializer = false;
2073 }
2074 }
2075
2076 @override
2077 void visitListLiteral(ListLiteral node) {
2078 if (node.elements.contains(_childNode)) {
2079 _parser._inInitializer = false;
2080 }
2081 }
2082
2083 @override
2084 void visitMapLiteral(MapLiteral node) {
2085 if (node.entries.contains(_childNode)) {
2086 _parser._inInitializer = false;
2087 }
2088 }
2089
2090 @override
2091 void visitParenthesizedExpression(ParenthesizedExpression node) {
2092 if (identical(_childNode, node.expression)) {
2093 _parser._inInitializer = false;
2094 }
2095 }
2096 }
2097
2098 /**
2099 * Instances of the class `InsufficientContextException` represent a situation i n which an AST 2099 * Instances of the class `InsufficientContextException` represent a situation i n which an AST
2100 * node cannot be re-parsed because there is not enough context to know how to r e-parse the node. 2100 * node cannot be re-parsed because there is not enough context to know how to r e-parse the node.
2101 * Clients can attempt to re-parse the parent of the node. 2101 * Clients can attempt to re-parse the parent of the node.
2102 */ 2102 */
2103 class InsufficientContextException extends IncrementalParseException { 2103 class InsufficientContextException extends IncrementalParseException {
2104 /** 2104 /**
2105 * Initialize a newly created exception to have no message and to be its own c ause. 2105 * Initialize a newly created exception to have no message and to be its own c ause.
2106 */ 2106 */
2107 InsufficientContextException() : super(); 2107 InsufficientContextException() : super();
2108 2108
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 directiveFoundAfterDeclaration = true; 2985 directiveFoundAfterDeclaration = true;
2986 } 2986 }
2987 if (directive is LibraryDirective) { 2987 if (directive is LibraryDirective) {
2988 if (libraryDirectiveFound) { 2988 if (libraryDirectiveFound) {
2989 _reportErrorForCurrentToken( 2989 _reportErrorForCurrentToken(
2990 ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES); 2990 ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES);
2991 } else { 2991 } else {
2992 if (directives.length > 0) { 2992 if (directives.length > 0) {
2993 _reportErrorForToken( 2993 _reportErrorForToken(
2994 ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, 2994 ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST,
2995 directive.libraryToken); 2995 directive.libraryKeyword);
2996 } 2996 }
2997 libraryDirectiveFound = true; 2997 libraryDirectiveFound = true;
2998 } 2998 }
2999 } else if (directive is PartDirective) { 2999 } else if (directive is PartDirective) {
3000 partDirectiveFound = true; 3000 partDirectiveFound = true;
3001 } else if (partDirectiveFound) { 3001 } else if (partDirectiveFound) {
3002 if (directive is ExportDirective) { 3002 if (directive is ExportDirective) {
3003 _reportErrorForToken( 3003 _reportErrorForToken(
3004 ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, 3004 ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
3005 directive.keyword); 3005 directive.keyword);
(...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after
5116 if (_matchesKeyword(Keyword.EXTENDS)) { 5116 if (_matchesKeyword(Keyword.EXTENDS)) {
5117 if (extendsClause == null) { 5117 if (extendsClause == null) {
5118 extendsClause = parseExtendsClause(); 5118 extendsClause = parseExtendsClause();
5119 if (withClause != null) { 5119 if (withClause != null) {
5120 _reportErrorForToken( 5120 _reportErrorForToken(
5121 ParserErrorCode.WITH_BEFORE_EXTENDS, 5121 ParserErrorCode.WITH_BEFORE_EXTENDS,
5122 withClause.withKeyword); 5122 withClause.withKeyword);
5123 } else if (implementsClause != null) { 5123 } else if (implementsClause != null) {
5124 _reportErrorForToken( 5124 _reportErrorForToken(
5125 ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, 5125 ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS,
5126 implementsClause.keyword); 5126 implementsClause.implementsKeyword);
5127 } 5127 }
5128 } else { 5128 } else {
5129 _reportErrorForToken( 5129 _reportErrorForToken(
5130 ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, 5130 ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES,
5131 extendsClause.keyword); 5131 extendsClause.extendsKeyword);
5132 parseExtendsClause(); 5132 parseExtendsClause();
5133 } 5133 }
5134 } else if (_matchesKeyword(Keyword.WITH)) { 5134 } else if (_matchesKeyword(Keyword.WITH)) {
5135 if (withClause == null) { 5135 if (withClause == null) {
5136 withClause = parseWithClause(); 5136 withClause = parseWithClause();
5137 if (implementsClause != null) { 5137 if (implementsClause != null) {
5138 _reportErrorForToken( 5138 _reportErrorForToken(
5139 ParserErrorCode.IMPLEMENTS_BEFORE_WITH, 5139 ParserErrorCode.IMPLEMENTS_BEFORE_WITH,
5140 implementsClause.keyword); 5140 implementsClause.implementsKeyword);
5141 } 5141 }
5142 } else { 5142 } else {
5143 _reportErrorForToken( 5143 _reportErrorForToken(
5144 ParserErrorCode.MULTIPLE_WITH_CLAUSES, 5144 ParserErrorCode.MULTIPLE_WITH_CLAUSES,
5145 withClause.withKeyword); 5145 withClause.withKeyword);
5146 parseWithClause(); 5146 parseWithClause();
5147 // TODO(brianwilkerson) Should we merge the list of applied mixins 5147 // TODO(brianwilkerson) Should we merge the list of applied mixins
5148 // into a single list? 5148 // into a single list?
5149 } 5149 }
5150 } else if (_matchesKeyword(Keyword.IMPLEMENTS)) { 5150 } else if (_matchesKeyword(Keyword.IMPLEMENTS)) {
5151 if (implementsClause == null) { 5151 if (implementsClause == null) {
5152 implementsClause = parseImplementsClause(); 5152 implementsClause = parseImplementsClause();
5153 } else { 5153 } else {
5154 _reportErrorForToken( 5154 _reportErrorForToken(
5155 ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, 5155 ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES,
5156 implementsClause.keyword); 5156 implementsClause.implementsKeyword);
5157 parseImplementsClause(); 5157 parseImplementsClause();
5158 // TODO(brianwilkerson) Should we merge the list of implemented 5158 // TODO(brianwilkerson) Should we merge the list of implemented
5159 // classes into a single list? 5159 // classes into a single list?
5160 } 5160 }
5161 } else { 5161 } else {
5162 foundClause = false; 5162 foundClause = false;
5163 } 5163 }
5164 } 5164 }
5165 if (withClause != null && extendsClause == null) { 5165 if (withClause != null && extendsClause == null) {
5166 _reportErrorForToken( 5166 _reportErrorForToken(
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
5999 } 5999 }
6000 return new CompilationUnit( 6000 return new CompilationUnit(
6001 firstToken, 6001 firstToken,
6002 scriptTag, 6002 scriptTag,
6003 directives, 6003 directives,
6004 new List<CompilationUnitMember>(), 6004 new List<CompilationUnitMember>(),
6005 _currentToken); 6005 _currentToken);
6006 } 6006 }
6007 6007
6008 /** 6008 /**
6009 * Parse a do statement.
6010 *
6011 * <pre>
6012 * doStatement ::=
6013 * 'do' statement 'while' '(' expression ')' ';'
6014 * </pre>
6015 *
6016 * @return the do statement that was parsed
6017 */
6018 Statement _parseDoStatement() {
6019 bool wasInLoop = _inLoop;
6020 _inLoop = true;
6021 try {
6022 Token doKeyword = _expectKeyword(Keyword.DO);
6023 Statement body = parseStatement2();
6024 Token whileKeyword = _expectKeyword(Keyword.WHILE);
6025 Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
6026 Expression condition = parseExpression2();
6027 Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
6028 Token semicolon = _expect(TokenType.SEMICOLON);
6029 return new DoStatement(
6030 doKeyword,
6031 body,
6032 whileKeyword,
6033 leftParenthesis,
6034 condition,
6035 rightParenthesis,
6036 semicolon);
6037 } finally {
6038 _inLoop = wasInLoop;
6039 }
6040 }
6041
6042 /**
6043 * Parse a documentation comment. 6009 * Parse a documentation comment.
6044 * 6010 *
6045 * <pre> 6011 * <pre>
6046 * documentationComment ::= 6012 * documentationComment ::=
6047 * multiLineComment? 6013 * multiLineComment?
6048 * | singleLineComment* 6014 * | singleLineComment*
6049 * </pre> 6015 * </pre>
6050 * 6016 *
6051 * @return the documentation comment that was parsed, or `null` if there was n o comment 6017 * @return the documentation comment that was parsed, or `null` if there was n o comment
6052 */ 6018 */
(...skipping 21 matching lines...) Expand all
6074 return null; 6040 return null;
6075 } 6041 }
6076 List<CommentReference> references = 6042 List<CommentReference> references =
6077 _parseCommentReferences(documentationTokens); 6043 _parseCommentReferences(documentationTokens);
6078 return Comment.createDocumentationCommentWithReferences( 6044 return Comment.createDocumentationCommentWithReferences(
6079 documentationTokens, 6045 documentationTokens,
6080 references); 6046 references);
6081 } 6047 }
6082 6048
6083 /** 6049 /**
6050 * Parse a do statement.
6051 *
6052 * <pre>
6053 * doStatement ::=
6054 * 'do' statement 'while' '(' expression ')' ';'
6055 * </pre>
6056 *
6057 * @return the do statement that was parsed
6058 */
6059 Statement _parseDoStatement() {
6060 bool wasInLoop = _inLoop;
6061 _inLoop = true;
6062 try {
6063 Token doKeyword = _expectKeyword(Keyword.DO);
6064 Statement body = parseStatement2();
6065 Token whileKeyword = _expectKeyword(Keyword.WHILE);
6066 Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
6067 Expression condition = parseExpression2();
6068 Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
6069 Token semicolon = _expect(TokenType.SEMICOLON);
6070 return new DoStatement(
6071 doKeyword,
6072 body,
6073 whileKeyword,
6074 leftParenthesis,
6075 condition,
6076 rightParenthesis,
6077 semicolon);
6078 } finally {
6079 _inLoop = wasInLoop;
6080 }
6081 }
6082
6083 /**
6084 * Parse an empty statement. 6084 * Parse an empty statement.
6085 * 6085 *
6086 * <pre> 6086 * <pre>
6087 * emptyStatement ::= 6087 * emptyStatement ::=
6088 * ';' 6088 * ';'
6089 * </pre> 6089 * </pre>
6090 * 6090 *
6091 * @return the empty statement that was parsed 6091 * @return the empty statement that was parsed
6092 */ 6092 */
6093 Statement _parseEmptyStatement() => new EmptyStatement(getAndAdvance()); 6093 Statement _parseEmptyStatement() => new EmptyStatement(getAndAdvance());
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
6270 type = parseReturnType(); 6270 type = parseReturnType();
6271 } else if (!optional) { 6271 } else if (!optional) {
6272 _reportErrorForCurrentToken( 6272 _reportErrorForCurrentToken(
6273 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE); 6273 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
6274 } 6274 }
6275 } 6275 }
6276 return new FinalConstVarOrType(keyword, type); 6276 return new FinalConstVarOrType(keyword, type);
6277 } 6277 }
6278 6278
6279 /** 6279 /**
6280 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
6281 * `true`.
6282 *
6283 * <pre>
6284 * defaultFormalParameter ::=
6285 * normalFormalParameter ('=' expression)?
6286 *
6287 * defaultNamedParameter ::=
6288 * normalFormalParameter (':' expression)?
6289 * </pre>
6290 *
6291 * @param kind the kind of parameter being expected based on the presence or a bsence of group
6292 * delimiters
6293 * @return the formal parameter that was parsed
6294 */
6295 FormalParameter _parseFormalParameter(ParameterKind kind) {
6296 NormalFormalParameter parameter = parseNormalFormalParameter();
6297 if (_matches(TokenType.EQ)) {
6298 Token seperator = getAndAdvance();
6299 Expression defaultValue = parseExpression2();
6300 if (kind == ParameterKind.NAMED) {
6301 _reportErrorForToken(
6302 ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
6303 seperator);
6304 } else if (kind == ParameterKind.REQUIRED) {
6305 _reportErrorForNode(
6306 ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
6307 parameter);
6308 }
6309 return new DefaultFormalParameter(
6310 parameter,
6311 kind,
6312 seperator,
6313 defaultValue);
6314 } else if (_matches(TokenType.COLON)) {
6315 Token seperator = getAndAdvance();
6316 Expression defaultValue = parseExpression2();
6317 if (kind == ParameterKind.POSITIONAL) {
6318 _reportErrorForToken(
6319 ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
6320 seperator);
6321 } else if (kind == ParameterKind.REQUIRED) {
6322 _reportErrorForNode(
6323 ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
6324 parameter);
6325 }
6326 return new DefaultFormalParameter(
6327 parameter,
6328 kind,
6329 seperator,
6330 defaultValue);
6331 } else if (kind != ParameterKind.REQUIRED) {
6332 return new DefaultFormalParameter(parameter, kind, null, null);
6333 }
6334 return parameter;
6335 }
6336
6337 /**
6280 * Parse a for statement. 6338 * Parse a for statement.
6281 * 6339 *
6282 * <pre> 6340 * <pre>
6283 * forStatement ::= 6341 * forStatement ::=
6284 * 'for' '(' forLoopParts ')' statement 6342 * 'for' '(' forLoopParts ')' statement
6285 * 6343 *
6286 * forLoopParts ::= 6344 * forLoopParts ::=
6287 * forInitializerStatement expression? ';' expressionList? 6345 * forInitializerStatement expression? ';' expressionList?
6288 * | declaredIdentifier 'in' expression 6346 * | declaredIdentifier 'in' expression
6289 * | identifier 'in' expression 6347 * | identifier 'in' expression
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
6421 rightSeparator, 6479 rightSeparator,
6422 updaters, 6480 updaters,
6423 rightParenthesis, 6481 rightParenthesis,
6424 body); 6482 body);
6425 } finally { 6483 } finally {
6426 _inLoop = wasInLoop; 6484 _inLoop = wasInLoop;
6427 } 6485 }
6428 } 6486 }
6429 6487
6430 /** 6488 /**
6431 * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
6432 * `true`.
6433 *
6434 * <pre>
6435 * defaultFormalParameter ::=
6436 * normalFormalParameter ('=' expression)?
6437 *
6438 * defaultNamedParameter ::=
6439 * normalFormalParameter (':' expression)?
6440 * </pre>
6441 *
6442 * @param kind the kind of parameter being expected based on the presence or a bsence of group
6443 * delimiters
6444 * @return the formal parameter that was parsed
6445 */
6446 FormalParameter _parseFormalParameter(ParameterKind kind) {
6447 NormalFormalParameter parameter = parseNormalFormalParameter();
6448 if (_matches(TokenType.EQ)) {
6449 Token seperator = getAndAdvance();
6450 Expression defaultValue = parseExpression2();
6451 if (kind == ParameterKind.NAMED) {
6452 _reportErrorForToken(
6453 ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
6454 seperator);
6455 } else if (kind == ParameterKind.REQUIRED) {
6456 _reportErrorForNode(
6457 ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
6458 parameter);
6459 }
6460 return new DefaultFormalParameter(
6461 parameter,
6462 kind,
6463 seperator,
6464 defaultValue);
6465 } else if (_matches(TokenType.COLON)) {
6466 Token seperator = getAndAdvance();
6467 Expression defaultValue = parseExpression2();
6468 if (kind == ParameterKind.POSITIONAL) {
6469 _reportErrorForToken(
6470 ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
6471 seperator);
6472 } else if (kind == ParameterKind.REQUIRED) {
6473 _reportErrorForNode(
6474 ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
6475 parameter);
6476 }
6477 return new DefaultFormalParameter(
6478 parameter,
6479 kind,
6480 seperator,
6481 defaultValue);
6482 } else if (kind != ParameterKind.REQUIRED) {
6483 return new DefaultFormalParameter(parameter, kind, null, null);
6484 }
6485 return parameter;
6486 }
6487
6488 /**
6489 * Parse a function body. 6489 * Parse a function body.
6490 * 6490 *
6491 * <pre> 6491 * <pre>
6492 * functionBody ::= 6492 * functionBody ::=
6493 * '=>' expression ';' 6493 * '=>' expression ';'
6494 * | block 6494 * | block
6495 * 6495 *
6496 * functionExpressionBody ::= 6496 * functionExpressionBody ::=
6497 * '=>' expression 6497 * '=>' expression
6498 * | block 6498 * | block
(...skipping 3497 matching lines...) Expand 10 before | Expand all | Expand 10 after
9996 _reportErrorForToken( 9996 _reportErrorForToken(
9997 ParserErrorCode.FINAL_TYPEDEF, 9997 ParserErrorCode.FINAL_TYPEDEF,
9998 modifiers.finalKeyword); 9998 modifiers.finalKeyword);
9999 } 9999 }
10000 if (modifiers.varKeyword != null) { 10000 if (modifiers.varKeyword != null) {
10001 _reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword); 10001 _reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword);
10002 } 10002 }
10003 } 10003 }
10004 } 10004 }
10005 /** 10005 /**
10006 * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
10007 */
10008 class Parser_SyntheticKeywordToken extends KeywordToken {
10009 /**
10010 * Initialize a newly created token to represent the given keyword.
10011 *
10012 * @param keyword the keyword being represented by this token
10013 * @param offset the offset from the beginning of the file to the first charac ter in the token
10014 */
10015 Parser_SyntheticKeywordToken(Keyword keyword, int offset)
10016 : super(keyword, offset);
10017
10018 @override
10019 int get length => 0;
10020
10021 @override
10022 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
10023 }
10024
10025
10026 /**
10006 * The enumeration `ParserErrorCode` defines the error codes used for errors 10027 * The enumeration `ParserErrorCode` defines the error codes used for errors
10007 * detected by the parser. The convention for this class is for the name of the 10028 * detected by the parser. The convention for this class is for the name of the
10008 * error code to indicate the problem that caused the error to be generated and 10029 * error code to indicate the problem that caused the error to be generated and
10009 * for the error message to explain what is wrong and, when appropriate, how the 10030 * for the error message to explain what is wrong and, when appropriate, how the
10010 * problem can be corrected. 10031 * problem can be corrected.
10011 */ 10032 */
10012 class ParserErrorCode extends ErrorCode { 10033 class ParserErrorCode extends ErrorCode {
10013 static const ParserErrorCode ABSTRACT_CLASS_MEMBER = const ParserErrorCode( 10034 static const ParserErrorCode ABSTRACT_CLASS_MEMBER = const ParserErrorCode(
10014 'ABSTRACT_CLASS_MEMBER', 10035 'ABSTRACT_CLASS_MEMBER',
10015 "Members of classes cannot be declared to be 'abstract'"); 10036 "Members of classes cannot be declared to be 'abstract'");
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
10713 10734
10714 @override 10735 @override
10715 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 10736 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
10716 10737
10717 @override 10738 @override
10718 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 10739 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
10719 } 10740 }
10720 10741
10721 10742
10722 /** 10743 /**
10723 * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
10724 */
10725 class Parser_SyntheticKeywordToken extends KeywordToken {
10726 /**
10727 * Initialize a newly created token to represent the given keyword.
10728 *
10729 * @param keyword the keyword being represented by this token
10730 * @param offset the offset from the beginning of the file to the first charac ter in the token
10731 */
10732 Parser_SyntheticKeywordToken(Keyword keyword, int offset)
10733 : super(keyword, offset);
10734
10735 @override
10736 int get length => 0;
10737
10738 @override
10739 Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
10740 }
10741
10742
10743 /**
10744 * Instances of the class `ResolutionCopier` copies resolution information from one AST 10744 * Instances of the class `ResolutionCopier` copies resolution information from one AST
10745 * structure to another as long as the structures of the corresponding children of a pair of nodes 10745 * structure to another as long as the structures of the corresponding children of a pair of nodes
10746 * are the same. 10746 * are the same.
10747 */ 10747 */
10748 class ResolutionCopier implements AstVisitor<bool> { 10748 class ResolutionCopier implements AstVisitor<bool> {
10749 /** 10749 /**
10750 * The AST node with which the node being visited is to be compared. This is o nly valid at the 10750 * The AST node with which the node being visited is to be compared. This is o nly valid at the
10751 * beginning of each visit method (until [isEqualNodes] is invoked). 10751 * beginning of each visit method (until [isEqualNodes] is invoked).
10752 */ 10752 */
10753 AstNode _toNode; 10753 AstNode _toNode;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
10793 toNode.staticType = node.staticType; 10793 toNode.staticType = node.staticType;
10794 return true; 10794 return true;
10795 } 10795 }
10796 return false; 10796 return false;
10797 } 10797 }
10798 10798
10799 @override 10799 @override
10800 bool visitAssertStatement(AssertStatement node) { 10800 bool visitAssertStatement(AssertStatement node) {
10801 AssertStatement toNode = this._toNode as AssertStatement; 10801 AssertStatement toNode = this._toNode as AssertStatement;
10802 return _and( 10802 return _and(
10803 _isEqualTokens(node.keyword, toNode.keyword), 10803 _isEqualTokens(node.assertKeyword, toNode.assertKeyword),
10804 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), 10804 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
10805 _isEqualNodes(node.condition, toNode.condition), 10805 _isEqualNodes(node.condition, toNode.condition),
10806 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 10806 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
10807 _isEqualTokens(node.semicolon, toNode.semicolon)); 10807 _isEqualTokens(node.semicolon, toNode.semicolon));
10808 } 10808 }
10809 10809
10810 @override 10810 @override
10811 bool visitAssignmentExpression(AssignmentExpression node) { 10811 bool visitAssignmentExpression(AssignmentExpression node) {
10812 AssignmentExpression toNode = this._toNode as AssignmentExpression; 10812 AssignmentExpression toNode = this._toNode as AssignmentExpression;
10813 if (_and( 10813 if (_and(
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
10872 toNode.staticType = node.staticType; 10872 toNode.staticType = node.staticType;
10873 return true; 10873 return true;
10874 } 10874 }
10875 return false; 10875 return false;
10876 } 10876 }
10877 10877
10878 @override 10878 @override
10879 bool visitBreakStatement(BreakStatement node) { 10879 bool visitBreakStatement(BreakStatement node) {
10880 BreakStatement toNode = this._toNode as BreakStatement; 10880 BreakStatement toNode = this._toNode as BreakStatement;
10881 if (_and( 10881 if (_and(
10882 _isEqualTokens(node.keyword, toNode.keyword), 10882 _isEqualTokens(node.breakKeyword, toNode.breakKeyword),
10883 _isEqualNodes(node.label, toNode.label), 10883 _isEqualNodes(node.label, toNode.label),
10884 _isEqualTokens(node.semicolon, toNode.semicolon))) { 10884 _isEqualTokens(node.semicolon, toNode.semicolon))) {
10885 // TODO(paulberry): map node.target to toNode.target. 10885 // TODO(paulberry): map node.target to toNode.target.
10886 return true; 10886 return true;
10887 } 10887 }
10888 return false; 10888 return false;
10889 } 10889 }
10890 10890
10891 @override 10891 @override
10892 bool visitCascadeExpression(CascadeExpression node) { 10892 bool visitCascadeExpression(CascadeExpression node) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
10933 _isEqualNodeLists(node.members, toNode.members), 10933 _isEqualNodeLists(node.members, toNode.members),
10934 _isEqualTokens(node.rightBracket, toNode.rightBracket)); 10934 _isEqualTokens(node.rightBracket, toNode.rightBracket));
10935 } 10935 }
10936 10936
10937 @override 10937 @override
10938 bool visitClassTypeAlias(ClassTypeAlias node) { 10938 bool visitClassTypeAlias(ClassTypeAlias node) {
10939 ClassTypeAlias toNode = this._toNode as ClassTypeAlias; 10939 ClassTypeAlias toNode = this._toNode as ClassTypeAlias;
10940 return _and( 10940 return _and(
10941 _isEqualNodes(node.documentationComment, toNode.documentationComment), 10941 _isEqualNodes(node.documentationComment, toNode.documentationComment),
10942 _isEqualNodeLists(node.metadata, toNode.metadata), 10942 _isEqualNodeLists(node.metadata, toNode.metadata),
10943 _isEqualTokens(node.keyword, toNode.keyword), 10943 _isEqualTokens(node.typedefKeyword, toNode.typedefKeyword),
10944 _isEqualNodes(node.name, toNode.name), 10944 _isEqualNodes(node.name, toNode.name),
10945 _isEqualNodes(node.typeParameters, toNode.typeParameters), 10945 _isEqualNodes(node.typeParameters, toNode.typeParameters),
10946 _isEqualTokens(node.equals, toNode.equals), 10946 _isEqualTokens(node.equals, toNode.equals),
10947 _isEqualTokens(node.abstractKeyword, toNode.abstractKeyword), 10947 _isEqualTokens(node.abstractKeyword, toNode.abstractKeyword),
10948 _isEqualNodes(node.superclass, toNode.superclass), 10948 _isEqualNodes(node.superclass, toNode.superclass),
10949 _isEqualNodes(node.withClause, toNode.withClause), 10949 _isEqualNodes(node.withClause, toNode.withClause),
10950 _isEqualNodes(node.implementsClause, toNode.implementsClause), 10950 _isEqualNodes(node.implementsClause, toNode.implementsClause),
10951 _isEqualTokens(node.semicolon, toNode.semicolon)); 10951 _isEqualTokens(node.semicolon, toNode.semicolon));
10952 } 10952 }
10953 10953
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
11017 return true; 11017 return true;
11018 } 11018 }
11019 return false; 11019 return false;
11020 } 11020 }
11021 11021
11022 @override 11022 @override
11023 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 11023 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
11024 ConstructorFieldInitializer toNode = 11024 ConstructorFieldInitializer toNode =
11025 this._toNode as ConstructorFieldInitializer; 11025 this._toNode as ConstructorFieldInitializer;
11026 return _and( 11026 return _and(
11027 _isEqualTokens(node.keyword, toNode.keyword), 11027 _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
11028 _isEqualTokens(node.period, toNode.period), 11028 _isEqualTokens(node.period, toNode.period),
11029 _isEqualNodes(node.fieldName, toNode.fieldName), 11029 _isEqualNodes(node.fieldName, toNode.fieldName),
11030 _isEqualTokens(node.equals, toNode.equals), 11030 _isEqualTokens(node.equals, toNode.equals),
11031 _isEqualNodes(node.expression, toNode.expression)); 11031 _isEqualNodes(node.expression, toNode.expression));
11032 } 11032 }
11033 11033
11034 @override 11034 @override
11035 bool visitConstructorName(ConstructorName node) { 11035 bool visitConstructorName(ConstructorName node) {
11036 ConstructorName toNode = this._toNode as ConstructorName; 11036 ConstructorName toNode = this._toNode as ConstructorName;
11037 if (_and( 11037 if (_and(
11038 _isEqualNodes(node.type, toNode.type), 11038 _isEqualNodes(node.type, toNode.type),
11039 _isEqualTokens(node.period, toNode.period), 11039 _isEqualTokens(node.period, toNode.period),
11040 _isEqualNodes(node.name, toNode.name))) { 11040 _isEqualNodes(node.name, toNode.name))) {
11041 toNode.staticElement = node.staticElement; 11041 toNode.staticElement = node.staticElement;
11042 return true; 11042 return true;
11043 } 11043 }
11044 return false; 11044 return false;
11045 } 11045 }
11046 11046
11047 @override 11047 @override
11048 bool visitContinueStatement(ContinueStatement node) { 11048 bool visitContinueStatement(ContinueStatement node) {
11049 ContinueStatement toNode = this._toNode as ContinueStatement; 11049 ContinueStatement toNode = this._toNode as ContinueStatement;
11050 if (_and( 11050 if (_and(
11051 _isEqualTokens(node.keyword, toNode.keyword), 11051 _isEqualTokens(node.continueKeyword, toNode.continueKeyword),
11052 _isEqualNodes(node.label, toNode.label), 11052 _isEqualNodes(node.label, toNode.label),
11053 _isEqualTokens(node.semicolon, toNode.semicolon))) { 11053 _isEqualTokens(node.semicolon, toNode.semicolon))) {
11054 // TODO(paulberry): map node.target to toNode.target. 11054 // TODO(paulberry): map node.target to toNode.target.
11055 return true; 11055 return true;
11056 } 11056 }
11057 return false; 11057 return false;
11058 } 11058 }
11059 11059
11060 @override 11060 @override
11061 bool visitDeclaredIdentifier(DeclaredIdentifier node) { 11061 bool visitDeclaredIdentifier(DeclaredIdentifier node) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
11124 _isEqualNodeLists(node.metadata, toNode.metadata), 11124 _isEqualNodeLists(node.metadata, toNode.metadata),
11125 _isEqualNodes(node.name, toNode.name)); 11125 _isEqualNodes(node.name, toNode.name));
11126 } 11126 }
11127 11127
11128 @override 11128 @override
11129 bool visitEnumDeclaration(EnumDeclaration node) { 11129 bool visitEnumDeclaration(EnumDeclaration node) {
11130 EnumDeclaration toNode = this._toNode as EnumDeclaration; 11130 EnumDeclaration toNode = this._toNode as EnumDeclaration;
11131 return _and( 11131 return _and(
11132 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11132 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11133 _isEqualNodeLists(node.metadata, toNode.metadata), 11133 _isEqualNodeLists(node.metadata, toNode.metadata),
11134 _isEqualTokens(node.keyword, toNode.keyword), 11134 _isEqualTokens(node.enumKeyword, toNode.enumKeyword),
11135 _isEqualNodes(node.name, toNode.name), 11135 _isEqualNodes(node.name, toNode.name),
11136 _isEqualTokens(node.leftBracket, toNode.leftBracket), 11136 _isEqualTokens(node.leftBracket, toNode.leftBracket),
11137 _isEqualNodeLists(node.constants, toNode.constants), 11137 _isEqualNodeLists(node.constants, toNode.constants),
11138 _isEqualTokens(node.rightBracket, toNode.rightBracket)); 11138 _isEqualTokens(node.rightBracket, toNode.rightBracket));
11139 } 11139 }
11140 11140
11141 @override 11141 @override
11142 bool visitExportDirective(ExportDirective node) { 11142 bool visitExportDirective(ExportDirective node) {
11143 ExportDirective toNode = this._toNode as ExportDirective; 11143 ExportDirective toNode = this._toNode as ExportDirective;
11144 if (_and( 11144 if (_and(
(...skipping 23 matching lines...) Expand all
11168 ExpressionStatement toNode = this._toNode as ExpressionStatement; 11168 ExpressionStatement toNode = this._toNode as ExpressionStatement;
11169 return _and( 11169 return _and(
11170 _isEqualNodes(node.expression, toNode.expression), 11170 _isEqualNodes(node.expression, toNode.expression),
11171 _isEqualTokens(node.semicolon, toNode.semicolon)); 11171 _isEqualTokens(node.semicolon, toNode.semicolon));
11172 } 11172 }
11173 11173
11174 @override 11174 @override
11175 bool visitExtendsClause(ExtendsClause node) { 11175 bool visitExtendsClause(ExtendsClause node) {
11176 ExtendsClause toNode = this._toNode as ExtendsClause; 11176 ExtendsClause toNode = this._toNode as ExtendsClause;
11177 return _and( 11177 return _and(
11178 _isEqualTokens(node.keyword, toNode.keyword), 11178 _isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
11179 _isEqualNodes(node.superclass, toNode.superclass)); 11179 _isEqualNodes(node.superclass, toNode.superclass));
11180 } 11180 }
11181 11181
11182 @override 11182 @override
11183 bool visitFieldDeclaration(FieldDeclaration node) { 11183 bool visitFieldDeclaration(FieldDeclaration node) {
11184 FieldDeclaration toNode = this._toNode as FieldDeclaration; 11184 FieldDeclaration toNode = this._toNode as FieldDeclaration;
11185 return _and( 11185 return _and(
11186 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11186 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11187 _isEqualNodeLists(node.metadata, toNode.metadata), 11187 _isEqualNodeLists(node.metadata, toNode.metadata),
11188 _isEqualTokens(node.staticKeyword, toNode.staticKeyword), 11188 _isEqualTokens(node.staticKeyword, toNode.staticKeyword),
11189 _isEqualNodes(node.fields, toNode.fields), 11189 _isEqualNodes(node.fields, toNode.fields),
11190 _isEqualTokens(node.semicolon, toNode.semicolon)); 11190 _isEqualTokens(node.semicolon, toNode.semicolon));
11191 } 11191 }
11192 11192
11193 @override 11193 @override
11194 bool visitFieldFormalParameter(FieldFormalParameter node) { 11194 bool visitFieldFormalParameter(FieldFormalParameter node) {
11195 FieldFormalParameter toNode = this._toNode as FieldFormalParameter; 11195 FieldFormalParameter toNode = this._toNode as FieldFormalParameter;
11196 return _and( 11196 return _and(
11197 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11197 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11198 _isEqualNodeLists(node.metadata, toNode.metadata), 11198 _isEqualNodeLists(node.metadata, toNode.metadata),
11199 _isEqualTokens(node.keyword, toNode.keyword), 11199 _isEqualTokens(node.keyword, toNode.keyword),
11200 _isEqualNodes(node.type, toNode.type), 11200 _isEqualNodes(node.type, toNode.type),
11201 _isEqualTokens(node.thisToken, toNode.thisToken), 11201 _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
11202 _isEqualTokens(node.period, toNode.period), 11202 _isEqualTokens(node.period, toNode.period),
11203 _isEqualNodes(node.identifier, toNode.identifier)); 11203 _isEqualNodes(node.identifier, toNode.identifier));
11204 } 11204 }
11205 11205
11206 @override 11206 @override
11207 bool visitForEachStatement(ForEachStatement node) { 11207 bool visitForEachStatement(ForEachStatement node) {
11208 ForEachStatement toNode = this._toNode as ForEachStatement; 11208 ForEachStatement toNode = this._toNode as ForEachStatement;
11209 return _and( 11209 return _and(
11210 _isEqualTokens(node.forKeyword, toNode.forKeyword), 11210 _isEqualTokens(node.forKeyword, toNode.forKeyword),
11211 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), 11211 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11212 _isEqualNodes(node.loopVariable, toNode.loopVariable), 11212 _isEqualNodes(node.loopVariable, toNode.loopVariable),
11213 _isEqualTokens(node.inKeyword, toNode.inKeyword), 11213 _isEqualTokens(node.inKeyword, toNode.inKeyword),
11214 _isEqualNodes(node.iterable, toNode.iterable), 11214 _isEqualNodes(node.iterable, toNode.iterable),
11215 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 11215 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
11216 _isEqualNodes(node.body, toNode.body)); 11216 _isEqualNodes(node.body, toNode.body));
11217 } 11217 }
11218 11218
11219 @override 11219 @override
11220 bool visitFormalParameterList(FormalParameterList node) {
11221 FormalParameterList toNode = this._toNode as FormalParameterList;
11222 return _and(
11223 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11224 _isEqualNodeLists(node.parameters, toNode.parameters),
11225 _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
11226 _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
11227 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
11228 }
11229
11230 @override
11220 bool visitForStatement(ForStatement node) { 11231 bool visitForStatement(ForStatement node) {
11221 ForStatement toNode = this._toNode as ForStatement; 11232 ForStatement toNode = this._toNode as ForStatement;
11222 return _and( 11233 return _and(
11223 _isEqualTokens(node.forKeyword, toNode.forKeyword), 11234 _isEqualTokens(node.forKeyword, toNode.forKeyword),
11224 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), 11235 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11225 _isEqualNodes(node.variables, toNode.variables), 11236 _isEqualNodes(node.variables, toNode.variables),
11226 _isEqualNodes(node.initialization, toNode.initialization), 11237 _isEqualNodes(node.initialization, toNode.initialization),
11227 _isEqualTokens(node.leftSeparator, toNode.leftSeparator), 11238 _isEqualTokens(node.leftSeparator, toNode.leftSeparator),
11228 _isEqualNodes(node.condition, toNode.condition), 11239 _isEqualNodes(node.condition, toNode.condition),
11229 _isEqualTokens(node.rightSeparator, toNode.rightSeparator), 11240 _isEqualTokens(node.rightSeparator, toNode.rightSeparator),
11230 _isEqualNodeLists(node.updaters, toNode.updaters), 11241 _isEqualNodeLists(node.updaters, toNode.updaters),
11231 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 11242 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
11232 _isEqualNodes(node.body, toNode.body)); 11243 _isEqualNodes(node.body, toNode.body));
11233 } 11244 }
11234 11245
11235 @override 11246 @override
11236 bool visitFormalParameterList(FormalParameterList node) {
11237 FormalParameterList toNode = this._toNode as FormalParameterList;
11238 return _and(
11239 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11240 _isEqualNodeLists(node.parameters, toNode.parameters),
11241 _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
11242 _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
11243 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
11244 }
11245
11246 @override
11247 bool visitFunctionDeclaration(FunctionDeclaration node) { 11247 bool visitFunctionDeclaration(FunctionDeclaration node) {
11248 FunctionDeclaration toNode = this._toNode as FunctionDeclaration; 11248 FunctionDeclaration toNode = this._toNode as FunctionDeclaration;
11249 return _and( 11249 return _and(
11250 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11250 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11251 _isEqualNodeLists(node.metadata, toNode.metadata), 11251 _isEqualNodeLists(node.metadata, toNode.metadata),
11252 _isEqualTokens(node.externalKeyword, toNode.externalKeyword), 11252 _isEqualTokens(node.externalKeyword, toNode.externalKeyword),
11253 _isEqualNodes(node.returnType, toNode.returnType), 11253 _isEqualNodes(node.returnType, toNode.returnType),
11254 _isEqualTokens(node.propertyKeyword, toNode.propertyKeyword), 11254 _isEqualTokens(node.propertyKeyword, toNode.propertyKeyword),
11255 _isEqualNodes(node.name, toNode.name), 11255 _isEqualNodes(node.name, toNode.name),
11256 _isEqualNodes(node.functionExpression, toNode.functionExpression)); 11256 _isEqualNodes(node.functionExpression, toNode.functionExpression));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
11292 } 11292 }
11293 return false; 11293 return false;
11294 } 11294 }
11295 11295
11296 @override 11296 @override
11297 bool visitFunctionTypeAlias(FunctionTypeAlias node) { 11297 bool visitFunctionTypeAlias(FunctionTypeAlias node) {
11298 FunctionTypeAlias toNode = this._toNode as FunctionTypeAlias; 11298 FunctionTypeAlias toNode = this._toNode as FunctionTypeAlias;
11299 return _and( 11299 return _and(
11300 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11300 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11301 _isEqualNodeLists(node.metadata, toNode.metadata), 11301 _isEqualNodeLists(node.metadata, toNode.metadata),
11302 _isEqualTokens(node.keyword, toNode.keyword), 11302 _isEqualTokens(node.typedefKeyword, toNode.typedefKeyword),
11303 _isEqualNodes(node.returnType, toNode.returnType), 11303 _isEqualNodes(node.returnType, toNode.returnType),
11304 _isEqualNodes(node.name, toNode.name), 11304 _isEqualNodes(node.name, toNode.name),
11305 _isEqualNodes(node.typeParameters, toNode.typeParameters), 11305 _isEqualNodes(node.typeParameters, toNode.typeParameters),
11306 _isEqualNodes(node.parameters, toNode.parameters), 11306 _isEqualNodes(node.parameters, toNode.parameters),
11307 _isEqualTokens(node.semicolon, toNode.semicolon)); 11307 _isEqualTokens(node.semicolon, toNode.semicolon));
11308 } 11308 }
11309 11309
11310 @override 11310 @override
11311 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 11311 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
11312 FunctionTypedFormalParameter toNode = 11312 FunctionTypedFormalParameter toNode =
(...skipping 24 matching lines...) Expand all
11337 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 11337 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
11338 _isEqualNodes(node.thenStatement, toNode.thenStatement), 11338 _isEqualNodes(node.thenStatement, toNode.thenStatement),
11339 _isEqualTokens(node.elseKeyword, toNode.elseKeyword), 11339 _isEqualTokens(node.elseKeyword, toNode.elseKeyword),
11340 _isEqualNodes(node.elseStatement, toNode.elseStatement)); 11340 _isEqualNodes(node.elseStatement, toNode.elseStatement));
11341 } 11341 }
11342 11342
11343 @override 11343 @override
11344 bool visitImplementsClause(ImplementsClause node) { 11344 bool visitImplementsClause(ImplementsClause node) {
11345 ImplementsClause toNode = this._toNode as ImplementsClause; 11345 ImplementsClause toNode = this._toNode as ImplementsClause;
11346 return _and( 11346 return _and(
11347 _isEqualTokens(node.keyword, toNode.keyword), 11347 _isEqualTokens(node.implementsKeyword, toNode.implementsKeyword),
11348 _isEqualNodeLists(node.interfaces, toNode.interfaces)); 11348 _isEqualNodeLists(node.interfaces, toNode.interfaces));
11349 } 11349 }
11350 11350
11351 @override 11351 @override
11352 bool visitImportDirective(ImportDirective node) { 11352 bool visitImportDirective(ImportDirective node) {
11353 ImportDirective toNode = this._toNode as ImportDirective; 11353 ImportDirective toNode = this._toNode as ImportDirective;
11354 if (_and( 11354 if (_and(
11355 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11355 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11356 _isEqualNodeLists(node.metadata, toNode.metadata), 11356 _isEqualNodeLists(node.metadata, toNode.metadata),
11357 _isEqualTokens(node.keyword, toNode.keyword), 11357 _isEqualTokens(node.keyword, toNode.keyword),
11358 _isEqualNodes(node.uri, toNode.uri), 11358 _isEqualNodes(node.uri, toNode.uri),
11359 _isEqualTokens(node.asToken, toNode.asToken), 11359 _isEqualTokens(node.asKeyword, toNode.asKeyword),
11360 _isEqualNodes(node.prefix, toNode.prefix), 11360 _isEqualNodes(node.prefix, toNode.prefix),
11361 _isEqualNodeLists(node.combinators, toNode.combinators), 11361 _isEqualNodeLists(node.combinators, toNode.combinators),
11362 _isEqualTokens(node.semicolon, toNode.semicolon))) { 11362 _isEqualTokens(node.semicolon, toNode.semicolon))) {
11363 toNode.element = node.element; 11363 toNode.element = node.element;
11364 return true; 11364 return true;
11365 } 11365 }
11366 return false; 11366 return false;
11367 } 11367 }
11368 11368
11369 @override 11369 @override
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
11460 _isEqualNodeLists(node.labels, toNode.labels), 11460 _isEqualNodeLists(node.labels, toNode.labels),
11461 _isEqualNodes(node.statement, toNode.statement)); 11461 _isEqualNodes(node.statement, toNode.statement));
11462 } 11462 }
11463 11463
11464 @override 11464 @override
11465 bool visitLibraryDirective(LibraryDirective node) { 11465 bool visitLibraryDirective(LibraryDirective node) {
11466 LibraryDirective toNode = this._toNode as LibraryDirective; 11466 LibraryDirective toNode = this._toNode as LibraryDirective;
11467 return _and( 11467 return _and(
11468 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11468 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11469 _isEqualNodeLists(node.metadata, toNode.metadata), 11469 _isEqualNodeLists(node.metadata, toNode.metadata),
11470 _isEqualTokens(node.libraryToken, toNode.libraryToken), 11470 _isEqualTokens(node.libraryKeyword, toNode.libraryKeyword),
11471 _isEqualNodes(node.name, toNode.name), 11471 _isEqualNodes(node.name, toNode.name),
11472 _isEqualTokens(node.semicolon, toNode.semicolon)); 11472 _isEqualTokens(node.semicolon, toNode.semicolon));
11473 } 11473 }
11474 11474
11475 @override 11475 @override
11476 bool visitLibraryIdentifier(LibraryIdentifier node) { 11476 bool visitLibraryIdentifier(LibraryIdentifier node) {
11477 LibraryIdentifier toNode = this._toNode as LibraryIdentifier; 11477 LibraryIdentifier toNode = this._toNode as LibraryIdentifier;
11478 if (_isEqualNodeLists(node.components, toNode.components)) { 11478 if (_isEqualNodeLists(node.components, toNode.components)) {
11479 toNode.propagatedType = node.propagatedType; 11479 toNode.propagatedType = node.propagatedType;
11480 toNode.staticType = node.staticType; 11480 toNode.staticType = node.staticType;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
11565 toNode.staticType = node.staticType; 11565 toNode.staticType = node.staticType;
11566 return true; 11566 return true;
11567 } 11567 }
11568 return false; 11568 return false;
11569 } 11569 }
11570 11570
11571 @override 11571 @override
11572 bool visitNativeClause(NativeClause node) { 11572 bool visitNativeClause(NativeClause node) {
11573 NativeClause toNode = this._toNode as NativeClause; 11573 NativeClause toNode = this._toNode as NativeClause;
11574 return _and( 11574 return _and(
11575 _isEqualTokens(node.keyword, toNode.keyword), 11575 _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
11576 _isEqualNodes(node.name, toNode.name)); 11576 _isEqualNodes(node.name, toNode.name));
11577 } 11577 }
11578 11578
11579 @override 11579 @override
11580 bool visitNativeFunctionBody(NativeFunctionBody node) { 11580 bool visitNativeFunctionBody(NativeFunctionBody node) {
11581 NativeFunctionBody toNode = this._toNode as NativeFunctionBody; 11581 NativeFunctionBody toNode = this._toNode as NativeFunctionBody;
11582 return _and( 11582 return _and(
11583 _isEqualTokens(node.nativeToken, toNode.nativeToken), 11583 _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
11584 _isEqualNodes(node.stringLiteral, toNode.stringLiteral), 11584 _isEqualNodes(node.stringLiteral, toNode.stringLiteral),
11585 _isEqualTokens(node.semicolon, toNode.semicolon)); 11585 _isEqualTokens(node.semicolon, toNode.semicolon));
11586 } 11586 }
11587 11587
11588 @override 11588 @override
11589 bool visitNullLiteral(NullLiteral node) { 11589 bool visitNullLiteral(NullLiteral node) {
11590 NullLiteral toNode = this._toNode as NullLiteral; 11590 NullLiteral toNode = this._toNode as NullLiteral;
11591 if (_isEqualTokens(node.literal, toNode.literal)) { 11591 if (_isEqualTokens(node.literal, toNode.literal)) {
11592 toNode.propagatedType = node.propagatedType; 11592 toNode.propagatedType = node.propagatedType;
11593 toNode.staticType = node.staticType; 11593 toNode.staticType = node.staticType;
(...skipping 15 matching lines...) Expand all
11609 } 11609 }
11610 return false; 11610 return false;
11611 } 11611 }
11612 11612
11613 @override 11613 @override
11614 bool visitPartDirective(PartDirective node) { 11614 bool visitPartDirective(PartDirective node) {
11615 PartDirective toNode = this._toNode as PartDirective; 11615 PartDirective toNode = this._toNode as PartDirective;
11616 if (_and( 11616 if (_and(
11617 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11617 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11618 _isEqualNodeLists(node.metadata, toNode.metadata), 11618 _isEqualNodeLists(node.metadata, toNode.metadata),
11619 _isEqualTokens(node.partToken, toNode.partToken), 11619 _isEqualTokens(node.partKeyword, toNode.partKeyword),
11620 _isEqualNodes(node.uri, toNode.uri), 11620 _isEqualNodes(node.uri, toNode.uri),
11621 _isEqualTokens(node.semicolon, toNode.semicolon))) { 11621 _isEqualTokens(node.semicolon, toNode.semicolon))) {
11622 toNode.element = node.element; 11622 toNode.element = node.element;
11623 return true; 11623 return true;
11624 } 11624 }
11625 return false; 11625 return false;
11626 } 11626 }
11627 11627
11628 @override 11628 @override
11629 bool visitPartOfDirective(PartOfDirective node) { 11629 bool visitPartOfDirective(PartOfDirective node) {
11630 PartOfDirective toNode = this._toNode as PartOfDirective; 11630 PartOfDirective toNode = this._toNode as PartOfDirective;
11631 if (_and( 11631 if (_and(
11632 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11632 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11633 _isEqualNodeLists(node.metadata, toNode.metadata), 11633 _isEqualNodeLists(node.metadata, toNode.metadata),
11634 _isEqualTokens(node.partToken, toNode.partToken), 11634 _isEqualTokens(node.partKeyword, toNode.partKeyword),
11635 _isEqualTokens(node.ofToken, toNode.ofToken), 11635 _isEqualTokens(node.ofKeyword, toNode.ofKeyword),
11636 _isEqualNodes(node.libraryName, toNode.libraryName), 11636 _isEqualNodes(node.libraryName, toNode.libraryName),
11637 _isEqualTokens(node.semicolon, toNode.semicolon))) { 11637 _isEqualTokens(node.semicolon, toNode.semicolon))) {
11638 toNode.element = node.element; 11638 toNode.element = node.element;
11639 return true; 11639 return true;
11640 } 11640 }
11641 return false; 11641 return false;
11642 } 11642 }
11643 11643
11644 @override 11644 @override
11645 bool visitPostfixExpression(PostfixExpression node) { 11645 bool visitPostfixExpression(PostfixExpression node) {
11646 PostfixExpression toNode = this._toNode as PostfixExpression; 11646 PostfixExpression toNode = this._toNode as PostfixExpression;
11647 if (_and( 11647 if (_and(
11648 _isEqualNodes(node.operand, toNode.operand), 11648 _isEqualNodes(node.operand, toNode.operand),
11649 _isEqualTokens(node.operator, toNode.operator))) { 11649 _isEqualTokens(node.operator, toNode.operator))) {
11650 toNode.propagatedElement = node.propagatedElement; 11650 toNode.propagatedElement = node.propagatedElement;
11651 toNode.propagatedType = node.propagatedType; 11651 toNode.propagatedType = node.propagatedType;
11652 toNode.staticElement = node.staticElement; 11652 toNode.staticElement = node.staticElement;
11653 toNode.staticType = node.staticType; 11653 toNode.staticType = node.staticType;
11654 return true; 11654 return true;
11655 } 11655 }
11656 return false; 11656 return false;
11657 } 11657 }
11658 11658
11659 @override 11659 @override
11660 bool visitPrefixExpression(PrefixExpression node) { 11660 bool visitPrefixedIdentifier(PrefixedIdentifier node) {
11661 PrefixExpression toNode = this._toNode as PrefixExpression; 11661 PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
11662 if (_and( 11662 if (_and(
11663 _isEqualTokens(node.operator, toNode.operator), 11663 _isEqualNodes(node.prefix, toNode.prefix),
11664 _isEqualNodes(node.operand, toNode.operand))) { 11664 _isEqualTokens(node.period, toNode.period),
11665 toNode.propagatedElement = node.propagatedElement; 11665 _isEqualNodes(node.identifier, toNode.identifier))) {
11666 toNode.propagatedType = node.propagatedType; 11666 toNode.propagatedType = node.propagatedType;
11667 toNode.staticElement = node.staticElement;
11668 toNode.staticType = node.staticType; 11667 toNode.staticType = node.staticType;
11669 return true; 11668 return true;
11670 } 11669 }
11671 return false; 11670 return false;
11672 } 11671 }
11673 11672
11674 @override 11673 @override
11675 bool visitPrefixedIdentifier(PrefixedIdentifier node) { 11674 bool visitPrefixExpression(PrefixExpression node) {
11676 PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier; 11675 PrefixExpression toNode = this._toNode as PrefixExpression;
11677 if (_and( 11676 if (_and(
11678 _isEqualNodes(node.prefix, toNode.prefix), 11677 _isEqualTokens(node.operator, toNode.operator),
11679 _isEqualTokens(node.period, toNode.period), 11678 _isEqualNodes(node.operand, toNode.operand))) {
11680 _isEqualNodes(node.identifier, toNode.identifier))) { 11679 toNode.propagatedElement = node.propagatedElement;
11681 toNode.propagatedType = node.propagatedType; 11680 toNode.propagatedType = node.propagatedType;
11681 toNode.staticElement = node.staticElement;
11682 toNode.staticType = node.staticType; 11682 toNode.staticType = node.staticType;
11683 return true; 11683 return true;
11684 } 11684 }
11685 return false; 11685 return false;
11686 } 11686 }
11687 11687
11688 @override 11688 @override
11689 bool visitPropertyAccess(PropertyAccess node) { 11689 bool visitPropertyAccess(PropertyAccess node) {
11690 PropertyAccess toNode = this._toNode as PropertyAccess; 11690 PropertyAccess toNode = this._toNode as PropertyAccess;
11691 if (_and( 11691 if (_and(
11692 _isEqualNodes(node.target, toNode.target), 11692 _isEqualNodes(node.target, toNode.target),
11693 _isEqualTokens(node.operator, toNode.operator), 11693 _isEqualTokens(node.operator, toNode.operator),
11694 _isEqualNodes(node.propertyName, toNode.propertyName))) { 11694 _isEqualNodes(node.propertyName, toNode.propertyName))) {
11695 toNode.propagatedType = node.propagatedType; 11695 toNode.propagatedType = node.propagatedType;
11696 toNode.staticType = node.staticType; 11696 toNode.staticType = node.staticType;
11697 return true; 11697 return true;
11698 } 11698 }
11699 return false; 11699 return false;
11700 } 11700 }
11701 11701
11702 @override 11702 @override
11703 bool 11703 bool
11704 visitRedirectingConstructorInvocation(RedirectingConstructorInvocation nod e) { 11704 visitRedirectingConstructorInvocation(RedirectingConstructorInvocation nod e) {
11705 RedirectingConstructorInvocation toNode = 11705 RedirectingConstructorInvocation toNode =
11706 this._toNode as RedirectingConstructorInvocation; 11706 this._toNode as RedirectingConstructorInvocation;
11707 if (_and( 11707 if (_and(
11708 _isEqualTokens(node.keyword, toNode.keyword), 11708 _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
11709 _isEqualTokens(node.period, toNode.period), 11709 _isEqualTokens(node.period, toNode.period),
11710 _isEqualNodes(node.constructorName, toNode.constructorName), 11710 _isEqualNodes(node.constructorName, toNode.constructorName),
11711 _isEqualNodes(node.argumentList, toNode.argumentList))) { 11711 _isEqualNodes(node.argumentList, toNode.argumentList))) {
11712 toNode.staticElement = node.staticElement; 11712 toNode.staticElement = node.staticElement;
11713 return true; 11713 return true;
11714 } 11714 }
11715 return false; 11715 return false;
11716 } 11716 }
11717 11717
11718 @override 11718 @override
11719 bool visitRethrowExpression(RethrowExpression node) { 11719 bool visitRethrowExpression(RethrowExpression node) {
11720 RethrowExpression toNode = this._toNode as RethrowExpression; 11720 RethrowExpression toNode = this._toNode as RethrowExpression;
11721 if (_isEqualTokens(node.keyword, toNode.keyword)) { 11721 if (_isEqualTokens(node.rethrowKeyword, toNode.rethrowKeyword)) {
11722 toNode.propagatedType = node.propagatedType; 11722 toNode.propagatedType = node.propagatedType;
11723 toNode.staticType = node.staticType; 11723 toNode.staticType = node.staticType;
11724 return true; 11724 return true;
11725 } 11725 }
11726 return false; 11726 return false;
11727 } 11727 }
11728 11728
11729 @override 11729 @override
11730 bool visitReturnStatement(ReturnStatement node) { 11730 bool visitReturnStatement(ReturnStatement node) {
11731 ReturnStatement toNode = this._toNode as ReturnStatement; 11731 ReturnStatement toNode = this._toNode as ReturnStatement;
11732 return _and( 11732 return _and(
11733 _isEqualTokens(node.keyword, toNode.keyword), 11733 _isEqualTokens(node.returnKeyword, toNode.returnKeyword),
11734 _isEqualNodes(node.expression, toNode.expression), 11734 _isEqualNodes(node.expression, toNode.expression),
11735 _isEqualTokens(node.semicolon, toNode.semicolon)); 11735 _isEqualTokens(node.semicolon, toNode.semicolon));
11736 } 11736 }
11737 11737
11738 @override 11738 @override
11739 bool visitScriptTag(ScriptTag node) { 11739 bool visitScriptTag(ScriptTag node) {
11740 ScriptTag toNode = this._toNode as ScriptTag; 11740 ScriptTag toNode = this._toNode as ScriptTag;
11741 return _isEqualTokens(node.scriptTag, toNode.scriptTag); 11741 return _isEqualTokens(node.scriptTag, toNode.scriptTag);
11742 } 11742 }
11743 11743
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
11796 return true; 11796 return true;
11797 } 11797 }
11798 return false; 11798 return false;
11799 } 11799 }
11800 11800
11801 @override 11801 @override
11802 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { 11802 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
11803 SuperConstructorInvocation toNode = 11803 SuperConstructorInvocation toNode =
11804 this._toNode as SuperConstructorInvocation; 11804 this._toNode as SuperConstructorInvocation;
11805 if (_and( 11805 if (_and(
11806 _isEqualTokens(node.keyword, toNode.keyword), 11806 _isEqualTokens(node.superKeyword, toNode.superKeyword),
11807 _isEqualTokens(node.period, toNode.period), 11807 _isEqualTokens(node.period, toNode.period),
11808 _isEqualNodes(node.constructorName, toNode.constructorName), 11808 _isEqualNodes(node.constructorName, toNode.constructorName),
11809 _isEqualNodes(node.argumentList, toNode.argumentList))) { 11809 _isEqualNodes(node.argumentList, toNode.argumentList))) {
11810 toNode.staticElement = node.staticElement; 11810 toNode.staticElement = node.staticElement;
11811 return true; 11811 return true;
11812 } 11812 }
11813 return false; 11813 return false;
11814 } 11814 }
11815 11815
11816 @override 11816 @override
11817 bool visitSuperExpression(SuperExpression node) { 11817 bool visitSuperExpression(SuperExpression node) {
11818 SuperExpression toNode = this._toNode as SuperExpression; 11818 SuperExpression toNode = this._toNode as SuperExpression;
11819 if (_isEqualTokens(node.keyword, toNode.keyword)) { 11819 if (_isEqualTokens(node.superKeyword, toNode.superKeyword)) {
11820 toNode.propagatedType = node.propagatedType; 11820 toNode.propagatedType = node.propagatedType;
11821 toNode.staticType = node.staticType; 11821 toNode.staticType = node.staticType;
11822 return true; 11822 return true;
11823 } 11823 }
11824 return false; 11824 return false;
11825 } 11825 }
11826 11826
11827 @override 11827 @override
11828 bool visitSwitchCase(SwitchCase node) { 11828 bool visitSwitchCase(SwitchCase node) {
11829 SwitchCase toNode = this._toNode as SwitchCase; 11829 SwitchCase toNode = this._toNode as SwitchCase;
(...skipping 12 matching lines...) Expand all
11842 _isEqualNodeLists(node.labels, toNode.labels), 11842 _isEqualNodeLists(node.labels, toNode.labels),
11843 _isEqualTokens(node.keyword, toNode.keyword), 11843 _isEqualTokens(node.keyword, toNode.keyword),
11844 _isEqualTokens(node.colon, toNode.colon), 11844 _isEqualTokens(node.colon, toNode.colon),
11845 _isEqualNodeLists(node.statements, toNode.statements)); 11845 _isEqualNodeLists(node.statements, toNode.statements));
11846 } 11846 }
11847 11847
11848 @override 11848 @override
11849 bool visitSwitchStatement(SwitchStatement node) { 11849 bool visitSwitchStatement(SwitchStatement node) {
11850 SwitchStatement toNode = this._toNode as SwitchStatement; 11850 SwitchStatement toNode = this._toNode as SwitchStatement;
11851 return _and( 11851 return _and(
11852 _isEqualTokens(node.keyword, toNode.keyword), 11852 _isEqualTokens(node.switchKeyword, toNode.switchKeyword),
11853 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), 11853 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11854 _isEqualNodes(node.expression, toNode.expression), 11854 _isEqualNodes(node.expression, toNode.expression),
11855 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 11855 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
11856 _isEqualTokens(node.leftBracket, toNode.leftBracket), 11856 _isEqualTokens(node.leftBracket, toNode.leftBracket),
11857 _isEqualNodeLists(node.members, toNode.members), 11857 _isEqualNodeLists(node.members, toNode.members),
11858 _isEqualTokens(node.rightBracket, toNode.rightBracket)); 11858 _isEqualTokens(node.rightBracket, toNode.rightBracket));
11859 } 11859 }
11860 11860
11861 @override 11861 @override
11862 bool visitSymbolLiteral(SymbolLiteral node) { 11862 bool visitSymbolLiteral(SymbolLiteral node) {
11863 SymbolLiteral toNode = this._toNode as SymbolLiteral; 11863 SymbolLiteral toNode = this._toNode as SymbolLiteral;
11864 if (_and( 11864 if (_and(
11865 _isEqualTokens(node.poundSign, toNode.poundSign), 11865 _isEqualTokens(node.poundSign, toNode.poundSign),
11866 _isEqualTokenLists(node.components, toNode.components))) { 11866 _isEqualTokenLists(node.components, toNode.components))) {
11867 toNode.propagatedType = node.propagatedType; 11867 toNode.propagatedType = node.propagatedType;
11868 toNode.staticType = node.staticType; 11868 toNode.staticType = node.staticType;
11869 return true; 11869 return true;
11870 } 11870 }
11871 return false; 11871 return false;
11872 } 11872 }
11873 11873
11874 @override 11874 @override
11875 bool visitThisExpression(ThisExpression node) { 11875 bool visitThisExpression(ThisExpression node) {
11876 ThisExpression toNode = this._toNode as ThisExpression; 11876 ThisExpression toNode = this._toNode as ThisExpression;
11877 if (_isEqualTokens(node.keyword, toNode.keyword)) { 11877 if (_isEqualTokens(node.thisKeyword, toNode.thisKeyword)) {
11878 toNode.propagatedType = node.propagatedType; 11878 toNode.propagatedType = node.propagatedType;
11879 toNode.staticType = node.staticType; 11879 toNode.staticType = node.staticType;
11880 return true; 11880 return true;
11881 } 11881 }
11882 return false; 11882 return false;
11883 } 11883 }
11884 11884
11885 @override 11885 @override
11886 bool visitThrowExpression(ThrowExpression node) { 11886 bool visitThrowExpression(ThrowExpression node) {
11887 ThrowExpression toNode = this._toNode as ThrowExpression; 11887 ThrowExpression toNode = this._toNode as ThrowExpression;
11888 if (_and( 11888 if (_and(
11889 _isEqualTokens(node.keyword, toNode.keyword), 11889 _isEqualTokens(node.throwKeyword, toNode.throwKeyword),
11890 _isEqualNodes(node.expression, toNode.expression))) { 11890 _isEqualNodes(node.expression, toNode.expression))) {
11891 toNode.propagatedType = node.propagatedType; 11891 toNode.propagatedType = node.propagatedType;
11892 toNode.staticType = node.staticType; 11892 toNode.staticType = node.staticType;
11893 return true; 11893 return true;
11894 } 11894 }
11895 return false; 11895 return false;
11896 } 11896 }
11897 11897
11898 @override 11898 @override
11899 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 11899 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
11938 return false; 11938 return false;
11939 } 11939 }
11940 11940
11941 @override 11941 @override
11942 bool visitTypeParameter(TypeParameter node) { 11942 bool visitTypeParameter(TypeParameter node) {
11943 TypeParameter toNode = this._toNode as TypeParameter; 11943 TypeParameter toNode = this._toNode as TypeParameter;
11944 return _and( 11944 return _and(
11945 _isEqualNodes(node.documentationComment, toNode.documentationComment), 11945 _isEqualNodes(node.documentationComment, toNode.documentationComment),
11946 _isEqualNodeLists(node.metadata, toNode.metadata), 11946 _isEqualNodeLists(node.metadata, toNode.metadata),
11947 _isEqualNodes(node.name, toNode.name), 11947 _isEqualNodes(node.name, toNode.name),
11948 _isEqualTokens(node.keyword, toNode.keyword), 11948 _isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
11949 _isEqualNodes(node.bound, toNode.bound)); 11949 _isEqualNodes(node.bound, toNode.bound));
11950 } 11950 }
11951 11951
11952 @override 11952 @override
11953 bool visitTypeParameterList(TypeParameterList node) { 11953 bool visitTypeParameterList(TypeParameterList node) {
11954 TypeParameterList toNode = this._toNode as TypeParameterList; 11954 TypeParameterList toNode = this._toNode as TypeParameterList;
11955 return _and( 11955 return _and(
11956 _isEqualTokens(node.leftBracket, toNode.leftBracket), 11956 _isEqualTokens(node.leftBracket, toNode.leftBracket),
11957 _isEqualNodeLists(node.typeParameters, toNode.typeParameters), 11957 _isEqualNodeLists(node.typeParameters, toNode.typeParameters),
11958 _isEqualTokens(node.rightBracket, toNode.rightBracket)); 11958 _isEqualTokens(node.rightBracket, toNode.rightBracket));
(...skipping 27 matching lines...) Expand all
11986 this._toNode as VariableDeclarationStatement; 11986 this._toNode as VariableDeclarationStatement;
11987 return _and( 11987 return _and(
11988 _isEqualNodes(node.variables, toNode.variables), 11988 _isEqualNodes(node.variables, toNode.variables),
11989 _isEqualTokens(node.semicolon, toNode.semicolon)); 11989 _isEqualTokens(node.semicolon, toNode.semicolon));
11990 } 11990 }
11991 11991
11992 @override 11992 @override
11993 bool visitWhileStatement(WhileStatement node) { 11993 bool visitWhileStatement(WhileStatement node) {
11994 WhileStatement toNode = this._toNode as WhileStatement; 11994 WhileStatement toNode = this._toNode as WhileStatement;
11995 return _and( 11995 return _and(
11996 _isEqualTokens(node.keyword, toNode.keyword), 11996 _isEqualTokens(node.whileKeyword, toNode.whileKeyword),
11997 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis), 11997 _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
11998 _isEqualNodes(node.condition, toNode.condition), 11998 _isEqualNodes(node.condition, toNode.condition),
11999 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis), 11999 _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
12000 _isEqualNodes(node.body, toNode.body)); 12000 _isEqualNodes(node.body, toNode.body));
12001 } 12001 }
12002 12002
12003 @override 12003 @override
12004 bool visitWithClause(WithClause node) { 12004 bool visitWithClause(WithClause node) {
12005 WithClause toNode = this._toNode as WithClause; 12005 WithClause toNode = this._toNode as WithClause;
12006 return _and( 12006 return _and(
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
12145 * Copy resolution data from one node to another. 12145 * Copy resolution data from one node to another.
12146 * 12146 *
12147 * @param fromNode the node from which resolution information will be copied 12147 * @param fromNode the node from which resolution information will be copied
12148 * @param toNode the node to which resolution information will be copied 12148 * @param toNode the node to which resolution information will be copied
12149 */ 12149 */
12150 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 12150 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
12151 ResolutionCopier copier = new ResolutionCopier(); 12151 ResolutionCopier copier = new ResolutionCopier();
12152 copier._isEqualNodes(fromNode, toNode); 12152 copier._isEqualNodes(fromNode, toNode);
12153 } 12153 }
12154 } 12154 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698