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 library fasta.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; | 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 debugEvent("OptionalFormalParameters"); | 761 debugEvent("OptionalFormalParameters"); |
762 push(new _OptionalFormalParameters(popList(count), beginToken, endToken)); | 762 push(new _OptionalFormalParameters(popList(count), beginToken, endToken)); |
763 } | 763 } |
764 | 764 |
765 void handleValuedFormalParameter(Token equals, Token token) { | 765 void handleValuedFormalParameter(Token equals, Token token) { |
766 debugEvent("ValuedFormalParameter"); | 766 debugEvent("ValuedFormalParameter"); |
767 Expression value = pop(); | 767 Expression value = pop(); |
768 push(new _ParameterDefaultValue(equals, value)); | 768 push(new _ParameterDefaultValue(equals, value)); |
769 } | 769 } |
770 | 770 |
771 void handleFunctionType(Token functionToken, Token semicolon) { | 771 @override |
| 772 void endFunctionType(Token functionToken, Token semicolon) { |
772 debugEvent("FunctionType"); | 773 debugEvent("FunctionType"); |
773 FormalParameterList parameters = pop(); | 774 FormalParameterList parameters = pop(); |
774 TypeParameterList typeParameters = pop(); | 775 TypeParameterList typeParameters = pop(); |
775 TypeAnnotation returnType = pop(); | 776 TypeAnnotation returnType = pop(); |
776 push(ast.genericFunctionType( | 777 push(ast.genericFunctionType( |
777 returnType, functionToken, typeParameters, parameters)); | 778 returnType, functionToken, typeParameters, parameters)); |
778 } | 779 } |
779 | 780 |
780 void handleFormalParameterWithoutValue(Token token) { | 781 void handleFormalParameterWithoutValue(Token token) { |
781 debugEvent("FormalParameterWithoutValue"); | 782 debugEvent("FormalParameterWithoutValue"); |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 } else if (identical('var', s)) { | 2039 } else if (identical('var', s)) { |
2039 finalConstOrVarKeyword = token; | 2040 finalConstOrVarKeyword = token; |
2040 } else if (identical('covariant', s)) { | 2041 } else if (identical('covariant', s)) { |
2041 covariantKeyword = token; | 2042 covariantKeyword = token; |
2042 } else { | 2043 } else { |
2043 internalError('Unhandled modifier: $s'); | 2044 internalError('Unhandled modifier: $s'); |
2044 } | 2045 } |
2045 } | 2046 } |
2046 } | 2047 } |
2047 } | 2048 } |
OLD | NEW |