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 analyzer.src.dart.ast.utilities; | 5 library analyzer.src.dart.ast.utilities; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 astFactory.expressionStatement( | 425 astFactory.expressionStatement( |
426 cloneNode(node.expression), cloneToken(node.semicolon)); | 426 cloneNode(node.expression), cloneToken(node.semicolon)); |
427 | 427 |
428 @override | 428 @override |
429 ExtendsClause visitExtendsClause(ExtendsClause node) => | 429 ExtendsClause visitExtendsClause(ExtendsClause node) => |
430 astFactory.extendsClause( | 430 astFactory.extendsClause( |
431 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); | 431 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); |
432 | 432 |
433 @override | 433 @override |
434 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => | 434 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => |
435 astFactory.fieldDeclaration( | 435 astFactory.fieldDeclaration2( |
436 cloneNode(node.documentationComment), | 436 comment: cloneNode(node.documentationComment), |
437 cloneNodeList(node.metadata), | 437 metadata: cloneNodeList(node.metadata), |
438 cloneToken(node.staticKeyword), | 438 covariantKeyword: cloneToken(node.covariantKeyword), |
439 cloneNode(node.fields), | 439 staticKeyword: cloneToken(node.staticKeyword), |
440 cloneToken(node.semicolon)); | 440 fieldList: cloneNode(node.fields), |
| 441 semicolon: cloneToken(node.semicolon)); |
441 | 442 |
442 @override | 443 @override |
443 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => | 444 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => |
444 astFactory.fieldFormalParameter2( | 445 astFactory.fieldFormalParameter2( |
445 comment: cloneNode(node.documentationComment), | 446 comment: cloneNode(node.documentationComment), |
446 metadata: cloneNodeList(node.metadata), | 447 metadata: cloneNodeList(node.metadata), |
447 covariantKeyword: cloneToken(node.covariantKeyword), | 448 covariantKeyword: cloneToken(node.covariantKeyword), |
448 keyword: cloneToken(node.keyword), | 449 keyword: cloneToken(node.keyword), |
449 type: cloneNode(node.type), | 450 type: cloneNode(node.type), |
450 thisKeyword: cloneToken(node.thisKeyword), | 451 thisKeyword: cloneToken(node.thisKeyword), |
(...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3164 astFactory.expressionStatement( | 3165 astFactory.expressionStatement( |
3165 _cloneNode(node.expression), _mapToken(node.semicolon)); | 3166 _cloneNode(node.expression), _mapToken(node.semicolon)); |
3166 | 3167 |
3167 @override | 3168 @override |
3168 ExtendsClause visitExtendsClause(ExtendsClause node) => | 3169 ExtendsClause visitExtendsClause(ExtendsClause node) => |
3169 astFactory.extendsClause( | 3170 astFactory.extendsClause( |
3170 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); | 3171 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); |
3171 | 3172 |
3172 @override | 3173 @override |
3173 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => | 3174 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => |
3174 astFactory.fieldDeclaration( | 3175 astFactory.fieldDeclaration2( |
3175 _cloneNode(node.documentationComment), | 3176 comment: _cloneNode(node.documentationComment), |
3176 _cloneNodeList(node.metadata), | 3177 metadata: _cloneNodeList(node.metadata), |
3177 _mapToken(node.staticKeyword), | 3178 covariantKeyword: _mapToken(node.covariantKeyword), |
3178 _cloneNode(node.fields), | 3179 staticKeyword: _mapToken(node.staticKeyword), |
3179 _mapToken(node.semicolon)); | 3180 fieldList: _cloneNode(node.fields), |
| 3181 semicolon: _mapToken(node.semicolon)); |
3180 | 3182 |
3181 @override | 3183 @override |
3182 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => | 3184 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => |
3183 astFactory.fieldFormalParameter2( | 3185 astFactory.fieldFormalParameter2( |
3184 comment: _cloneNode(node.documentationComment), | 3186 comment: _cloneNode(node.documentationComment), |
3185 metadata: _cloneNodeList(node.metadata), | 3187 metadata: _cloneNodeList(node.metadata), |
3186 covariantKeyword: _mapToken(node.covariantKeyword), | 3188 covariantKeyword: _mapToken(node.covariantKeyword), |
3187 keyword: _mapToken(node.keyword), | 3189 keyword: _mapToken(node.keyword), |
3188 type: _cloneNode(node.type), | 3190 type: _cloneNode(node.type), |
3189 thisKeyword: _mapToken(node.thisKeyword), | 3191 thisKeyword: _mapToken(node.thisKeyword), |
(...skipping 6179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9369 if (node.star != null) { | 9371 if (node.star != null) { |
9370 sink.write("yield* "); | 9372 sink.write("yield* "); |
9371 } else { | 9373 } else { |
9372 sink.write("yield "); | 9374 sink.write("yield "); |
9373 } | 9375 } |
9374 safelyVisitNode(node.expression); | 9376 safelyVisitNode(node.expression); |
9375 sink.write(";"); | 9377 sink.write(";"); |
9376 return null; | 9378 return null; |
9377 } | 9379 } |
9378 } | 9380 } |
OLD | NEW |