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/test/generated/parser_test.dart

Issue 1674043002: Fix confusion between parameters vs arguments in parser. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | 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) 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.test.generated.parser_test; 5 library analyzer.test.generated.parser_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 7118 matching lines...) Expand 10 before | Expand all | Expand 10 after
7129 } 7129 }
7130 7130
7131 void test_parseCompilationUnitMember_function_generic_noReturnType() { 7131 void test_parseCompilationUnitMember_function_generic_noReturnType() {
7132 enableGenericMethods = true; 7132 enableGenericMethods = true;
7133 FunctionDeclaration declaration = parse("parseCompilationUnitMember", 7133 FunctionDeclaration declaration = parse("parseCompilationUnitMember",
7134 <Object>[emptyCommentAndMetadata()], "f<E>() {}"); 7134 <Object>[emptyCommentAndMetadata()], "f<E>() {}");
7135 expect(declaration.returnType, isNull); 7135 expect(declaration.returnType, isNull);
7136 expect(declaration.functionExpression.typeParameters, isNotNull); 7136 expect(declaration.functionExpression.typeParameters, isNotNull);
7137 } 7137 }
7138 7138
7139 void
7140 test_parseCompilationUnitMember_function_generic_noReturnType_annotated() {
7141 enableGenericMethods = true;
7142 FunctionDeclaration declaration = parse("parseCompilationUnitMember",
7143 <Object>[emptyCommentAndMetadata()], "f<@a E>() {}");
7144 expect(declaration.returnType, isNull);
7145 expect(declaration.functionExpression.typeParameters, isNotNull);
7146 }
7147
7139 void test_parseCompilationUnitMember_function_generic_returnType() { 7148 void test_parseCompilationUnitMember_function_generic_returnType() {
7140 enableGenericMethods = true; 7149 enableGenericMethods = true;
7141 FunctionDeclaration declaration = parse("parseCompilationUnitMember", 7150 FunctionDeclaration declaration = parse("parseCompilationUnitMember",
7142 <Object>[emptyCommentAndMetadata()], "E f<E>() {}"); 7151 <Object>[emptyCommentAndMetadata()], "E f<E>() {}");
7143 expect(declaration.returnType, isNotNull); 7152 expect(declaration.returnType, isNotNull);
7144 expect(declaration.functionExpression.typeParameters, isNotNull); 7153 expect(declaration.functionExpression.typeParameters, isNotNull);
7145 } 7154 }
7146 7155
7147 void test_parseCompilationUnitMember_function_generic_void() { 7156 void test_parseCompilationUnitMember_function_generic_void() {
7148 enableGenericMethods = true; 7157 enableGenericMethods = true;
(...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after
11493 new Scanner(null, new CharSequenceReader(source), listener); 11502 new Scanner(null, new CharSequenceReader(source), listener);
11494 Token tokenStream = scanner.tokenize(); 11503 Token tokenStream = scanner.tokenize();
11495 // 11504 //
11496 // Parse the source. 11505 // Parse the source.
11497 // 11506 //
11498 Parser parser = new Parser(null, listener); 11507 Parser parser = new Parser(null, listener);
11499 return invokeParserMethodImpl( 11508 return invokeParserMethodImpl(
11500 parser, methodName, <Object>[tokenStream], tokenStream) as Token; 11509 parser, methodName, <Object>[tokenStream], tokenStream) as Token;
11501 } 11510 }
11502 } 11511 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698