OLD | NEW |
---|---|
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 library engine.ast; | 5 library engine.ast; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'element.dart'; | 9 import 'element.dart'; |
10 import 'engine.dart' show AnalysisEngine; | 10 import 'engine.dart' show AnalysisEngine; |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1156 ConditionalExpression visitConditionalExpression( | 1156 ConditionalExpression visitConditionalExpression( |
1157 ConditionalExpression node) => | 1157 ConditionalExpression node) => |
1158 new ConditionalExpression( | 1158 new ConditionalExpression( |
1159 cloneNode(node.condition), | 1159 cloneNode(node.condition), |
1160 cloneToken(node.question), | 1160 cloneToken(node.question), |
1161 cloneNode(node.thenExpression), | 1161 cloneNode(node.thenExpression), |
1162 cloneToken(node.colon), | 1162 cloneToken(node.colon), |
1163 cloneNode(node.elseExpression)); | 1163 cloneNode(node.elseExpression)); |
1164 | 1164 |
1165 @override | 1165 @override |
1166 Configuration visitConfiguration(Configuration node) => new Configuration( | |
1167 cloneToken(node.ifKeyword), | |
1168 cloneToken(node.leftParenthesis), | |
1169 cloneNode(node.name), | |
1170 cloneToken(node.equalToken), | |
1171 cloneNode(node.value), | |
1172 cloneToken(node.rightParenthesis), | |
1173 cloneNode(node.libraryUri)); | |
1174 | |
1175 @override | |
1166 ConstructorDeclaration visitConstructorDeclaration( | 1176 ConstructorDeclaration visitConstructorDeclaration( |
1167 ConstructorDeclaration node) => | 1177 ConstructorDeclaration node) => |
1168 new ConstructorDeclaration( | 1178 new ConstructorDeclaration( |
1169 cloneNode(node.documentationComment), | 1179 cloneNode(node.documentationComment), |
1170 cloneNodeList(node.metadata), | 1180 cloneNodeList(node.metadata), |
1171 cloneToken(node.externalKeyword), | 1181 cloneToken(node.externalKeyword), |
1172 cloneToken(node.constKeyword), | 1182 cloneToken(node.constKeyword), |
1173 cloneToken(node.factoryKeyword), | 1183 cloneToken(node.factoryKeyword), |
1174 cloneNode(node.returnType), | 1184 cloneNode(node.returnType), |
1175 cloneToken(node.period), | 1185 cloneToken(node.period), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 DoStatement visitDoStatement(DoStatement node) => new DoStatement( | 1229 DoStatement visitDoStatement(DoStatement node) => new DoStatement( |
1220 cloneToken(node.doKeyword), | 1230 cloneToken(node.doKeyword), |
1221 cloneNode(node.body), | 1231 cloneNode(node.body), |
1222 cloneToken(node.whileKeyword), | 1232 cloneToken(node.whileKeyword), |
1223 cloneToken(node.leftParenthesis), | 1233 cloneToken(node.leftParenthesis), |
1224 cloneNode(node.condition), | 1234 cloneNode(node.condition), |
1225 cloneToken(node.rightParenthesis), | 1235 cloneToken(node.rightParenthesis), |
1226 cloneToken(node.semicolon)); | 1236 cloneToken(node.semicolon)); |
1227 | 1237 |
1228 @override | 1238 @override |
1239 DottedName visitDottedName(DottedName node) => | |
1240 new DottedName(cloneNodeList(node.components)); | |
1241 | |
1242 @override | |
1229 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => | 1243 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => |
1230 new DoubleLiteral(cloneToken(node.literal), node.value); | 1244 new DoubleLiteral(cloneToken(node.literal), node.value); |
1231 | 1245 |
1232 @override | 1246 @override |
1233 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => | 1247 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => |
1234 new EmptyFunctionBody(cloneToken(node.semicolon)); | 1248 new EmptyFunctionBody(cloneToken(node.semicolon)); |
1235 | 1249 |
1236 @override | 1250 @override |
1237 EmptyStatement visitEmptyStatement(EmptyStatement node) => | 1251 EmptyStatement visitEmptyStatement(EmptyStatement node) => |
1238 new EmptyStatement(cloneToken(node.semicolon)); | 1252 new EmptyStatement(cloneToken(node.semicolon)); |
(...skipping 14 matching lines...) Expand all Loading... | |
1253 cloneNodeList(node.constants), | 1267 cloneNodeList(node.constants), |
1254 cloneToken(node.rightBracket)); | 1268 cloneToken(node.rightBracket)); |
1255 | 1269 |
1256 @override | 1270 @override |
1257 ExportDirective visitExportDirective(ExportDirective node) { | 1271 ExportDirective visitExportDirective(ExportDirective node) { |
1258 ExportDirective directive = new ExportDirective( | 1272 ExportDirective directive = new ExportDirective( |
1259 cloneNode(node.documentationComment), | 1273 cloneNode(node.documentationComment), |
1260 cloneNodeList(node.metadata), | 1274 cloneNodeList(node.metadata), |
1261 cloneToken(node.keyword), | 1275 cloneToken(node.keyword), |
1262 cloneNode(node.uri), | 1276 cloneNode(node.uri), |
1277 cloneNodeList(node.configurations), | |
1263 cloneNodeList(node.combinators), | 1278 cloneNodeList(node.combinators), |
1264 cloneToken(node.semicolon)); | 1279 cloneToken(node.semicolon)); |
1265 directive.source = node.source; | 1280 directive.source = node.source; |
1266 directive.uriContent = node.uriContent; | 1281 directive.uriContent = node.uriContent; |
1267 return directive; | 1282 return directive; |
1268 } | 1283 } |
1269 | 1284 |
1270 @override | 1285 @override |
1271 ExpressionFunctionBody visitExpressionFunctionBody( | 1286 ExpressionFunctionBody visitExpressionFunctionBody( |
1272 ExpressionFunctionBody node) => | 1287 ExpressionFunctionBody node) => |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1423 new ImplementsClause( | 1438 new ImplementsClause( |
1424 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); | 1439 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); |
1425 | 1440 |
1426 @override | 1441 @override |
1427 ImportDirective visitImportDirective(ImportDirective node) { | 1442 ImportDirective visitImportDirective(ImportDirective node) { |
1428 ImportDirective directive = new ImportDirective( | 1443 ImportDirective directive = new ImportDirective( |
1429 cloneNode(node.documentationComment), | 1444 cloneNode(node.documentationComment), |
1430 cloneNodeList(node.metadata), | 1445 cloneNodeList(node.metadata), |
1431 cloneToken(node.keyword), | 1446 cloneToken(node.keyword), |
1432 cloneNode(node.uri), | 1447 cloneNode(node.uri), |
1448 cloneNodeList(node.configurations), | |
1433 cloneToken(node.deferredKeyword), | 1449 cloneToken(node.deferredKeyword), |
1434 cloneToken(node.asKeyword), | 1450 cloneToken(node.asKeyword), |
1435 cloneNode(node.prefix), | 1451 cloneNode(node.prefix), |
1436 cloneNodeList(node.combinators), | 1452 cloneNodeList(node.combinators), |
1437 cloneToken(node.semicolon)); | 1453 cloneToken(node.semicolon)); |
1438 directive.source = node.source; | 1454 directive.source = node.source; |
1439 directive.uriContent = node.uriContent; | 1455 directive.uriContent = node.uriContent; |
1440 return directive; | 1456 return directive; |
1441 } | 1457 } |
1442 | 1458 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2032 bool visitConditionalExpression(ConditionalExpression node) { | 2048 bool visitConditionalExpression(ConditionalExpression node) { |
2033 ConditionalExpression other = _other as ConditionalExpression; | 2049 ConditionalExpression other = _other as ConditionalExpression; |
2034 return isEqualNodes(node.condition, other.condition) && | 2050 return isEqualNodes(node.condition, other.condition) && |
2035 isEqualTokens(node.question, other.question) && | 2051 isEqualTokens(node.question, other.question) && |
2036 isEqualNodes(node.thenExpression, other.thenExpression) && | 2052 isEqualNodes(node.thenExpression, other.thenExpression) && |
2037 isEqualTokens(node.colon, other.colon) && | 2053 isEqualTokens(node.colon, other.colon) && |
2038 isEqualNodes(node.elseExpression, other.elseExpression); | 2054 isEqualNodes(node.elseExpression, other.elseExpression); |
2039 } | 2055 } |
2040 | 2056 |
2041 @override | 2057 @override |
2058 bool visitConfiguration(Configuration node) { | |
2059 Configuration other = _other as Configuration; | |
2060 return isEqualTokens(node.ifKeyword, other.ifKeyword) && | |
2061 isEqualTokens(node.leftParenthesis, other.leftParenthesis) && | |
2062 isEqualNodes(node.name, other.name) && | |
2063 isEqualTokens(node.equalToken, other.equalToken) && | |
2064 isEqualNodes(node.value, other.value) && | |
2065 isEqualTokens(node.rightParenthesis, other.rightParenthesis) && | |
2066 isEqualNodes(node.libraryUri, other.libraryUri); | |
2067 } | |
2068 | |
2069 @override | |
2042 bool visitConstructorDeclaration(ConstructorDeclaration node) { | 2070 bool visitConstructorDeclaration(ConstructorDeclaration node) { |
2043 ConstructorDeclaration other = _other as ConstructorDeclaration; | 2071 ConstructorDeclaration other = _other as ConstructorDeclaration; |
2044 return isEqualNodes( | 2072 return isEqualNodes( |
2045 node.documentationComment, other.documentationComment) && | 2073 node.documentationComment, other.documentationComment) && |
2046 _isEqualNodeLists(node.metadata, other.metadata) && | 2074 _isEqualNodeLists(node.metadata, other.metadata) && |
2047 isEqualTokens(node.externalKeyword, other.externalKeyword) && | 2075 isEqualTokens(node.externalKeyword, other.externalKeyword) && |
2048 isEqualTokens(node.constKeyword, other.constKeyword) && | 2076 isEqualTokens(node.constKeyword, other.constKeyword) && |
2049 isEqualTokens(node.factoryKeyword, other.factoryKeyword) && | 2077 isEqualTokens(node.factoryKeyword, other.factoryKeyword) && |
2050 isEqualNodes(node.returnType, other.returnType) && | 2078 isEqualNodes(node.returnType, other.returnType) && |
2051 isEqualTokens(node.period, other.period) && | 2079 isEqualTokens(node.period, other.period) && |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2109 return isEqualTokens(node.doKeyword, other.doKeyword) && | 2137 return isEqualTokens(node.doKeyword, other.doKeyword) && |
2110 isEqualNodes(node.body, other.body) && | 2138 isEqualNodes(node.body, other.body) && |
2111 isEqualTokens(node.whileKeyword, other.whileKeyword) && | 2139 isEqualTokens(node.whileKeyword, other.whileKeyword) && |
2112 isEqualTokens(node.leftParenthesis, other.leftParenthesis) && | 2140 isEqualTokens(node.leftParenthesis, other.leftParenthesis) && |
2113 isEqualNodes(node.condition, other.condition) && | 2141 isEqualNodes(node.condition, other.condition) && |
2114 isEqualTokens(node.rightParenthesis, other.rightParenthesis) && | 2142 isEqualTokens(node.rightParenthesis, other.rightParenthesis) && |
2115 isEqualTokens(node.semicolon, other.semicolon); | 2143 isEqualTokens(node.semicolon, other.semicolon); |
2116 } | 2144 } |
2117 | 2145 |
2118 @override | 2146 @override |
2147 bool visitDottedName(DottedName node) { | |
2148 DottedName other = _other as DottedName; | |
2149 return _isEqualNodeLists(node.components, other.components); | |
2150 } | |
2151 | |
2152 @override | |
2119 bool visitDoubleLiteral(DoubleLiteral node) { | 2153 bool visitDoubleLiteral(DoubleLiteral node) { |
2120 DoubleLiteral other = _other as DoubleLiteral; | 2154 DoubleLiteral other = _other as DoubleLiteral; |
2121 return isEqualTokens(node.literal, other.literal) && | 2155 return isEqualTokens(node.literal, other.literal) && |
2122 node.value == other.value; | 2156 node.value == other.value; |
2123 } | 2157 } |
2124 | 2158 |
2125 @override | 2159 @override |
2126 bool visitEmptyFunctionBody(EmptyFunctionBody node) { | 2160 bool visitEmptyFunctionBody(EmptyFunctionBody node) { |
2127 EmptyFunctionBody other = _other as EmptyFunctionBody; | 2161 EmptyFunctionBody other = _other as EmptyFunctionBody; |
2128 return isEqualTokens(node.semicolon, other.semicolon); | 2162 return isEqualTokens(node.semicolon, other.semicolon); |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3134 R visitClassTypeAlias(ClassTypeAlias node); | 3168 R visitClassTypeAlias(ClassTypeAlias node); |
3135 | 3169 |
3136 R visitComment(Comment node); | 3170 R visitComment(Comment node); |
3137 | 3171 |
3138 R visitCommentReference(CommentReference node); | 3172 R visitCommentReference(CommentReference node); |
3139 | 3173 |
3140 R visitCompilationUnit(CompilationUnit node); | 3174 R visitCompilationUnit(CompilationUnit node); |
3141 | 3175 |
3142 R visitConditionalExpression(ConditionalExpression node); | 3176 R visitConditionalExpression(ConditionalExpression node); |
3143 | 3177 |
3178 R visitConfiguration(Configuration node); | |
3179 | |
3144 R visitConstructorDeclaration(ConstructorDeclaration node); | 3180 R visitConstructorDeclaration(ConstructorDeclaration node); |
3145 | 3181 |
3146 R visitConstructorFieldInitializer(ConstructorFieldInitializer node); | 3182 R visitConstructorFieldInitializer(ConstructorFieldInitializer node); |
3147 | 3183 |
3148 R visitConstructorName(ConstructorName node); | 3184 R visitConstructorName(ConstructorName node); |
3149 | 3185 |
3150 R visitContinueStatement(ContinueStatement node); | 3186 R visitContinueStatement(ContinueStatement node); |
3151 | 3187 |
3152 R visitDeclaredIdentifier(DeclaredIdentifier node); | 3188 R visitDeclaredIdentifier(DeclaredIdentifier node); |
3153 | 3189 |
3154 R visitDefaultFormalParameter(DefaultFormalParameter node); | 3190 R visitDefaultFormalParameter(DefaultFormalParameter node); |
3155 | 3191 |
3156 R visitDoStatement(DoStatement node); | 3192 R visitDoStatement(DoStatement node); |
3157 | 3193 |
3194 R visitDottedName(DottedName node); | |
3195 | |
3158 R visitDoubleLiteral(DoubleLiteral node); | 3196 R visitDoubleLiteral(DoubleLiteral node); |
3159 | 3197 |
3160 R visitEmptyFunctionBody(EmptyFunctionBody node); | 3198 R visitEmptyFunctionBody(EmptyFunctionBody node); |
3161 | 3199 |
3162 R visitEmptyStatement(EmptyStatement node); | 3200 R visitEmptyStatement(EmptyStatement node); |
3163 | 3201 |
3164 R visitEnumConstantDeclaration(EnumConstantDeclaration node); | 3202 R visitEnumConstantDeclaration(EnumConstantDeclaration node); |
3165 | 3203 |
3166 R visitEnumDeclaration(EnumDeclaration node); | 3204 R visitEnumDeclaration(EnumDeclaration node); |
3167 | 3205 |
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5108 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); | 5146 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); |
5109 | 5147 |
5110 @override | 5148 @override |
5111 void visitChildren(AstVisitor visitor) { | 5149 void visitChildren(AstVisitor visitor) { |
5112 _safelyVisitChild(_condition, visitor); | 5150 _safelyVisitChild(_condition, visitor); |
5113 _safelyVisitChild(_thenExpression, visitor); | 5151 _safelyVisitChild(_thenExpression, visitor); |
5114 _safelyVisitChild(_elseExpression, visitor); | 5152 _safelyVisitChild(_elseExpression, visitor); |
5115 } | 5153 } |
5116 } | 5154 } |
5117 | 5155 |
5156 /** | |
5157 * A configuration in either an import or export directive. | |
5158 * | |
5159 * configuration ::= | |
5160 * 'if' '(' test ')' uri | |
5161 * | |
5162 * test ::= | |
5163 * dottedName ('==' stringLiteral)? | |
5164 * | |
5165 * dottedName ::= | |
5166 * identifier ('.' identifier)* | |
5167 */ | |
5168 class Configuration extends AstNode { | |
5169 Token ifKeyword; | |
5170 Token leftParenthesis; | |
5171 DottedName _name; | |
5172 Token equalToken; | |
5173 StringLiteral _value; | |
5174 Token rightParenthesis; | |
5175 StringLiteral _libraryUri; | |
5176 | |
5177 Configuration( | |
5178 this.ifKeyword, | |
5179 this.leftParenthesis, | |
5180 DottedName name, | |
5181 this.equalToken, | |
5182 StringLiteral value, | |
5183 this.rightParenthesis, | |
5184 StringLiteral libraryUri) { | |
5185 _name = _becomeParentOf(name); | |
5186 _value = _becomeParentOf(value); | |
5187 _libraryUri = _becomeParentOf(libraryUri); | |
5188 } | |
5189 | |
5190 @override | |
5191 Token get beginToken => ifKeyword; | |
5192 | |
5193 @override | |
5194 Iterable get childEntities => new ChildEntities() | |
5195 ..add(ifKeyword) | |
5196 ..add(leftParenthesis) | |
5197 ..add(_name) | |
5198 ..add(equalToken) | |
5199 ..add(_value) | |
5200 ..add(rightParenthesis) | |
5201 ..add(_libraryUri); | |
5202 | |
5203 @override | |
5204 Token get endToken => _libraryUri.endToken; | |
5205 | |
5206 StringLiteral get libraryUri => _libraryUri; | |
5207 | |
5208 void set libraryUri(StringLiteral libraryUri) { | |
5209 _libraryUri = _becomeParentOf(libraryUri); | |
5210 } | |
5211 | |
5212 DottedName get name => _name; | |
5213 | |
5214 void set name(DottedName name) { | |
5215 _name = _becomeParentOf(name); | |
5216 } | |
5217 | |
5218 StringLiteral get value => _value; | |
5219 | |
5220 void set value(StringLiteral value) { | |
5221 _value = _becomeParentOf(value); | |
5222 } | |
5223 | |
5224 @override | |
5225 accept(AstVisitor visitor) => visitor.visitConfiguration(this); | |
5226 | |
5227 @override | |
5228 void visitChildren(AstVisitor visitor) { | |
5229 _safelyVisitChild(_name, visitor); | |
5230 _safelyVisitChild(_value, visitor); | |
5231 _safelyVisitChild(_libraryUri, visitor); | |
5232 } | |
5233 } | |
5234 | |
5118 /// Instances of the class [ConstantEvaluator] evaluate constant expressions to | 5235 /// Instances of the class [ConstantEvaluator] evaluate constant expressions to |
5119 /// produce their compile-time value. | 5236 /// produce their compile-time value. |
5120 /// | 5237 /// |
5121 /// According to the Dart Language Specification: | 5238 /// According to the Dart Language Specification: |
5122 /// | 5239 /// |
5123 /// > A constant expression is one of the following: | 5240 /// > A constant expression is one of the following: |
5124 /// > | 5241 /// > |
5125 /// > * A literal number. | 5242 /// > * A literal number. |
5126 /// > * A literal boolean. | 5243 /// > * A literal boolean. |
5127 /// > * A literal string where any interpolated expression is a compile-time | 5244 /// > * A literal string where any interpolated expression is a compile-time |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6442 accept(AstVisitor visitor) => visitor.visitDoStatement(this); | 6559 accept(AstVisitor visitor) => visitor.visitDoStatement(this); |
6443 | 6560 |
6444 @override | 6561 @override |
6445 void visitChildren(AstVisitor visitor) { | 6562 void visitChildren(AstVisitor visitor) { |
6446 _safelyVisitChild(_body, visitor); | 6563 _safelyVisitChild(_body, visitor); |
6447 _safelyVisitChild(_condition, visitor); | 6564 _safelyVisitChild(_condition, visitor); |
6448 } | 6565 } |
6449 } | 6566 } |
6450 | 6567 |
6451 /** | 6568 /** |
6569 * A dotted name, usedd in a configuration within an import or export directive. | |
6570 * | |
6571 * > dottedName ::= | |
6572 * > [SimpleIdentifier] ('.' [SimpleIdentifier])* | |
6573 */ | |
6574 class DottedName extends AstNode { | |
Paul Berry
2015/10/21 17:10:47
This looks almost identical to the definition of L
Brian Wilkerson
2015/10/21 20:05:23
I like the idea of removing LibraryIdentifier. I'l
| |
6575 /** | |
6576 * The components of the identifier. | |
6577 */ | |
6578 NodeList<SimpleIdentifier> _components; | |
6579 | |
6580 /** | |
6581 * Initialize a newly created prefixed identifier. | |
Paul Berry
2015/10/21 17:10:47
s/prefixed identifier/dotted name/
Brian Wilkerson
2015/10/21 20:05:23
Done
| |
6582 */ | |
6583 DottedName(List<SimpleIdentifier> components) { | |
6584 _components = new NodeList<SimpleIdentifier>(this, components); | |
6585 } | |
6586 | |
6587 @override | |
6588 Token get beginToken => _components.beginToken; | |
6589 | |
6590 @override | |
6591 // TODO(paulberry): add "." tokens. | |
6592 Iterable get childEntities => new ChildEntities()..addAll(_components); | |
6593 | |
6594 /** | |
6595 * Return the components of the identifier. | |
6596 */ | |
6597 NodeList<SimpleIdentifier> get components => _components; | |
6598 | |
6599 @override | |
6600 Token get endToken => _components.endToken; | |
6601 | |
6602 @override | |
6603 accept(AstVisitor visitor) => visitor.visitDottedName(this); | |
6604 | |
6605 @override | |
6606 void visitChildren(AstVisitor visitor) { | |
6607 _components.accept(visitor); | |
6608 } | |
6609 } | |
6610 | |
6611 /** | |
6452 * A floating point literal expression. | 6612 * A floating point literal expression. |
6453 * | 6613 * |
6454 * > doubleLiteral ::= | 6614 * > doubleLiteral ::= |
6455 * > decimalDigit+ ('.' decimalDigit*)? exponent? | 6615 * > decimalDigit+ ('.' decimalDigit*)? exponent? |
6456 * > | '.' decimalDigit+ exponent? | 6616 * > | '.' decimalDigit+ exponent? |
6457 * > | 6617 * > |
6458 * > exponent ::= | 6618 * > exponent ::= |
6459 * > ('e' | 'E') ('+' | '-')? decimalDigit+ | 6619 * > ('e' | 'E') ('+' | '-')? decimalDigit+ |
6460 */ | 6620 */ |
6461 class DoubleLiteral extends Literal { | 6621 class DoubleLiteral extends Literal { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6860 * > exportDirective ::= | 7020 * > exportDirective ::= |
6861 * > [Annotation] 'export' [StringLiteral] [Combinator]* ';' | 7021 * > [Annotation] 'export' [StringLiteral] [Combinator]* ';' |
6862 */ | 7022 */ |
6863 class ExportDirective extends NamespaceDirective { | 7023 class ExportDirective extends NamespaceDirective { |
6864 /** | 7024 /** |
6865 * Initialize a newly created export directive. Either or both of the | 7025 * Initialize a newly created export directive. Either or both of the |
6866 * [comment] and [metadata] can be `null` if the directive does not have the | 7026 * [comment] and [metadata] can be `null` if the directive does not have the |
6867 * corresponding attribute. The list of [combinators] can be `null` if there | 7027 * corresponding attribute. The list of [combinators] can be `null` if there |
6868 * are no combinators. | 7028 * are no combinators. |
6869 */ | 7029 */ |
6870 ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, | 7030 ExportDirective( |
6871 StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) | 7031 Comment comment, |
6872 : super(comment, metadata, keyword, libraryUri, combinators, semicolon); | 7032 List<Annotation> metadata, |
7033 Token keyword, | |
7034 StringLiteral libraryUri, | |
7035 List<Configuration> configurations, | |
7036 List<Combinator> combinators, | |
7037 Token semicolon) | |
7038 : super(comment, metadata, keyword, libraryUri, configurations, | |
7039 combinators, semicolon); | |
6873 | 7040 |
6874 @override | 7041 @override |
6875 Iterable get childEntities => super._childEntities | 7042 Iterable get childEntities => super._childEntities |
6876 ..add(_uri) | 7043 ..add(_uri) |
6877 ..addAll(combinators) | 7044 ..addAll(combinators) |
6878 ..add(semicolon); | 7045 ..add(semicolon); |
6879 | 7046 |
6880 @override | 7047 @override |
6881 ExportElement get element => super.element as ExportElement; | 7048 ExportElement get element => super.element as ExportElement; |
6882 | 7049 |
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8871 R visitCompilationUnit(CompilationUnit node) => visitNode(node); | 9038 R visitCompilationUnit(CompilationUnit node) => visitNode(node); |
8872 | 9039 |
8873 R visitCompilationUnitMember(CompilationUnitMember node) => | 9040 R visitCompilationUnitMember(CompilationUnitMember node) => |
8874 visitDeclaration(node); | 9041 visitDeclaration(node); |
8875 | 9042 |
8876 @override | 9043 @override |
8877 R visitConditionalExpression(ConditionalExpression node) => | 9044 R visitConditionalExpression(ConditionalExpression node) => |
8878 visitExpression(node); | 9045 visitExpression(node); |
8879 | 9046 |
8880 @override | 9047 @override |
9048 R visitConfiguration(Configuration node) => visitNode(node); | |
9049 | |
9050 @override | |
8881 R visitConstructorDeclaration(ConstructorDeclaration node) => | 9051 R visitConstructorDeclaration(ConstructorDeclaration node) => |
8882 visitClassMember(node); | 9052 visitClassMember(node); |
8883 | 9053 |
8884 @override | 9054 @override |
8885 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => | 9055 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => |
8886 visitConstructorInitializer(node); | 9056 visitConstructorInitializer(node); |
8887 | 9057 |
8888 R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node); | 9058 R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node); |
8889 | 9059 |
8890 @override | 9060 @override |
(...skipping 10 matching lines...) Expand all Loading... | |
8901 @override | 9071 @override |
8902 R visitDefaultFormalParameter(DefaultFormalParameter node) => | 9072 R visitDefaultFormalParameter(DefaultFormalParameter node) => |
8903 visitFormalParameter(node); | 9073 visitFormalParameter(node); |
8904 | 9074 |
8905 R visitDirective(Directive node) => visitAnnotatedNode(node); | 9075 R visitDirective(Directive node) => visitAnnotatedNode(node); |
8906 | 9076 |
8907 @override | 9077 @override |
8908 R visitDoStatement(DoStatement node) => visitStatement(node); | 9078 R visitDoStatement(DoStatement node) => visitStatement(node); |
8909 | 9079 |
8910 @override | 9080 @override |
9081 R visitDottedName(DottedName node) => visitNode(node); | |
9082 | |
9083 @override | |
8911 R visitDoubleLiteral(DoubleLiteral node) => visitLiteral(node); | 9084 R visitDoubleLiteral(DoubleLiteral node) => visitLiteral(node); |
8912 | 9085 |
8913 @override | 9086 @override |
8914 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitFunctionBody(node); | 9087 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitFunctionBody(node); |
8915 | 9088 |
8916 @override | 9089 @override |
8917 R visitEmptyStatement(EmptyStatement node) => visitStatement(node); | 9090 R visitEmptyStatement(EmptyStatement node) => visitStatement(node); |
8918 | 9091 |
8919 @override | 9092 @override |
8920 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => | 9093 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9639 * corresponding attribute. The [deferredKeyword] can be `null` if the import | 9812 * corresponding attribute. The [deferredKeyword] can be `null` if the import |
9640 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import | 9813 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import |
9641 * does not specify a prefix. The list of [combinators] can be `null` if there | 9814 * does not specify a prefix. The list of [combinators] can be `null` if there |
9642 * are no combinators. | 9815 * are no combinators. |
9643 */ | 9816 */ |
9644 ImportDirective( | 9817 ImportDirective( |
9645 Comment comment, | 9818 Comment comment, |
9646 List<Annotation> metadata, | 9819 List<Annotation> metadata, |
9647 Token keyword, | 9820 Token keyword, |
9648 StringLiteral libraryUri, | 9821 StringLiteral libraryUri, |
9822 List<Configuration> configurations, | |
9649 this.deferredKeyword, | 9823 this.deferredKeyword, |
9650 this.asKeyword, | 9824 this.asKeyword, |
9651 SimpleIdentifier prefix, | 9825 SimpleIdentifier prefix, |
9652 List<Combinator> combinators, | 9826 List<Combinator> combinators, |
9653 Token semicolon) | 9827 Token semicolon) |
9654 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { | 9828 : super(comment, metadata, keyword, libraryUri, configurations, |
9829 combinators, semicolon) { | |
9655 _prefix = _becomeParentOf(prefix); | 9830 _prefix = _becomeParentOf(prefix); |
9656 } | 9831 } |
9657 | 9832 |
9658 /** | 9833 /** |
9659 * The token representing the 'as' token, or `null` if the imported names are | 9834 * The token representing the 'as' token, or `null` if the imported names are |
9660 * not prefixed. | 9835 * not prefixed. |
9661 */ | 9836 */ |
9662 @deprecated // Use "this.asKeyword" | 9837 @deprecated // Use "this.asKeyword" |
9663 Token get asToken => asKeyword; | 9838 Token get asToken => asKeyword; |
9664 | 9839 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9941 _mapToken(node.question), | 10116 _mapToken(node.question), |
9942 _cloneNode(node.thenExpression), | 10117 _cloneNode(node.thenExpression), |
9943 _mapToken(node.colon), | 10118 _mapToken(node.colon), |
9944 _cloneNode(node.elseExpression)); | 10119 _cloneNode(node.elseExpression)); |
9945 copy.propagatedType = node.propagatedType; | 10120 copy.propagatedType = node.propagatedType; |
9946 copy.staticType = node.staticType; | 10121 copy.staticType = node.staticType; |
9947 return copy; | 10122 return copy; |
9948 } | 10123 } |
9949 | 10124 |
9950 @override | 10125 @override |
10126 Configuration visitConfiguration(Configuration node) => new Configuration( | |
10127 _mapToken(node.ifKeyword), | |
10128 _mapToken(node.leftParenthesis), | |
10129 _cloneNode(node.name), | |
10130 _mapToken(node.equalToken), | |
10131 _cloneNode(node.value), | |
10132 _mapToken(node.rightParenthesis), | |
10133 _cloneNode(node.libraryUri)); | |
10134 | |
10135 @override | |
9951 ConstructorDeclaration visitConstructorDeclaration( | 10136 ConstructorDeclaration visitConstructorDeclaration( |
9952 ConstructorDeclaration node) { | 10137 ConstructorDeclaration node) { |
9953 ConstructorDeclaration copy = new ConstructorDeclaration( | 10138 ConstructorDeclaration copy = new ConstructorDeclaration( |
9954 _cloneNode(node.documentationComment), | 10139 _cloneNode(node.documentationComment), |
9955 _cloneNodeList(node.metadata), | 10140 _cloneNodeList(node.metadata), |
9956 _mapToken(node.externalKeyword), | 10141 _mapToken(node.externalKeyword), |
9957 _mapToken(node.constKeyword), | 10142 _mapToken(node.constKeyword), |
9958 _mapToken(node.factoryKeyword), | 10143 _mapToken(node.factoryKeyword), |
9959 _cloneNode(node.returnType), | 10144 _cloneNode(node.returnType), |
9960 _mapToken(node.period), | 10145 _mapToken(node.period), |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10010 DoStatement visitDoStatement(DoStatement node) => new DoStatement( | 10195 DoStatement visitDoStatement(DoStatement node) => new DoStatement( |
10011 _mapToken(node.doKeyword), | 10196 _mapToken(node.doKeyword), |
10012 _cloneNode(node.body), | 10197 _cloneNode(node.body), |
10013 _mapToken(node.whileKeyword), | 10198 _mapToken(node.whileKeyword), |
10014 _mapToken(node.leftParenthesis), | 10199 _mapToken(node.leftParenthesis), |
10015 _cloneNode(node.condition), | 10200 _cloneNode(node.condition), |
10016 _mapToken(node.rightParenthesis), | 10201 _mapToken(node.rightParenthesis), |
10017 _mapToken(node.semicolon)); | 10202 _mapToken(node.semicolon)); |
10018 | 10203 |
10019 @override | 10204 @override |
10205 DottedName visitDottedName(DottedName node) => | |
10206 new DottedName(_cloneNodeList(node.components)); | |
10207 | |
10208 @override | |
10020 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { | 10209 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { |
10021 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); | 10210 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); |
10022 copy.propagatedType = node.propagatedType; | 10211 copy.propagatedType = node.propagatedType; |
10023 copy.staticType = node.staticType; | 10212 copy.staticType = node.staticType; |
10024 return copy; | 10213 return copy; |
10025 } | 10214 } |
10026 | 10215 |
10027 @override | 10216 @override |
10028 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => | 10217 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => |
10029 new EmptyFunctionBody(_mapToken(node.semicolon)); | 10218 new EmptyFunctionBody(_mapToken(node.semicolon)); |
(...skipping 17 matching lines...) Expand all Loading... | |
10047 _cloneNodeList(node.constants), | 10236 _cloneNodeList(node.constants), |
10048 _mapToken(node.rightBracket)); | 10237 _mapToken(node.rightBracket)); |
10049 | 10238 |
10050 @override | 10239 @override |
10051 ExportDirective visitExportDirective(ExportDirective node) { | 10240 ExportDirective visitExportDirective(ExportDirective node) { |
10052 ExportDirective copy = new ExportDirective( | 10241 ExportDirective copy = new ExportDirective( |
10053 _cloneNode(node.documentationComment), | 10242 _cloneNode(node.documentationComment), |
10054 _cloneNodeList(node.metadata), | 10243 _cloneNodeList(node.metadata), |
10055 _mapToken(node.keyword), | 10244 _mapToken(node.keyword), |
10056 _cloneNode(node.uri), | 10245 _cloneNode(node.uri), |
10246 _cloneNodeList(node.configurations), | |
10057 _cloneNodeList(node.combinators), | 10247 _cloneNodeList(node.combinators), |
10058 _mapToken(node.semicolon)); | 10248 _mapToken(node.semicolon)); |
10059 copy.element = node.element; | 10249 copy.element = node.element; |
10060 return copy; | 10250 return copy; |
10061 } | 10251 } |
10062 | 10252 |
10063 @override | 10253 @override |
10064 ExpressionFunctionBody visitExpressionFunctionBody( | 10254 ExpressionFunctionBody visitExpressionFunctionBody( |
10065 ExpressionFunctionBody node) => | 10255 ExpressionFunctionBody node) => |
10066 new ExpressionFunctionBody( | 10256 new ExpressionFunctionBody( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10231 new ImplementsClause( | 10421 new ImplementsClause( |
10232 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); | 10422 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); |
10233 | 10423 |
10234 @override | 10424 @override |
10235 ImportDirective visitImportDirective(ImportDirective node) => | 10425 ImportDirective visitImportDirective(ImportDirective node) => |
10236 new ImportDirective( | 10426 new ImportDirective( |
10237 _cloneNode(node.documentationComment), | 10427 _cloneNode(node.documentationComment), |
10238 _cloneNodeList(node.metadata), | 10428 _cloneNodeList(node.metadata), |
10239 _mapToken(node.keyword), | 10429 _mapToken(node.keyword), |
10240 _cloneNode(node.uri), | 10430 _cloneNode(node.uri), |
10431 _cloneNodeList(node.configurations), | |
10241 _mapToken(node.deferredKeyword), | 10432 _mapToken(node.deferredKeyword), |
10242 _mapToken(node.asKeyword), | 10433 _mapToken(node.asKeyword), |
10243 _cloneNode(node.prefix), | 10434 _cloneNode(node.prefix), |
10244 _cloneNodeList(node.combinators), | 10435 _cloneNodeList(node.combinators), |
10245 _mapToken(node.semicolon)); | 10436 _mapToken(node.semicolon)); |
10246 | 10437 |
10247 @override | 10438 @override |
10248 IndexExpression visitIndexExpression(IndexExpression node) { | 10439 IndexExpression visitIndexExpression(IndexExpression node) { |
10249 Token period = _mapToken(node.period); | 10440 Token period = _mapToken(node.period); |
10250 IndexExpression copy; | 10441 IndexExpression copy; |
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12504 * > [ExportDirective] | 12695 * > [ExportDirective] |
12505 * > | [ImportDirective] | 12696 * > | [ImportDirective] |
12506 */ | 12697 */ |
12507 abstract class NamespaceDirective extends UriBasedDirective { | 12698 abstract class NamespaceDirective extends UriBasedDirective { |
12508 /** | 12699 /** |
12509 * The token representing the 'import' or 'export' keyword. | 12700 * The token representing the 'import' or 'export' keyword. |
12510 */ | 12701 */ |
12511 Token keyword; | 12702 Token keyword; |
12512 | 12703 |
12513 /** | 12704 /** |
12705 * The configurations used to control which library will actually be loaded at | |
12706 * run-time. | |
12707 */ | |
12708 NodeList<Configuration> _configurations; | |
12709 | |
12710 /** | |
12514 * The combinators used to control which names are imported or exported. | 12711 * The combinators used to control which names are imported or exported. |
12515 */ | 12712 */ |
12516 NodeList<Combinator> _combinators; | 12713 NodeList<Combinator> _combinators; |
12517 | 12714 |
12518 /** | 12715 /** |
12519 * The semicolon terminating the directive. | 12716 * The semicolon terminating the directive. |
12520 */ | 12717 */ |
12521 Token semicolon; | 12718 Token semicolon; |
12522 | 12719 |
12523 /** | 12720 /** |
12524 * Initialize a newly created namespace directive. Either or both of the | 12721 * Initialize a newly created namespace directive. Either or both of the |
12525 * [comment] and [metadata] can be `null` if the directive does not have the | 12722 * [comment] and [metadata] can be `null` if the directive does not have the |
12526 * corresponding attribute. The list of [combinators] can be `null` if there | 12723 * corresponding attribute. The list of [combinators] can be `null` if there |
12527 * are no combinators. | 12724 * are no combinators. |
12528 */ | 12725 */ |
12529 NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, | 12726 NamespaceDirective( |
12530 StringLiteral libraryUri, List<Combinator> combinators, this.semicolon) | 12727 Comment comment, |
12728 List<Annotation> metadata, | |
12729 this.keyword, | |
12730 StringLiteral libraryUri, | |
12731 List<Configuration> configurations, | |
12732 List<Combinator> combinators, | |
12733 this.semicolon) | |
12531 : super(comment, metadata, libraryUri) { | 12734 : super(comment, metadata, libraryUri) { |
12735 _configurations = new NodeList<Configuration>(this, configurations); | |
12532 _combinators = new NodeList<Combinator>(this, combinators); | 12736 _combinators = new NodeList<Combinator>(this, combinators); |
12533 } | 12737 } |
12534 | 12738 |
12535 /** | 12739 /** |
12536 * Return the combinators used to control how names are imported or exported. | 12740 * Return the combinators used to control how names are imported or exported. |
12537 */ | 12741 */ |
12538 NodeList<Combinator> get combinators => _combinators; | 12742 NodeList<Combinator> get combinators => _combinators; |
12539 | 12743 |
12744 /** | |
12745 * Return the configurations used to control which library will actually be | |
12746 * loaded at run-time. | |
12747 */ | |
12748 NodeList<Configuration> get configurations => _configurations; | |
12749 | |
12540 @override | 12750 @override |
12541 Token get endToken => semicolon; | 12751 Token get endToken => semicolon; |
12542 | 12752 |
12543 @override | 12753 @override |
12544 Token get firstTokenAfterCommentAndMetadata => keyword; | 12754 Token get firstTokenAfterCommentAndMetadata => keyword; |
12545 | 12755 |
12546 @override | 12756 @override |
12547 LibraryElement get uriElement; | 12757 LibraryElement get uriElement; |
12548 } | 12758 } |
12549 | 12759 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13207 node.thenExpression = _newNode as Expression; | 13417 node.thenExpression = _newNode as Expression; |
13208 return true; | 13418 return true; |
13209 } else if (identical(node.elseExpression, _oldNode)) { | 13419 } else if (identical(node.elseExpression, _oldNode)) { |
13210 node.elseExpression = _newNode as Expression; | 13420 node.elseExpression = _newNode as Expression; |
13211 return true; | 13421 return true; |
13212 } | 13422 } |
13213 return visitNode(node); | 13423 return visitNode(node); |
13214 } | 13424 } |
13215 | 13425 |
13216 @override | 13426 @override |
13427 bool visitConfiguration(Configuration node) { | |
13428 if (identical(node.name, _oldNode)) { | |
13429 node.name = _newNode as DottedName; | |
13430 return true; | |
13431 } else if (identical(node.value, _oldNode)) { | |
13432 node.value = _newNode as StringLiteral; | |
13433 return true; | |
13434 } else if (identical(node.libraryUri, _oldNode)) { | |
13435 node.libraryUri = _newNode as StringLiteral; | |
13436 return true; | |
13437 } | |
13438 return visitNode(node); | |
13439 } | |
13440 | |
13441 @override | |
13217 bool visitConstructorDeclaration(ConstructorDeclaration node) { | 13442 bool visitConstructorDeclaration(ConstructorDeclaration node) { |
13218 if (identical(node.returnType, _oldNode)) { | 13443 if (identical(node.returnType, _oldNode)) { |
13219 node.returnType = _newNode as Identifier; | 13444 node.returnType = _newNode as Identifier; |
13220 return true; | 13445 return true; |
13221 } else if (identical(node.name, _oldNode)) { | 13446 } else if (identical(node.name, _oldNode)) { |
13222 node.name = _newNode as SimpleIdentifier; | 13447 node.name = _newNode as SimpleIdentifier; |
13223 return true; | 13448 return true; |
13224 } else if (identical(node.parameters, _oldNode)) { | 13449 } else if (identical(node.parameters, _oldNode)) { |
13225 node.parameters = _newNode as FormalParameterList; | 13450 node.parameters = _newNode as FormalParameterList; |
13226 return true; | 13451 return true; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13299 node.body = _newNode as Statement; | 13524 node.body = _newNode as Statement; |
13300 return true; | 13525 return true; |
13301 } else if (identical(node.condition, _oldNode)) { | 13526 } else if (identical(node.condition, _oldNode)) { |
13302 node.condition = _newNode as Expression; | 13527 node.condition = _newNode as Expression; |
13303 return true; | 13528 return true; |
13304 } | 13529 } |
13305 return visitNode(node); | 13530 return visitNode(node); |
13306 } | 13531 } |
13307 | 13532 |
13308 @override | 13533 @override |
13534 bool visitDottedName(DottedName node) { | |
13535 if (_replaceInList(node.components)) { | |
13536 return true; | |
13537 } | |
13538 return visitNode(node); | |
13539 } | |
13540 | |
13541 @override | |
13309 bool visitDoubleLiteral(DoubleLiteral node) => visitNode(node); | 13542 bool visitDoubleLiteral(DoubleLiteral node) => visitNode(node); |
13310 | 13543 |
13311 @override | 13544 @override |
13312 bool visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); | 13545 bool visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); |
13313 | 13546 |
13314 @override | 13547 @override |
13315 bool visitEmptyStatement(EmptyStatement node) => visitNode(node); | 13548 bool visitEmptyStatement(EmptyStatement node) => visitNode(node); |
13316 | 13549 |
13317 @override | 13550 @override |
13318 bool visitEnumConstantDeclaration(EnumConstantDeclaration node) { | 13551 bool visitEnumConstantDeclaration(EnumConstantDeclaration node) { |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15182 return null; | 15415 return null; |
15183 } | 15416 } |
15184 | 15417 |
15185 @override | 15418 @override |
15186 R visitConditionalExpression(ConditionalExpression node) { | 15419 R visitConditionalExpression(ConditionalExpression node) { |
15187 node.visitChildren(this); | 15420 node.visitChildren(this); |
15188 return null; | 15421 return null; |
15189 } | 15422 } |
15190 | 15423 |
15191 @override | 15424 @override |
15425 R visitConfiguration(Configuration node) { | |
15426 node.visitChildren(this); | |
15427 return null; | |
15428 } | |
15429 | |
15430 @override | |
15192 R visitConstructorDeclaration(ConstructorDeclaration node) { | 15431 R visitConstructorDeclaration(ConstructorDeclaration node) { |
15193 node.visitChildren(this); | 15432 node.visitChildren(this); |
15194 return null; | 15433 return null; |
15195 } | 15434 } |
15196 | 15435 |
15197 @override | 15436 @override |
15198 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) { | 15437 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) { |
15199 node.visitChildren(this); | 15438 node.visitChildren(this); |
15200 return null; | 15439 return null; |
15201 } | 15440 } |
(...skipping 22 matching lines...) Expand all Loading... | |
15224 return null; | 15463 return null; |
15225 } | 15464 } |
15226 | 15465 |
15227 @override | 15466 @override |
15228 R visitDoStatement(DoStatement node) { | 15467 R visitDoStatement(DoStatement node) { |
15229 node.visitChildren(this); | 15468 node.visitChildren(this); |
15230 return null; | 15469 return null; |
15231 } | 15470 } |
15232 | 15471 |
15233 @override | 15472 @override |
15473 R visitDottedName(DottedName node) { | |
15474 node.visitChildren(this); | |
15475 return null; | |
15476 } | |
15477 | |
15478 @override | |
15234 R visitDoubleLiteral(DoubleLiteral node) { | 15479 R visitDoubleLiteral(DoubleLiteral node) { |
15235 node.visitChildren(this); | 15480 node.visitChildren(this); |
15236 return null; | 15481 return null; |
15237 } | 15482 } |
15238 | 15483 |
15239 @override | 15484 @override |
15240 R visitEmptyFunctionBody(EmptyFunctionBody node) { | 15485 R visitEmptyFunctionBody(EmptyFunctionBody node) { |
15241 node.visitChildren(this); | 15486 node.visitChildren(this); |
15242 return null; | 15487 return null; |
15243 } | 15488 } |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16273 @override | 16518 @override |
16274 R visitCommentReference(CommentReference node) => null; | 16519 R visitCommentReference(CommentReference node) => null; |
16275 | 16520 |
16276 @override | 16521 @override |
16277 R visitCompilationUnit(CompilationUnit node) => null; | 16522 R visitCompilationUnit(CompilationUnit node) => null; |
16278 | 16523 |
16279 @override | 16524 @override |
16280 R visitConditionalExpression(ConditionalExpression node) => null; | 16525 R visitConditionalExpression(ConditionalExpression node) => null; |
16281 | 16526 |
16282 @override | 16527 @override |
16528 R visitConfiguration(Configuration node) => null; | |
16529 | |
16530 @override | |
16283 R visitConstructorDeclaration(ConstructorDeclaration node) => null; | 16531 R visitConstructorDeclaration(ConstructorDeclaration node) => null; |
16284 | 16532 |
16285 @override | 16533 @override |
16286 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => null; | 16534 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => null; |
16287 | 16535 |
16288 @override | 16536 @override |
16289 R visitConstructorName(ConstructorName node) => null; | 16537 R visitConstructorName(ConstructorName node) => null; |
16290 | 16538 |
16291 @override | 16539 @override |
16292 R visitContinueStatement(ContinueStatement node) => null; | 16540 R visitContinueStatement(ContinueStatement node) => null; |
16293 | 16541 |
16294 @override | 16542 @override |
16295 R visitDeclaredIdentifier(DeclaredIdentifier node) => null; | 16543 R visitDeclaredIdentifier(DeclaredIdentifier node) => null; |
16296 | 16544 |
16297 @override | 16545 @override |
16298 R visitDefaultFormalParameter(DefaultFormalParameter node) => null; | 16546 R visitDefaultFormalParameter(DefaultFormalParameter node) => null; |
16299 | 16547 |
16300 @override | 16548 @override |
16301 R visitDoStatement(DoStatement node) => null; | 16549 R visitDoStatement(DoStatement node) => null; |
16302 | 16550 |
16303 @override | 16551 @override |
16552 R visitDottedName(DottedName node) => null; | |
16553 | |
16554 @override | |
16304 R visitDoubleLiteral(DoubleLiteral node) => null; | 16555 R visitDoubleLiteral(DoubleLiteral node) => null; |
16305 | 16556 |
16306 @override | 16557 @override |
16307 R visitEmptyFunctionBody(EmptyFunctionBody node) => null; | 16558 R visitEmptyFunctionBody(EmptyFunctionBody node) => null; |
16308 | 16559 |
16309 @override | 16560 @override |
16310 R visitEmptyStatement(EmptyStatement node) => null; | 16561 R visitEmptyStatement(EmptyStatement node) => null; |
16311 | 16562 |
16312 @override | 16563 @override |
16313 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => null; | 16564 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => null; |
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
18184 Object visitConditionalExpression(ConditionalExpression node) { | 18435 Object visitConditionalExpression(ConditionalExpression node) { |
18185 _visitNode(node.condition); | 18436 _visitNode(node.condition); |
18186 _writer.print(" ? "); | 18437 _writer.print(" ? "); |
18187 _visitNode(node.thenExpression); | 18438 _visitNode(node.thenExpression); |
18188 _writer.print(" : "); | 18439 _writer.print(" : "); |
18189 _visitNode(node.elseExpression); | 18440 _visitNode(node.elseExpression); |
18190 return null; | 18441 return null; |
18191 } | 18442 } |
18192 | 18443 |
18193 @override | 18444 @override |
18445 Object visitConfiguration(Configuration node) { | |
18446 _writer.print('if ('); | |
18447 _visitNode(node.name); | |
18448 _visitNodeWithPrefix(" == ", node.value); | |
18449 _writer.print(') '); | |
18450 _visitNode(node.libraryUri); | |
18451 return null; | |
18452 } | |
18453 | |
18454 @override | |
18194 Object visitConstructorDeclaration(ConstructorDeclaration node) { | 18455 Object visitConstructorDeclaration(ConstructorDeclaration node) { |
18195 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); | 18456 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); |
18196 _visitTokenWithSuffix(node.externalKeyword, " "); | 18457 _visitTokenWithSuffix(node.externalKeyword, " "); |
18197 _visitTokenWithSuffix(node.constKeyword, " "); | 18458 _visitTokenWithSuffix(node.constKeyword, " "); |
18198 _visitTokenWithSuffix(node.factoryKeyword, " "); | 18459 _visitTokenWithSuffix(node.factoryKeyword, " "); |
18199 _visitNode(node.returnType); | 18460 _visitNode(node.returnType); |
18200 _visitNodeWithPrefix(".", node.name); | 18461 _visitNodeWithPrefix(".", node.name); |
18201 _visitNode(node.parameters); | 18462 _visitNode(node.parameters); |
18202 _visitNodeListWithSeparatorAndPrefix(" : ", node.initializers, ", "); | 18463 _visitNodeListWithSeparatorAndPrefix(" : ", node.initializers, ", "); |
18203 _visitNodeWithPrefix(" = ", node.redirectedConstructor); | 18464 _visitNodeWithPrefix(" = ", node.redirectedConstructor); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
18253 Object visitDoStatement(DoStatement node) { | 18514 Object visitDoStatement(DoStatement node) { |
18254 _writer.print("do "); | 18515 _writer.print("do "); |
18255 _visitNode(node.body); | 18516 _visitNode(node.body); |
18256 _writer.print(" while ("); | 18517 _writer.print(" while ("); |
18257 _visitNode(node.condition); | 18518 _visitNode(node.condition); |
18258 _writer.print(");"); | 18519 _writer.print(");"); |
18259 return null; | 18520 return null; |
18260 } | 18521 } |
18261 | 18522 |
18262 @override | 18523 @override |
18524 Object visitDottedName(DottedName node) { | |
18525 _visitNodeListWithSeparator(node.components, "."); | |
18526 return null; | |
18527 } | |
18528 | |
18529 @override | |
18263 Object visitDoubleLiteral(DoubleLiteral node) { | 18530 Object visitDoubleLiteral(DoubleLiteral node) { |
18264 _writer.print(node.literal.lexeme); | 18531 _writer.print(node.literal.lexeme); |
18265 return null; | 18532 return null; |
18266 } | 18533 } |
18267 | 18534 |
18268 @override | 18535 @override |
18269 Object visitEmptyFunctionBody(EmptyFunctionBody node) { | 18536 Object visitEmptyFunctionBody(EmptyFunctionBody node) { |
18270 _writer.print(';'); | 18537 _writer.print(';'); |
18271 return null; | 18538 return null; |
18272 } | 18539 } |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19711 @override | 19978 @override |
19712 R visitCommentReference(CommentReference node) => visitNode(node); | 19979 R visitCommentReference(CommentReference node) => visitNode(node); |
19713 | 19980 |
19714 @override | 19981 @override |
19715 R visitCompilationUnit(CompilationUnit node) => visitNode(node); | 19982 R visitCompilationUnit(CompilationUnit node) => visitNode(node); |
19716 | 19983 |
19717 @override | 19984 @override |
19718 R visitConditionalExpression(ConditionalExpression node) => visitNode(node); | 19985 R visitConditionalExpression(ConditionalExpression node) => visitNode(node); |
19719 | 19986 |
19720 @override | 19987 @override |
19988 R visitConfiguration(Configuration node) => visitNode(node); | |
19989 | |
19990 @override | |
19721 R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node); | 19991 R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node); |
19722 | 19992 |
19723 @override | 19993 @override |
19724 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => | 19994 R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => |
19725 visitNode(node); | 19995 visitNode(node); |
19726 | 19996 |
19727 @override | 19997 @override |
19728 R visitConstructorName(ConstructorName node) => visitNode(node); | 19998 R visitConstructorName(ConstructorName node) => visitNode(node); |
19729 | 19999 |
19730 @override | 20000 @override |
19731 R visitContinueStatement(ContinueStatement node) => visitNode(node); | 20001 R visitContinueStatement(ContinueStatement node) => visitNode(node); |
19732 | 20002 |
19733 @override | 20003 @override |
19734 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitNode(node); | 20004 R visitDeclaredIdentifier(DeclaredIdentifier node) => visitNode(node); |
19735 | 20005 |
19736 @override | 20006 @override |
19737 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitNode(node); | 20007 R visitDefaultFormalParameter(DefaultFormalParameter node) => visitNode(node); |
19738 | 20008 |
19739 @override | 20009 @override |
19740 R visitDoStatement(DoStatement node) => visitNode(node); | 20010 R visitDoStatement(DoStatement node) => visitNode(node); |
19741 | 20011 |
19742 @override | 20012 @override |
20013 R visitDottedName(DottedName node) => visitNode(node); | |
20014 | |
20015 @override | |
19743 R visitDoubleLiteral(DoubleLiteral node) => visitNode(node); | 20016 R visitDoubleLiteral(DoubleLiteral node) => visitNode(node); |
19744 | 20017 |
19745 @override | 20018 @override |
19746 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); | 20019 R visitEmptyFunctionBody(EmptyFunctionBody node) => visitNode(node); |
19747 | 20020 |
19748 @override | 20021 @override |
19749 R visitEmptyStatement(EmptyStatement node) => visitNode(node); | 20022 R visitEmptyStatement(EmptyStatement node) => visitNode(node); |
19750 | 20023 |
19751 @override | 20024 @override |
19752 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => | 20025 R visitEnumConstantDeclaration(EnumConstantDeclaration node) => |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20647 } | 20920 } |
20648 | 20921 |
20649 @override | 20922 @override |
20650 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 20923 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
20651 | 20924 |
20652 @override | 20925 @override |
20653 void visitChildren(AstVisitor visitor) { | 20926 void visitChildren(AstVisitor visitor) { |
20654 _safelyVisitChild(_expression, visitor); | 20927 _safelyVisitChild(_expression, visitor); |
20655 } | 20928 } |
20656 } | 20929 } |
OLD | NEW |