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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2836983002: Fix exception parsing generic function type syntax (Closed)
Patch Set: Created 3 years, 8 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/standard_ast_factory.dart'; 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
9 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 } 3939 }
3940 3940
3941 void test_topLevelVariable_withMetadata() { 3941 void test_topLevelVariable_withMetadata() {
3942 parseCompilationUnit("String @A string;", [ 3942 parseCompilationUnit("String @A string;", [
3943 ParserErrorCode.MISSING_IDENTIFIER, 3943 ParserErrorCode.MISSING_IDENTIFIER,
3944 ParserErrorCode.EXPECTED_TOKEN, 3944 ParserErrorCode.EXPECTED_TOKEN,
3945 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE 3945 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
3946 ]); 3946 ]);
3947 } 3947 }
3948 3948
3949 void test_typedef_namedFunction() {
3950 // TODO(brianwilkerson) Improve recovery for this case.
3951 parseCompilationUnit('typedef void Function();', [
3952 ParserErrorCode.UNEXPECTED_TOKEN,
3953 ParserErrorCode.MISSING_IDENTIFIER,
3954 ParserErrorCode.EXPECTED_EXECUTABLE,
3955 ParserErrorCode.MISSING_TYPEDEF_PARAMETERS
3956 ]);
3957 }
3958
3949 void test_typedefInClass_withoutReturnType() { 3959 void test_typedefInClass_withoutReturnType() {
3950 parseCompilationUnit( 3960 parseCompilationUnit(
3951 "class C { typedef F(x); }", [ParserErrorCode.TYPEDEF_IN_CLASS]); 3961 "class C { typedef F(x); }", [ParserErrorCode.TYPEDEF_IN_CLASS]);
3952 } 3962 }
3953 3963
3954 void test_typedefInClass_withReturnType() { 3964 void test_typedefInClass_withReturnType() {
3955 parseCompilationUnit("class C { typedef int F(int x); }", 3965 parseCompilationUnit("class C { typedef int F(int x); }",
3956 [ParserErrorCode.TYPEDEF_IN_CLASS]); 3966 [ParserErrorCode.TYPEDEF_IN_CLASS]);
3957 } 3967 }
3958 3968
(...skipping 10987 matching lines...) Expand 10 before | Expand all | Expand 10 after
14946 expectCommentText(typeVariable.documentationComment, '/// Doc'); 14956 expectCommentText(typeVariable.documentationComment, '/// Doc');
14947 } 14957 }
14948 14958
14949 /** 14959 /**
14950 * Assert that the given [name] is in declaration context. 14960 * Assert that the given [name] is in declaration context.
14951 */ 14961 */
14952 void _assertIsDeclarationName(SimpleIdentifier name) { 14962 void _assertIsDeclarationName(SimpleIdentifier name) {
14953 expect(name.inDeclarationContext(), isTrue); 14963 expect(name.inDeclarationContext(), isTrue);
14954 } 14964 }
14955 } 14965 }
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