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

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

Issue 1033333003: improve parser recovery for incomplete prefixed identifier in method/function parameter list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 12ba5b4d310f93ea8cbb69826beb40f143892274..b21fbee49142904bb5f2aa76a4563276d6326050 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -7154,6 +7154,44 @@ void''');
expect(parameterList.rightParenthesis, isNotNull);
}
+ void test_parseFormalParameterList_prefixedType() {
+ FormalParameterList parameterList =
+ parse4("parseFormalParameterList", "(io.File f)");
+ expect(parameterList.leftParenthesis, isNotNull);
+ expect(parameterList.leftDelimiter, isNull);
+ expect(parameterList.parameters, hasLength(1));
+ expect(parameterList.parameters[0].toSource(), 'io.File f');
+ expect(parameterList.rightDelimiter, isNull);
+ expect(parameterList.rightParenthesis, isNotNull);
+ }
+
+ void test_parseFormalParameterList_prefixedType_partial() {
+ FormalParameterList parameterList =
+ parse4("parseFormalParameterList", "(io.)", [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_IDENTIFIER]);
+ expect(parameterList.leftParenthesis, isNotNull);
+ expect(parameterList.leftDelimiter, isNull);
+ expect(parameterList.parameters, hasLength(1));
+ expect(parameterList.parameters[0].toSource(), 'io. ');
+ expect(parameterList.rightDelimiter, isNull);
+ expect(parameterList.rightParenthesis, isNotNull);
+ }
+
+ void test_parseFormalParameterList_prefixedType_partial2() {
+ FormalParameterList parameterList =
+ parse4("parseFormalParameterList", "(io.,a)", [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_IDENTIFIER]);
+ expect(parameterList.leftParenthesis, isNotNull);
+ expect(parameterList.leftDelimiter, isNull);
+ expect(parameterList.parameters, hasLength(2));
+ expect(parameterList.parameters[0].toSource(), 'io. ');
+ expect(parameterList.parameters[1].toSource(), 'a');
+ expect(parameterList.rightDelimiter, isNull);
+ expect(parameterList.rightParenthesis, isNotNull);
+ }
+
void test_parseForStatement_each_await() {
ForEachStatement statement =
parse4("parseForStatement", "await for (element in list) {}");
« 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