OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
6 import 'package:analyzer/dart/ast/ast_factory.dart'; | 6 import 'package:analyzer/dart/ast/ast_factory.dart'; |
7 import 'package:analyzer/src/dart/ast/ast.dart'; | 7 import 'package:analyzer/src/dart/ast/ast.dart'; |
8 import 'package:analyzer/src/generated/utilities_dart.dart'; | 8 import 'package:analyzer/src/generated/utilities_dart.dart'; |
9 import 'package:front_end/src/scanner/token.dart'; | 9 import 'package:front_end/src/scanner/token.dart'; |
| 10 import 'package:meta/meta.dart'; |
10 | 11 |
11 /** | 12 /** |
12 * Concrete implementation of [AstFactory] based on the standard AST | 13 * Concrete implementation of [AstFactory] based on the standard AST |
13 * implementation. | 14 * implementation. |
14 */ | 15 */ |
15 class AstFactoryImpl extends AstFactory { | 16 class AstFactoryImpl extends AstFactory { |
16 @override | 17 @override |
17 AdjacentStrings adjacentStrings(List<StringLiteral> strings) => | 18 AdjacentStrings adjacentStrings(List<StringLiteral> strings) => |
18 new AdjacentStringsImpl(strings); | 19 new AdjacentStringsImpl(strings); |
19 | 20 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 FieldFormalParameter fieldFormalParameter( | 367 FieldFormalParameter fieldFormalParameter( |
367 Comment comment, | 368 Comment comment, |
368 List<Annotation> metadata, | 369 List<Annotation> metadata, |
369 Token keyword, | 370 Token keyword, |
370 TypeAnnotation type, | 371 TypeAnnotation type, |
371 Token thisKeyword, | 372 Token thisKeyword, |
372 Token period, | 373 Token period, |
373 SimpleIdentifier identifier, | 374 SimpleIdentifier identifier, |
374 TypeParameterList typeParameters, | 375 TypeParameterList typeParameters, |
375 FormalParameterList parameters) => | 376 FormalParameterList parameters) => |
376 new FieldFormalParameterImpl(comment, metadata, keyword, type, | 377 new FieldFormalParameterImpl(comment, metadata, null, keyword, type, |
377 thisKeyword, period, identifier, typeParameters, parameters); | 378 thisKeyword, period, identifier, typeParameters, parameters); |
378 | 379 |
379 @override | 380 @override |
| 381 FieldFormalParameter fieldFormalParameter2( |
| 382 {Comment comment, |
| 383 List<Annotation> metadata, |
| 384 Token covariantKeyword, |
| 385 Token keyword, |
| 386 TypeAnnotation type, |
| 387 @required Token thisKeyword, |
| 388 @required Token period, |
| 389 @required SimpleIdentifier identifier, |
| 390 TypeParameterList typeParameters, |
| 391 FormalParameterList parameters}) => |
| 392 new FieldFormalParameterImpl(comment, metadata, covariantKeyword, keyword, |
| 393 type, thisKeyword, period, identifier, typeParameters, parameters); |
| 394 |
| 395 @override |
380 ForEachStatement forEachStatementWithDeclaration( | 396 ForEachStatement forEachStatementWithDeclaration( |
381 Token awaitKeyword, | 397 Token awaitKeyword, |
382 Token forKeyword, | 398 Token forKeyword, |
383 Token leftParenthesis, | 399 Token leftParenthesis, |
384 DeclaredIdentifier loopVariable, | 400 DeclaredIdentifier loopVariable, |
385 Token inKeyword, | 401 Token inKeyword, |
386 Expression iterator, | 402 Expression iterator, |
387 Token rightParenthesis, | 403 Token rightParenthesis, |
388 Statement body) => | 404 Statement body) => |
389 new ForEachStatementImpl.withDeclaration( | 405 new ForEachStatementImpl.withDeclaration( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 509 |
494 @override | 510 @override |
495 FunctionTypedFormalParameter functionTypedFormalParameter( | 511 FunctionTypedFormalParameter functionTypedFormalParameter( |
496 Comment comment, | 512 Comment comment, |
497 List<Annotation> metadata, | 513 List<Annotation> metadata, |
498 TypeAnnotation returnType, | 514 TypeAnnotation returnType, |
499 SimpleIdentifier identifier, | 515 SimpleIdentifier identifier, |
500 TypeParameterList typeParameters, | 516 TypeParameterList typeParameters, |
501 FormalParameterList parameters, | 517 FormalParameterList parameters, |
502 {Token question: null}) => | 518 {Token question: null}) => |
503 new FunctionTypedFormalParameterImpl(comment, metadata, returnType, | 519 new FunctionTypedFormalParameterImpl(comment, metadata, null, returnType, |
504 identifier, typeParameters, parameters, question); | 520 identifier, typeParameters, parameters, question); |
505 | 521 |
506 @override | 522 @override |
| 523 FunctionTypedFormalParameter functionTypedFormalParameter2( |
| 524 {Comment comment, |
| 525 List<Annotation> metadata, |
| 526 Token covariantKeyword, |
| 527 TypeAnnotation returnType, |
| 528 @required SimpleIdentifier identifier, |
| 529 TypeParameterList typeParameters, |
| 530 @required FormalParameterList parameters, |
| 531 Token question}) => |
| 532 new FunctionTypedFormalParameterImpl(comment, metadata, covariantKeyword, |
| 533 returnType, identifier, typeParameters, parameters, question); |
| 534 |
| 535 @override |
507 GenericFunctionType genericFunctionType( | 536 GenericFunctionType genericFunctionType( |
508 TypeAnnotation returnType, | 537 TypeAnnotation returnType, |
509 Token functionKeyword, | 538 Token functionKeyword, |
510 TypeParameterList typeParameters, | 539 TypeParameterList typeParameters, |
511 FormalParameterList _parameters) => | 540 FormalParameterList _parameters) => |
512 new GenericFunctionTypeImpl( | 541 new GenericFunctionTypeImpl( |
513 returnType, functionKeyword, typeParameters, _parameters); | 542 returnType, functionKeyword, typeParameters, _parameters); |
514 | 543 |
515 @override | 544 @override |
516 GenericTypeAlias genericTypeAlias( | 545 GenericTypeAlias genericTypeAlias( |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 new ShowCombinatorImpl(keyword, shownNames); | 800 new ShowCombinatorImpl(keyword, shownNames); |
772 | 801 |
773 @override | 802 @override |
774 SimpleFormalParameter simpleFormalParameter( | 803 SimpleFormalParameter simpleFormalParameter( |
775 Comment comment, | 804 Comment comment, |
776 List<Annotation> metadata, | 805 List<Annotation> metadata, |
777 Token keyword, | 806 Token keyword, |
778 TypeAnnotation type, | 807 TypeAnnotation type, |
779 SimpleIdentifier identifier) => | 808 SimpleIdentifier identifier) => |
780 new SimpleFormalParameterImpl( | 809 new SimpleFormalParameterImpl( |
781 comment, metadata, keyword, type, identifier); | 810 comment, metadata, null, keyword, type, identifier); |
| 811 |
| 812 @override |
| 813 SimpleFormalParameter simpleFormalParameter2( |
| 814 {Comment comment, |
| 815 List<Annotation> metadata, |
| 816 Token covariantKeyword, |
| 817 Token keyword, |
| 818 TypeAnnotation type, |
| 819 @required SimpleIdentifier identifier}) => |
| 820 new SimpleFormalParameterImpl( |
| 821 comment, metadata, covariantKeyword, keyword, type, identifier); |
782 | 822 |
783 @override | 823 @override |
784 SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration: false}) { | 824 SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration: false}) { |
785 if (isDeclaration) { | 825 if (isDeclaration) { |
786 return new DeclaredSimpleIdentifier(token); | 826 return new DeclaredSimpleIdentifier(token); |
787 } | 827 } |
788 return new SimpleIdentifierImpl(token); | 828 return new SimpleIdentifierImpl(token); |
789 } | 829 } |
790 | 830 |
791 @override | 831 @override |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 950 |
911 @override | 951 @override |
912 WithClause withClause(Token withKeyword, List<TypeName> mixinTypes) => | 952 WithClause withClause(Token withKeyword, List<TypeName> mixinTypes) => |
913 new WithClauseImpl(withKeyword, mixinTypes); | 953 new WithClauseImpl(withKeyword, mixinTypes); |
914 | 954 |
915 @override | 955 @override |
916 YieldStatement yieldStatement(Token yieldKeyword, Token star, | 956 YieldStatement yieldStatement(Token yieldKeyword, Token star, |
917 Expression expression, Token semicolon) => | 957 Expression expression, Token semicolon) => |
918 new YieldStatementImpl(yieldKeyword, star, expression, semicolon); | 958 new YieldStatementImpl(yieldKeyword, star, expression, semicolon); |
919 } | 959 } |
OLD | NEW |