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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 1025903002: improve parser recovery of type argument list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: cleanup and fix test Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index a89539e14d7406fee3f91691c96b427d4f52b841..4a9c8255e74757f8b02ef1a2a6e8d37759f8105a 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -8766,6 +8766,18 @@ void''');
expect(identifier.name, lexeme);
}
+ void test_parseStatement_emptyTypeArgumentListt() {
+ VariableDeclarationStatement statement = ParserTestCase.parse4(
+ "parseStatement", "C<> c;", [ParserErrorCode.EXPECTED_TYPE_NAME]);
+ VariableDeclarationList variables = statement.variables;
+ TypeName type = variables.type;
+ TypeArgumentList argumentList = type.typeArguments;
+ expect(argumentList.leftBracket, isNotNull);
+ expect(argumentList.arguments, hasLength(1));
+ expect(argumentList.arguments[0].isSynthetic, isTrue);
+ expect(argumentList.rightBracket, isNotNull);
+ }
+
void test_parseStatement_functionDeclaration() {
// TODO(brianwilkerson) Implement more tests for this method.
FunctionDeclarationStatement statement =
@@ -9131,6 +9143,14 @@ void''');
expect(typeAlias.typeParameters, isNull);
}
+ void test_parseTypeArgumentList_empty() {
+ TypeArgumentList argumentList = ParserTestCase.parse4(
+ "parseTypeArgumentList", "<>", [ParserErrorCode.EXPECTED_TYPE_NAME]);
+ expect(argumentList.leftBracket, isNotNull);
+ expect(argumentList.arguments, hasLength(1));
+ expect(argumentList.rightBracket, isNotNull);
+ }
+
void test_parseTypeArgumentList_multiple() {
TypeArgumentList argumentList =
parse4("parseTypeArgumentList", "<int, int, int>");
« 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