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

Side by Side Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 2963473004: Generate type variable events before parsing return type. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 @override 771 @override
772 void endFunctionType(Token functionToken, Token semicolon) { 772 void endFunctionType(Token functionToken, Token semicolon) {
773 debugEvent("FunctionType"); 773 debugEvent("FunctionType");
774 FormalParameterList parameters = pop(); 774 FormalParameterList parameters = pop();
775 TypeAnnotation returnType = pop();
775 TypeParameterList typeParameters = pop(); 776 TypeParameterList typeParameters = pop();
776 TypeAnnotation returnType = pop();
777 push(ast.genericFunctionType( 777 push(ast.genericFunctionType(
778 returnType, functionToken, typeParameters, parameters)); 778 returnType, functionToken, typeParameters, parameters));
779 } 779 }
780 780
781 void handleFormalParameterWithoutValue(Token token) { 781 void handleFormalParameterWithoutValue(Token token) {
782 debugEvent("FormalParameterWithoutValue"); 782 debugEvent("FormalParameterWithoutValue");
783 push(NullValue.ParameterDefaultValue); 783 push(NullValue.ParameterDefaultValue);
784 } 784 }
785 785
786 @override 786 @override
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 } else if (identical('var', s)) { 2039 } else if (identical('var', s)) {
2040 finalConstOrVarKeyword = token; 2040 finalConstOrVarKeyword = token;
2041 } else if (identical('covariant', s)) { 2041 } else if (identical('covariant', s)) {
2042 covariantKeyword = token; 2042 covariantKeyword = token;
2043 } else { 2043 } else {
2044 internalError('Unhandled modifier: $s'); 2044 internalError('Unhandled modifier: $s');
2045 } 2045 }
2046 } 2046 }
2047 } 2047 }
2048 } 2048 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698