Version 2.15.0-32.0.dev
Merge commit '7bf731a547b7536d28b108a5676c0aae19a1ff70' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
index 04d8e48..7aa5894 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
@@ -295,11 +295,11 @@
// identifier `?` Function `(`
return new ComplexTypeInfo(token, noTypeParamOrArg)
.computeIdentifierQuestionGFT(required);
- } else if (required || looksLikeNameSimpleType(next)) {
+ } else if (required || looksLikeName(next)) {
// identifier `?`
return simpleNullableType;
}
- } else if (required || looksLikeNameSimpleType(next)) {
+ } else if (required || looksLikeName(next)) {
// identifier identifier
return simpleType;
}
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart
index ca6c45c..899bbd4 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart
@@ -413,14 +413,6 @@
}
bool looksLikeName(Token token) {
- // End-of-file isn't a name, but this is called in a situation where
- // if there had been a name it would have used the type-info it had
- // collected --- this being eof probably mean the user is currently
- // typing and will probably write a name in a moment.
- return looksLikeNameSimpleType(token) || token.isEof;
-}
-
-bool looksLikeNameSimpleType(Token token) {
return token.kind == IDENTIFIER_TOKEN ||
optional('this', token) ||
(token.isIdentifier &&
@@ -430,6 +422,16 @@
(!optional('typedef', token) || !token.next!.isIdentifier));
}
+bool looksLikeNameOrEndOfBlock(Token token) {
+ // End-of-file isn't a name, but this is called in a situation where
+ // if there had been a name it would have used the type-info it had
+ // collected --- this being eof probably mean the user is currently
+ // typing and will probably write a name in a moment.
+ // The same logic applies to "}" which ends for instance a class. Again,
+ // the user is likely typing and will soon write a name.
+ return looksLikeName(token) || token.isEof || optional('}', token);
+}
+
/// When missing a comma, determine if the given token looks like it should
/// be part of a collection of type parameters or arguments.
bool looksLikeTypeParamOrArg(bool inDeclaration, Token token) {
@@ -688,7 +690,9 @@
end = typeArguments.skip(start);
computeRest(end!, required);
- if (!required && !looksLikeName(end!.next!) && gftHasReturnType == null) {
+ if (!required &&
+ !looksLikeNameOrEndOfBlock(end!.next!) &&
+ gftHasReturnType == null) {
return noType;
}
assert(end != null);
diff --git a/pkg/_fe_analyzer_shared/pubspec.yaml b/pkg/_fe_analyzer_shared/pubspec.yaml
index 8b5f6ac..64d60d5 100644
--- a/pkg/_fe_analyzer_shared/pubspec.yaml
+++ b/pkg/_fe_analyzer_shared/pubspec.yaml
@@ -1,5 +1,5 @@
name: _fe_analyzer_shared
-version: 23.0.0
+version: 24.0.0
description: Logic that is shared between the front_end and analyzer packages.
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/_fe_analyzer_shared
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 337ad88..cdaf236 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,4 +1,4 @@
-## 2.1.0-dev
+## 2.1.0
* Changed `AnalysisResult.path` to be non-nullable.
* Changed `ParsedLibraryResult.units` to be non-nullable.
* Changed `ResolvedLibraryResult.element` to be non-nullable.
@@ -14,6 +14,7 @@
* Added `DartType.alias` with information about instantiated type alias.
The type alias element and arguments are present or absent together.
* Deprecated `DartType.aliasElement` and `DartType.aliasArguments`.
+* Updated the current language version to `2.15`.
## 2.0.0
* Removed deprecated `Scope.lookup2()`.
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 4afb0cc..b3749f5 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
name: analyzer
-version: 2.1.0-dev
+version: 2.1.0
description: This package provides a library that performs static analysis of Dart code.
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
@@ -7,7 +7,7 @@
sdk: '>=2.12.0 <3.0.0'
dependencies:
- _fe_analyzer_shared: ^23.0.0
+ _fe_analyzer_shared: ^24.0.0
cli_util: ^0.3.0
collection: ^1.15.0
convert: ^3.0.0
diff --git a/pkg/analyzer/test/generated/error_parser_test.dart b/pkg/analyzer/test/generated/error_parser_test.dart
index e797d732..19a469c 100644
--- a/pkg/analyzer/test/generated/error_parser_test.dart
+++ b/pkg/analyzer/test/generated/error_parser_test.dart
@@ -370,10 +370,9 @@
createParser('class C { C< }');
parser.parseCompilationUnit2();
listener.assertErrors([
- expectedError(ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR, 11, 2),
+ expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 13, 1),
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 13, 1),
- expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1),
- expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 13, 1),
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 13, 1),
]);
}
@@ -381,10 +380,10 @@
createParser('class C { C<@Foo }');
parser.parseCompilationUnit2();
listener.assertErrors([
- expectedError(ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR, 11, 6),
+ expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 12, 4),
+ expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 17, 1),
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 17, 1),
- expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1),
- expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 17, 1)
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 1),
]);
}
@@ -392,10 +391,11 @@
createParser('class C { C<@Foo @Bar() }');
parser.parseCompilationUnit2();
listener.assertErrors([
- expectedError(ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR, 11, 13),
+ expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 12, 4),
+ expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 17, 6),
+ expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 24, 1),
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 24, 1),
- expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1),
- expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 24, 1)
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 24, 1),
]);
}
diff --git a/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart
new file mode 100644
index 0000000..47a1097
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart
@@ -0,0 +1,12 @@
+extension E<T extends num> on List<T> {
+ bool a(int b, int c) {}
+ int get b => 0;
+ set c(int d) {}
+}
+void f(List<int> l) {
+ l.a /* the user is typing here */
+}
+void g(List<int> l) {
+ l.a /* the user is typing here */
+ print(l.b);
+}
\ No newline at end of file
diff --git a/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.expect b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.expect
new file mode 100644
index 0000000..58a0949
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.expect
@@ -0,0 +1,203 @@
+Problems reported:
+
+parser/error_recovery/extension_member_contributor_test_completion:7:5: Expected ';' after this.
+ l.a /* the user is typing here */
+ ^
+
+parser/error_recovery/extension_member_contributor_test_completion:11:3: Expected ';' after this.
+ print(l.b);
+ ^^^^^
+
+beginCompilationUnit(extension)
+ beginMetadataStar(extension)
+ endMetadataStar(0)
+ beginExtensionDeclarationPrelude(extension)
+ beginTypeVariables(<)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ handleIdentifier(T, typeVariableDeclaration)
+ beginTypeVariable(T)
+ handleTypeVariablesDefined(num, 1)
+ handleIdentifier(num, typeReference)
+ handleNoTypeArguments(>)
+ handleType(num, null)
+ endTypeVariable(>, 0, extends, null)
+ endTypeVariables(<, >)
+ beginExtensionDeclaration(extension, E)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(T, typeReference)
+ handleNoTypeArguments(>)
+ handleType(T, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ beginClassOrMixinBody(DeclarationKind.Extension, {)
+ beginMetadataStar(bool)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, a)
+ handleIdentifier(bool, typeReference)
+ handleNoTypeArguments(a)
+ handleType(bool, null)
+ handleIdentifier(a, methodDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.ExtensionNonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(b)
+ handleType(int, null)
+ handleIdentifier(b, formalParameterDeclaration)
+ handleFormalParameterWithoutValue(,)
+ endFormalParameter(null, null, b, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(c)
+ handleType(int, null)
+ handleIdentifier(c, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, c, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ endFormalParameters(2, (, ), MemberKind.ExtensionNonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ endBlockFunctionBody(0, {, })
+ endExtensionMethod(null, bool, (, null, })
+ endMember()
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, get, b)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(get)
+ handleType(int, null)
+ handleIdentifier(b, methodDeclaration)
+ handleNoTypeVariables(=>)
+ handleNoFormalParameters(=>, MemberKind.ExtensionNonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ handleLiteralInt(0)
+ handleExpressionFunctionBody(=>, ;)
+ endExtensionMethod(get, int, =>, null, ;)
+ endMember()
+ beginMetadataStar(set)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, set, c)
+ handleNoType(;)
+ handleIdentifier(c, methodDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.ExtensionNonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(d)
+ handleType(int, null)
+ handleIdentifier(d, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, d, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.ExtensionNonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ endBlockFunctionBody(0, {, })
+ endExtensionMethod(set, set, (, null, })
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Extension, 3, {, })
+ endExtensionDeclaration(extension, null, on, })
+ endTopLevelDeclaration(void)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginTopLevelMember(void)
+ beginTopLevelMethod(}, null)
+ handleVoidKeyword(void)
+ handleIdentifier(f, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(>)
+ handleType(int, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleIdentifier(l, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, l, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(l, expression)
+ handleNoTypeArguments(.)
+ handleNoArguments(.)
+ handleSend(l, .)
+ handleIdentifier(a, expressionContinuation)
+ handleNoTypeArguments(})
+ handleNoArguments(})
+ handleSend(a, })
+ handleEndingBinaryExpression(.)
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endTopLevelMethod(void, null, })
+ endTopLevelDeclaration(void)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginTopLevelMember(void)
+ beginTopLevelMethod(}, null)
+ handleVoidKeyword(void)
+ handleIdentifier(g, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(>)
+ handleType(int, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleIdentifier(l, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, l, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginMetadataStar(l)
+ endMetadataStar(0)
+ handleIdentifier(l, prefixedTypeReference)
+ handleIdentifier(a, typeReferenceContinuation)
+ handleQualified(.)
+ handleNoTypeArguments(print)
+ handleType(l, null)
+ beginVariablesDeclaration(print, null, null)
+ handleIdentifier(print, localVariableDeclaration)
+ beginInitializedIdentifier(print)
+ handleNoVariableInitializer(print)
+ endInitializedIdentifier(print)
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], print, print)
+ endVariablesDeclaration(1, ;)
+ handleIdentifier(l, expression)
+ handleNoTypeArguments(.)
+ handleNoArguments(.)
+ handleSend(l, .)
+ handleIdentifier(b, expressionContinuation)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(b, ))
+ handleEndingBinaryExpression(.)
+ handleParenthesizedExpression(()
+ handleExpressionStatement(;)
+ endBlockFunctionBody(2, {, })
+ endTopLevelMethod(void, null, })
+ endTopLevelDeclaration()
+endCompilationUnit(3, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.intertwined.expect
new file mode 100644
index 0000000..0a0206e
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.intertwined.expect
@@ -0,0 +1,368 @@
+parseUnit(extension)
+ skipErrorTokens(extension)
+ listener: beginCompilationUnit(extension)
+ syntheticPreviousToken(extension)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(extension)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(, extension, Instance of 'DirectiveContext')
+ parseTopLevelKeywordModifiers(, extension)
+ parseExtension(extension)
+ listener: beginExtensionDeclarationPrelude(extension)
+ listener: beginTypeVariables(<)
+ parseMetadataStar(<)
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: handleIdentifier(T, typeVariableDeclaration)
+ listener: beginTypeVariable(T)
+ listener: handleTypeVariablesDefined(num, 1)
+ listener: handleIdentifier(num, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(num, null)
+ listener: endTypeVariable(>, 0, extends, null)
+ listener: endTypeVariables(<, >)
+ listener: beginExtensionDeclaration(extension, E)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(T, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(T, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ parseClassOrMixinOrExtensionBody(>, DeclarationKind.Extension, E)
+ listener: beginClassOrMixinBody(DeclarationKind.Extension, {)
+ notEofOrValue(}, bool)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Extension, E)
+ parseMetadataStar({)
+ listener: beginMetadataStar(bool)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod({, null, null, null, null, null, null, {, Instance of 'SimpleType', null, a, DeclarationKind.Extension, E, false)
+ listener: beginMethod(null, null, null, null, null, a)
+ listener: handleIdentifier(bool, typeReference)
+ listener: handleNoTypeArguments(a)
+ listener: handleType(bool, null)
+ ensureIdentifierPotentiallyRecovered(bool, methodDeclaration, false)
+ listener: handleIdentifier(a, methodDeclaration)
+ parseQualifiedRestOpt(a, methodDeclarationContinuation)
+ parseMethodTypeVar(a)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(a, a, false, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParameters(a, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParametersRest((, MemberKind.ExtensionNonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(b)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(b, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue(,)
+ listener: endFormalParameter(null, null, b, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParameter(,, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ parseMetadataStar(,)
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(c)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(c, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, c, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ listener: endFormalParameters(2, (, ), MemberKind.ExtensionNonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(0, {, })
+ listener: endExtensionMethod(null, bool, (, null, })
+ listener: endMember()
+ notEofOrValue(}, int)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Extension, E)
+ parseMetadataStar(})
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'SimpleType', get, b, DeclarationKind.Extension, E, false)
+ listener: beginMethod(null, null, null, null, get, b)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(get)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(get, methodDeclaration, false)
+ listener: handleIdentifier(b, methodDeclaration)
+ parseQualifiedRestOpt(b, methodDeclarationContinuation)
+ listener: handleNoTypeVariables(=>)
+ parseGetterOrFormalParameters(b, b, true, MemberKind.ExtensionNonStaticMethod)
+ listener: handleNoFormalParameters(=>, MemberKind.ExtensionNonStaticMethod)
+ parseInitializersOpt(b)
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt(b)
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(b, false, true)
+ parseExpressionFunctionBody(=>, false)
+ parseExpression(=>)
+ parsePrecedenceExpression(=>, 1, true)
+ parseUnaryExpression(=>, true)
+ parsePrimary(=>, expression)
+ parseLiteralInt(=>)
+ listener: handleLiteralInt(0)
+ ensureSemicolon(0)
+ listener: handleExpressionFunctionBody(=>, ;)
+ inGenerator()
+ listener: endExtensionMethod(get, int, =>, null, ;)
+ listener: endMember()
+ notEofOrValue(}, set)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Extension, E)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(set)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(;, null, null, null, null, null, null, ;, Instance of 'NoType', set, c, DeclarationKind.Extension, E, false)
+ listener: beginMethod(null, null, null, null, set, c)
+ listener: handleNoType(;)
+ ensureIdentifierPotentiallyRecovered(set, methodDeclaration, false)
+ listener: handleIdentifier(c, methodDeclaration)
+ parseQualifiedRestOpt(c, methodDeclarationContinuation)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(c, c, false, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParameters(c, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParametersRest((, MemberKind.ExtensionNonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.ExtensionNonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.ExtensionNonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(d)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(d, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, d, null, null, FormalParameterKind.mandatory, MemberKind.ExtensionNonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.ExtensionNonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(0, {, })
+ listener: endExtensionMethod(set, set, (, null, })
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Extension, 3, {, })
+ listener: endExtensionDeclaration(extension, null, on, })
+ listener: endTopLevelDeclaration(void)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(void)
+ parseTopLevelMethod(}, null, }, Instance of 'VoidType', null, f, false)
+ listener: beginTopLevelMethod(}, null)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(f, topLevelFunctionDeclaration)
+ parseMethodTypeVar(f)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(f, f, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(f, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(int, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifier(>, formalParameterDeclaration)
+ listener: handleIdentifier(l, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, l, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, l)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(l)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ parseSend({, expression)
+ isNextIdentifier({)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(l, expression)
+ listener: handleNoTypeArguments(.)
+ parseArgumentsOpt(l)
+ listener: handleNoArguments(.)
+ listener: handleSend(l, .)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(a, expressionContinuation)
+ listener: handleNoTypeArguments(})
+ parseArgumentsOpt(a)
+ listener: handleNoArguments(})
+ listener: handleSend(a, })
+ listener: handleEndingBinaryExpression(.)
+ ensureSemicolon(a)
+ reportRecoverableError(a, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
+ rewriter()
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endTopLevelMethod(void, null, })
+ listener: endTopLevelDeclaration(void)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(void)
+ parseTopLevelMethod(}, null, }, Instance of 'VoidType', null, g, false)
+ listener: beginTopLevelMethod(}, null)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(g, topLevelFunctionDeclaration)
+ parseMethodTypeVar(g)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(g, g, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(g, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(int, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifier(>, formalParameterDeclaration)
+ listener: handleIdentifier(l, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, l, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, l)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(print)
+ listener: beginMetadataStar(l)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(l, prefixedTypeReference)
+ listener: handleIdentifier(a, typeReferenceContinuation)
+ listener: handleQualified(.)
+ listener: handleNoTypeArguments(print)
+ listener: handleType(l, null)
+ listener: beginVariablesDeclaration(print, null, null)
+ parseVariablesDeclarationRest(a, true)
+ parseOptionallyInitializedIdentifier(a)
+ ensureIdentifier(a, localVariableDeclaration)
+ listener: handleIdentifier(print, localVariableDeclaration)
+ listener: beginInitializedIdentifier(print)
+ parseVariableInitializerOpt(print)
+ listener: handleNoVariableInitializer(print)
+ listener: endInitializedIdentifier(print)
+ ensureSemicolon(print)
+ reportRecoverableError(print, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], print, print)
+ rewriter()
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, ()
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclaration(;, false)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ looksLikeLocalFunction(()
+ parseExpressionStatement(;)
+ parseExpression(;)
+ parsePrecedenceExpression(;, 1, true)
+ parseUnaryExpression(;, true)
+ parsePrimary(;, expression)
+ parseParenthesizedExpressionOrFunctionLiteral(;)
+ parseParenthesizedExpression(;)
+ parseExpressionInParenthesis(;)
+ parseExpressionInParenthesisRest(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ isNextIdentifier(()
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(l, expression)
+ listener: handleNoTypeArguments(.)
+ parseArgumentsOpt(l)
+ listener: handleNoArguments(.)
+ listener: handleSend(l, .)
+ parsePrimary(., expressionContinuation)
+ parseSendOrFunctionLiteral(., expressionContinuation)
+ parseSend(., expressionContinuation)
+ isNextIdentifier(.)
+ ensureIdentifier(., expressionContinuation)
+ listener: handleIdentifier(b, expressionContinuation)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(b)
+ listener: handleNoArguments())
+ listener: handleSend(b, ))
+ listener: handleEndingBinaryExpression(.)
+ ensureCloseParen(b, ()
+ listener: handleParenthesizedExpression(()
+ ensureSemicolon())
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(2, {, })
+ listener: endTopLevelMethod(void, null, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(extension)
+ listener: endCompilationUnit(3, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.parser.expect
new file mode 100644
index 0000000..74b9c09
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.parser.expect
@@ -0,0 +1,27 @@
+NOTICE: Stream was rewritten by parser!
+
+extension E<T extends num> on List<T> {
+bool a(int b, int c) {}
+int get b => 0;
+set c(int d) {}
+}
+void f(List<int> l) {
+l.a
+;}
+void g(List<int> l) {
+l.a
+print;(l.b);
+}
+
+extension[KeywordToken] E[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] num[StringToken]>[SimpleToken] on[KeywordToken] List[StringToken]<[BeginToken]T[StringToken]>[SimpleToken] {[BeginToken]
+bool[StringToken] a[StringToken]([BeginToken]int[StringToken] b[StringToken],[SimpleToken] int[StringToken] c[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+int[StringToken] get[KeywordToken] b[StringToken] =>[SimpleToken] 0[StringToken];[SimpleToken]
+set[KeywordToken] c[StringToken]([BeginToken]int[StringToken] d[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+}[SimpleToken]
+void[KeywordToken] f[StringToken]([BeginToken]List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] l[StringToken])[SimpleToken] {[BeginToken]
+l[StringToken].[SimpleToken]a[StringToken]
+;[SyntheticToken]}[SimpleToken]
+void[KeywordToken] g[StringToken]([BeginToken]List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] l[StringToken])[SimpleToken] {[BeginToken]
+l[StringToken].[SimpleToken]a[StringToken]
+print[StringToken];[SyntheticToken]([BeginToken]l[StringToken].[SimpleToken]b[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.scanner.expect b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.scanner.expect
new file mode 100644
index 0000000..4b5241f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/extension_member_contributor_test_completion.dart.scanner.expect
@@ -0,0 +1,25 @@
+extension E<T extends num> on List<T> {
+bool a(int b, int c) {}
+int get b => 0;
+set c(int d) {}
+}
+void f(List<int> l) {
+l.a
+}
+void g(List<int> l) {
+l.a
+print(l.b);
+}
+
+extension[KeywordToken] E[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] num[StringToken]>[SimpleToken] on[KeywordToken] List[StringToken]<[BeginToken]T[StringToken]>[SimpleToken] {[BeginToken]
+bool[StringToken] a[StringToken]([BeginToken]int[StringToken] b[StringToken],[SimpleToken] int[StringToken] c[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+int[StringToken] get[KeywordToken] b[StringToken] =>[SimpleToken] 0[StringToken];[SimpleToken]
+set[KeywordToken] c[StringToken]([BeginToken]int[StringToken] d[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+}[SimpleToken]
+void[KeywordToken] f[StringToken]([BeginToken]List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] l[StringToken])[SimpleToken] {[BeginToken]
+l[StringToken].[SimpleToken]a[StringToken]
+}[SimpleToken]
+void[KeywordToken] g[StringToken]([BeginToken]List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] l[StringToken])[SimpleToken] {[BeginToken]
+l[StringToken].[SimpleToken]a[StringToken]
+print[StringToken]([BeginToken]l[StringToken].[SimpleToken]b[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart
new file mode 100644
index 0000000..5273c43
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+// @dart=2.9
+class C {
+ C<
+}
+
+main() {
+ C<
+}
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.expect
new file mode 100644
index 0000000..bf20d7f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.expect
@@ -0,0 +1,84 @@
+Problems reported:
+
+parser/error_recovery/issue_000032:7:1: Expected a type, but got '}'.
+}
+^
+
+parser/error_recovery/issue_000032:7:1: Expected an identifier, but got '}'.
+}
+^
+
+parser/error_recovery/issue_000032:7:1: Expected ';' after this.
+}
+^
+
+parser/error_recovery/issue_000032:11:1: Expected an identifier, but got '}'.
+}
+^
+
+parser/error_recovery/issue_000032:11:1: Expected ';' after this.
+}
+^
+
+beginCompilationUnit(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(C, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, C)
+ handleNoType(C)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(C)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(C, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '}'., null, {lexeme: }}], }, })
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(})
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(C, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, C, ;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration(main)
+ beginMetadataStar(main)
+ endMetadataStar(0)
+ beginTopLevelMember(main)
+ beginTopLevelMethod(}, null)
+ handleNoType(})
+ handleIdentifier(main, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(C, expression)
+ handleNoTypeArguments(<)
+ handleNoArguments(<)
+ handleSend(C, <)
+ beginBinaryExpression(<)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, expression)
+ handleNoTypeArguments(})
+ handleNoArguments(})
+ handleSend(, })
+ endBinaryExpression(<)
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endTopLevelMethod(main, null, })
+ endTopLevelDeclaration()
+endCompilationUnit(2, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.intertwined.expect
new file mode 100644
index 0000000..373d0f43
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.intertwined.expect
@@ -0,0 +1,136 @@
+parseUnit(class)
+ skipErrorTokens(class)
+ listener: beginCompilationUnit(class)
+ syntheticPreviousToken(class)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(C, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, C)
+ parseClass(C, class, class, C)
+ parseClassHeaderOpt(C, class, class)
+ parseClassExtendsOpt(C)
+ listener: handleNoType(C)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(C)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(C)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, C)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, C)
+ parseMetadataStar({)
+ listener: beginMetadataStar(C)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, C)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, C, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(C, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(}, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '}'., null, {lexeme: }}], }, })
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(})
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(C, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ rewriter()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, C)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, C, ;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration(main)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(main)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(main)
+ isReservedKeyword(()
+ parseTopLevelMethod(}, null, }, Instance of 'NoType', null, main, false)
+ listener: beginTopLevelMethod(}, null)
+ listener: handleNoType(})
+ ensureIdentifierPotentiallyRecovered(}, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(main, topLevelFunctionDeclaration)
+ parseMethodTypeVar(main)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(main, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, C)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(C)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ parseSend({, expression)
+ isNextIdentifier({)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(C, expression)
+ listener: handleNoTypeArguments(<)
+ parseArgumentsOpt(C)
+ listener: handleNoArguments(<)
+ listener: handleSend(C, <)
+ listener: beginBinaryExpression(<)
+ parsePrecedenceExpression(<, 9, true)
+ parseUnaryExpression(<, true)
+ parsePrimary(<, expression)
+ parseSend(<, expression)
+ isNextIdentifier(<)
+ ensureIdentifier(<, expression)
+ reportRecoverableErrorWithToken(}, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ rewriter()
+ listener: handleIdentifier(, expression)
+ listener: handleNoTypeArguments(})
+ parseArgumentsOpt()
+ listener: handleNoArguments(})
+ listener: handleSend(, })
+ listener: endBinaryExpression(<)
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endTopLevelMethod(main, null, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(class)
+ listener: endCompilationUnit(2, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.parser.expect
new file mode 100644
index 0000000..ec9179f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.parser.expect
@@ -0,0 +1,19 @@
+NOTICE: Stream was rewritten by parser!
+
+class C {
+C<
+*synthetic*>*synthetic*;}
+
+main() {
+C<
+*synthetic*;}
+
+
+class[KeywordToken] C[StringToken] {[BeginToken]
+C[StringToken]<[BeginToken]
+[SyntheticStringToken]>[SyntheticToken][SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+
+main[StringToken]([BeginToken])[SimpleToken] {[BeginToken]
+C[StringToken]<[BeginToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.scanner.expect b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.scanner.expect
new file mode 100644
index 0000000..e08ff6f
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_000032.dart.scanner.expect
@@ -0,0 +1,17 @@
+class C {
+C<
+}
+
+main() {
+C<
+}
+
+
+class[KeywordToken] C[StringToken] {[BeginToken]
+C[StringToken]<[BeginToken]
+}[SimpleToken]
+
+main[StringToken]([BeginToken])[SimpleToken] {[BeginToken]
+C[StringToken]<[BeginToken]
+}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart
index a7c3e9c..3f047d3 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart
@@ -1,3 +1,7 @@
class A {
Stream<List<>>
-}
\ No newline at end of file
+}
+
+class B {
+ List<>
+}
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.expect
index c0b7186..2708788 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.expect
@@ -1,14 +1,26 @@
Problems reported:
-parser/error_recovery/issue_46505.crash:2:10: Expected '>' after this.
+parser/error_recovery/issue_46505.crash:2:15: Expected a type, but got '>>'.
Stream<List<>>
- ^^^^
+ ^^
-parser/error_recovery/issue_46505.crash:2:3: A method declaration needs an explicit list of parameters.
- Stream<List<>>
- ^^^^^^
+parser/error_recovery/issue_46505.crash:3:1: Expected an identifier, but got '}'.
+}
+^
-parser/error_recovery/issue_46505.crash:3:1: Expected a function body, but got '}'.
+parser/error_recovery/issue_46505.crash:3:1: Expected ';' after this.
+}
+^
+
+parser/error_recovery/issue_46505.crash:6:8: Expected a type, but got '>'.
+ List<>
+ ^
+
+parser/error_recovery/issue_46505.crash:7:1: Expected an identifier, but got '}'.
+}
+^
+
+parser/error_recovery/issue_46505.crash:7:1: Expected ';' after this.
}
^
@@ -28,29 +40,59 @@
beginMetadataStar(Stream)
endMetadataStar(0)
beginMember()
- beginMethod(null, null, null, null, null, Stream)
- handleNoType({)
- handleIdentifier(Stream, methodDeclaration)
- beginTypeVariables(<)
- beginMetadataStar(List)
- endMetadataStar(0)
- handleIdentifier(List, typeVariableDeclaration)
- beginTypeVariable(List)
- handleTypeVariablesDefined(List, 1)
- handleNoType(List)
- endTypeVariable(<, 0, null, null)
- handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- endTypeVariables(<, >)
- handleRecoverableError(MissingMethodParameters, Stream, Stream)
- beginFormalParameters((, MemberKind.NonStaticMethod)
- endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- handleNoInitializers()
- handleAsyncModifier(null, null)
- handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- handleInvalidFunctionBody({)
- endClassMethod(null, Stream, (, null, })
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>'., null, {lexeme: >>}], >>, >>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(B, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, B)
+ handleNoType(B)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>'., null, {lexeme: >}], >, >)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, List, ;)
endMember()
endClassOrMixinBody(DeclarationKind.Class, 1, {, })
endClassDeclaration(class, })
endTopLevelDeclaration()
-endCompilationUnit(1, )
+endCompilationUnit(2, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.intertwined.expect
index c4e4b6a..6698055 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.intertwined.expect
@@ -32,58 +32,104 @@
listener: beginMetadataStar(Stream)
listener: endMetadataStar(0)
listener: beginMember()
- isReservedKeyword(<)
- parseMethod({, null, null, null, null, null, null, {, Instance of 'NoType', null, Stream, DeclarationKind.Class, A, false)
- listener: beginMethod(null, null, null, null, null, Stream)
- listener: handleNoType({)
- ensureIdentifierPotentiallyRecovered({, methodDeclaration, false)
- listener: handleIdentifier(Stream, methodDeclaration)
- parseQualifiedRestOpt(Stream, methodDeclarationContinuation)
- parseMethodTypeVar(Stream)
- listener: beginTypeVariables(<)
- parseMetadataStar(<)
- listener: beginMetadataStar(List)
- listener: endMetadataStar(0)
- ensureIdentifier(<, typeVariableDeclaration)
- listener: handleIdentifier(List, typeVariableDeclaration)
- listener: beginTypeVariable(List)
- listener: handleTypeVariablesDefined(List, 1)
- listener: handleNoType(List)
- listener: endTypeVariable(<, 0, null, null)
- reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableErrorWithToken(>>, Instance of 'Template<(Token) => Message>')
- rewriter()
- listener: endTypeVariables(<, >)
- parseGetterOrFormalParameters(>, Stream, false, MemberKind.NonStaticMethod)
- missingParameterMessage(MemberKind.NonStaticMethod)
- reportRecoverableError(Stream, MissingMethodParameters)
- listener: handleRecoverableError(MissingMethodParameters, Stream, Stream)
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, A)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, A, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>'., null, {lexeme: >>}], >>, >>)
rewriter()
- parseFormalParametersRest((, MemberKind.NonStaticMethod)
- listener: beginFormalParameters((, MemberKind.NonStaticMethod)
- listener: endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- parseInitializersOpt())
- listener: handleNoInitializers()
- parseAsyncModifierOpt())
- listener: handleAsyncModifier(null, null)
- inPlainSync()
- inPlainSync()
- parseFunctionBody(), false, true)
- ensureBlock(), Instance of 'Template<(Token) => Message>', null)
- reportRecoverableError(}, Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}])
- listener: handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- insertBlock())
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
rewriter()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, A)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration(class)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(}, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(}, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(B, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, B)
+ parseClass(B, class, class, B)
+ parseClassHeaderOpt(B, class, class)
+ parseClassExtendsOpt(B)
+ listener: handleNoType(B)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(B)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(B)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, List)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, B)
+ parseMetadataStar({)
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, B)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, B, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>'., null, {lexeme: >}], >, >)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
rewriter()
- listener: handleInvalidFunctionBody({)
- listener: endClassMethod(null, Stream, (, null, })
- listener: endMember()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, B)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, List, ;)
+ listener: endMember()
notEofOrValue(}, })
listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(class)
- listener: endCompilationUnit(1, )
+ listener: endCompilationUnit(2, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.parser.expect
index 3630ae3..549b747 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.parser.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.parser.expect
@@ -2,8 +2,18 @@
class A {
Stream<List<*synthetic*>>
-(){}}
+*synthetic*;}
+
+class B {
+List<*synthetic*>
+*synthetic*;}
+
class[KeywordToken] A[StringToken] {[BeginToken]
Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken][SyntheticStringToken]>[SimpleToken]>[SimpleToken]
-([SyntheticBeginToken])[SyntheticToken]{[SyntheticBeginToken]}[SyntheticToken]}[SimpleToken][SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+
+class[KeywordToken] B[StringToken] {[BeginToken]
+List[StringToken]<[BeginToken][SyntheticStringToken]>[SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.scanner.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.scanner.expect
index 54d49e5..fb64a7c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.scanner.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505.crash_dart.scanner.expect
@@ -2,6 +2,16 @@
Stream<List<>>
}
+class B {
+List<>
+}
+
+
class[KeywordToken] A[StringToken] {[BeginToken]
Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]>>[SimpleToken]
-}[SimpleToken][SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] B[StringToken] {[BeginToken]
+List[StringToken]<[BeginToken]>[SimpleToken]
+}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.expect
index 27d5686..53dc7e8 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.expect
@@ -1,14 +1,14 @@
Problems reported:
-parser/error_recovery/issue_46505_prime_3.crash:2:10: Expected '>' after this.
+parser/error_recovery/issue_46505_prime_3.crash:2:19: Expected a type, but got '>>>'.
Stream<List<Set<>>>
- ^^^^
+ ^^^
-parser/error_recovery/issue_46505_prime_3.crash:2:3: A method declaration needs an explicit list of parameters.
- Stream<List<Set<>>>
- ^^^^^^
+parser/error_recovery/issue_46505_prime_3.crash:3:1: Expected an identifier, but got '}'.
+}
+^
-parser/error_recovery/issue_46505_prime_3.crash:3:1: Expected a function body, but got '}'.
+parser/error_recovery/issue_46505_prime_3.crash:3:1: Expected ';' after this.
}
^
@@ -28,27 +28,28 @@
beginMetadataStar(Stream)
endMetadataStar(0)
beginMember()
- beginMethod(null, null, null, null, null, Stream)
- handleNoType({)
- handleIdentifier(Stream, methodDeclaration)
- beginTypeVariables(<)
- beginMetadataStar(List)
- endMetadataStar(0)
- handleIdentifier(List, typeVariableDeclaration)
- beginTypeVariable(List)
- handleTypeVariablesDefined(List, 1)
- handleNoType(List)
- endTypeVariable(<, 0, null, null)
- handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- endTypeVariables(<, >)
- handleRecoverableError(MissingMethodParameters, Stream, Stream)
- beginFormalParameters((, MemberKind.NonStaticMethod)
- endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- handleNoInitializers()
- handleAsyncModifier(null, null)
- handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- handleInvalidFunctionBody({)
- endClassMethod(null, Stream, (, null, })
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
endMember()
endClassOrMixinBody(DeclarationKind.Class, 1, {, })
endClassDeclaration(class, })
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.intertwined.expect
index 147afbd..c9d687b6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.intertwined.expect
@@ -32,57 +32,44 @@
listener: beginMetadataStar(Stream)
listener: endMetadataStar(0)
listener: beginMember()
- parseMethod({, null, null, null, null, null, null, {, Instance of 'NoType', null, Stream, DeclarationKind.Class, A, false)
- listener: beginMethod(null, null, null, null, null, Stream)
- listener: handleNoType({)
- ensureIdentifierPotentiallyRecovered({, methodDeclaration, false)
- listener: handleIdentifier(Stream, methodDeclaration)
- parseQualifiedRestOpt(Stream, methodDeclarationContinuation)
- parseMethodTypeVar(Stream)
- listener: beginTypeVariables(<)
- parseMetadataStar(<)
- listener: beginMetadataStar(List)
- listener: endMetadataStar(0)
- ensureIdentifier(<, typeVariableDeclaration)
- listener: handleIdentifier(List, typeVariableDeclaration)
- listener: beginTypeVariable(List)
- listener: handleTypeVariablesDefined(List, 1)
- listener: handleNoType(List)
- listener: endTypeVariable(<, 0, null, null)
- reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableError(Set, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
- rewriter()
- listener: endTypeVariables(<, >)
- parseGetterOrFormalParameters(>, Stream, false, MemberKind.NonStaticMethod)
- missingParameterMessage(MemberKind.NonStaticMethod)
- reportRecoverableError(Stream, MissingMethodParameters)
- listener: handleRecoverableError(MissingMethodParameters, Stream, Stream)
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, A)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, A, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
rewriter()
- parseFormalParametersRest((, MemberKind.NonStaticMethod)
- listener: beginFormalParameters((, MemberKind.NonStaticMethod)
- listener: endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- parseInitializersOpt())
- listener: handleNoInitializers()
- parseAsyncModifierOpt())
- listener: handleAsyncModifier(null, null)
- inPlainSync()
- inPlainSync()
- parseFunctionBody(), false, true)
- ensureBlock(), Instance of 'Template<(Token) => Message>', null)
- reportRecoverableError(}, Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}])
- listener: handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- insertBlock())
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
rewriter()
- rewriter()
- listener: handleInvalidFunctionBody({)
- listener: endClassMethod(null, Stream, (, null, })
- listener: endMember()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, A)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
notEofOrValue(}, })
listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.parser.expect
index d529abb..fb4a09d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.parser.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_3.crash_dart.parser.expect
@@ -2,8 +2,8 @@
class A {
Stream<List<Set<*synthetic*>>>
-(){}}
+*synthetic*;}
class[KeywordToken] A[StringToken] {[BeginToken]
Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken][SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
-([SyntheticBeginToken])[SyntheticToken]{[SyntheticBeginToken]}[SyntheticToken]}[SimpleToken][SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.expect
index 1043bd8..f014c6f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.expect
@@ -1,14 +1,14 @@
Problems reported:
-parser/error_recovery/issue_46505_prime_4.crash:2:10: Expected '>' after this.
+parser/error_recovery/issue_46505_prime_4.crash:2:24: Expected a type, but got '>>>'.
Stream<List<Set<List<>>>>
- ^^^^
+ ^^^
-parser/error_recovery/issue_46505_prime_4.crash:2:3: A method declaration needs an explicit list of parameters.
- Stream<List<Set<List<>>>>
- ^^^^^^
+parser/error_recovery/issue_46505_prime_4.crash:3:1: Expected an identifier, but got '}'.
+}
+^
-parser/error_recovery/issue_46505_prime_4.crash:3:1: Expected a function body, but got '}'.
+parser/error_recovery/issue_46505_prime_4.crash:3:1: Expected ';' after this.
}
^
@@ -28,27 +28,32 @@
beginMetadataStar(Stream)
endMetadataStar(0)
beginMember()
- beginMethod(null, null, null, null, null, Stream)
- handleNoType({)
- handleIdentifier(Stream, methodDeclaration)
- beginTypeVariables(<)
- beginMetadataStar(List)
- endMetadataStar(0)
- handleIdentifier(List, typeVariableDeclaration)
- beginTypeVariable(List)
- handleTypeVariablesDefined(List, 1)
- handleNoType(List)
- endTypeVariable(<, 0, null, null)
- handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- endTypeVariables(<, >)
- handleRecoverableError(MissingMethodParameters, Stream, Stream)
- beginFormalParameters((, MemberKind.NonStaticMethod)
- endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- handleNoInitializers()
- handleAsyncModifier(null, null)
- handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- handleInvalidFunctionBody({)
- endClassMethod(null, Stream, (, null, })
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
endMember()
endClassOrMixinBody(DeclarationKind.Class, 1, {, })
endClassDeclaration(class, })
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.intertwined.expect
index 50f23d1..0522558 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.intertwined.expect
@@ -32,60 +32,49 @@
listener: beginMetadataStar(Stream)
listener: endMetadataStar(0)
listener: beginMember()
- parseMethod({, null, null, null, null, null, null, {, Instance of 'NoType', null, Stream, DeclarationKind.Class, A, false)
- listener: beginMethod(null, null, null, null, null, Stream)
- listener: handleNoType({)
- ensureIdentifierPotentiallyRecovered({, methodDeclaration, false)
- listener: handleIdentifier(Stream, methodDeclaration)
- parseQualifiedRestOpt(Stream, methodDeclarationContinuation)
- parseMethodTypeVar(Stream)
- listener: beginTypeVariables(<)
- parseMetadataStar(<)
- listener: beginMetadataStar(List)
- listener: endMetadataStar(0)
- ensureIdentifier(<, typeVariableDeclaration)
- listener: handleIdentifier(List, typeVariableDeclaration)
- listener: beginTypeVariable(List)
- listener: handleTypeVariablesDefined(List, 1)
- listener: handleNoType(List)
- listener: endTypeVariable(<, 0, null, null)
- reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableError(Set, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
- parseMetadataStar(<)
- ensureIdentifier(<, typeVariableDeclaration)
- reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
- rewriter()
- listener: endTypeVariables(<, >)
- parseGetterOrFormalParameters(>, Stream, false, MemberKind.NonStaticMethod)
- missingParameterMessage(MemberKind.NonStaticMethod)
- reportRecoverableError(Stream, MissingMethodParameters)
- listener: handleRecoverableError(MissingMethodParameters, Stream, Stream)
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, A)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, A, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
rewriter()
- parseFormalParametersRest((, MemberKind.NonStaticMethod)
- listener: beginFormalParameters((, MemberKind.NonStaticMethod)
- listener: endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
- parseInitializersOpt())
- listener: handleNoInitializers()
- parseAsyncModifierOpt())
- listener: handleAsyncModifier(null, null)
- inPlainSync()
- inPlainSync()
- parseFunctionBody(), false, true)
- ensureBlock(), Instance of 'Template<(Token) => Message>', null)
- reportRecoverableError(}, Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}])
- listener: handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got '}'., null, {lexeme: }}], }, })
- insertBlock())
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
rewriter()
- rewriter()
- listener: handleInvalidFunctionBody({)
- listener: endClassMethod(null, Stream, (, null, })
- listener: endMember()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, A)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
notEofOrValue(}, })
listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.parser.expect
index e4f75a9..360df8f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.parser.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_4.crash_dart.parser.expect
@@ -2,8 +2,8 @@
class A {
Stream<List<Set<List<*synthetic*>>>>
-(){}}
+*synthetic*;}
class[KeywordToken] A[StringToken] {[BeginToken]
Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken][SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
-([SyntheticBeginToken])[SyntheticToken]{[SyntheticBeginToken]}[SyntheticToken]}[SimpleToken][SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart
new file mode 100644
index 0000000..61c1383
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart
@@ -0,0 +1,32 @@
+class A {
+ // Option #1 --- like the other ones. No identifier after.
+ // The user is in the middle of adding the first field/method in a class.
+ Stream<List<Set<List</* user curser here*/>>>>
+}
+
+class B {
+ Stream<List<Set<List<String>>>> foo;
+ // Option #1 --- like the other ones. No identifier after.
+ // The user is in the middle of adding a field/method at the end of the class.
+ Stream<List<Set<List</* user curser here*/>>>>
+}
+
+class C {
+ Stream<List<Set<List<String>>>> foo;
+ // Option #2 --- there is an identifier after, because
+ // the user is in the middle of adding a field/method between other
+ //fields/methods.
+ Stream<List<Set<List</* user curser here*/>>>>
+ Stream<List<Set<List<String>>>> baz;
+}
+
+// Option #3 --- there is an identifier after, because
+// the user is in the middle of adding a field/method between other
+//fields/methods (top-level this time).
+Stream<List<Set<List</* user curser here*/>>>>
+Stream<List<Set<List<String>>>> baz;
+
+// Option #4 --- there is no identifier after, because
+// the user is in the middle of adding a field/method at the end of file.
+// This is issue #42229.
+Stream<List<Set<List</* user curser here*/>>>>
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.expect
new file mode 100644
index 0000000..6ccea4e
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.expect
@@ -0,0 +1,378 @@
+Problems reported:
+
+parser/error_recovery/issue_46505_prime_5.crash:4:45: Expected a type, but got '>>>'.
+ Stream<List<Set<List</* user curser here*/>>>>
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:5:1: Expected an identifier, but got '}'.
+}
+^
+
+parser/error_recovery/issue_46505_prime_5.crash:5:1: Expected ';' after this.
+}
+^
+
+parser/error_recovery/issue_46505_prime_5.crash:11:45: Expected a type, but got '>>>'.
+ Stream<List<Set<List</* user curser here*/>>>>
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:12:1: Expected an identifier, but got '}'.
+}
+^
+
+parser/error_recovery/issue_46505_prime_5.crash:12:1: Expected ';' after this.
+}
+^
+
+parser/error_recovery/issue_46505_prime_5.crash:19:45: Expected a type, but got '>>>'.
+ Stream<List<Set<List</* user curser here*/>>>>
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:20:10: Expected '>' after this.
+ Stream<List<Set<List<String>>>> baz;
+ ^^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:20:3: A method declaration needs an explicit list of parameters.
+ Stream<List<Set<List<String>>>> baz;
+ ^^^^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:20:35: Expected a function body, but got 'baz'.
+ Stream<List<Set<List<String>>>> baz;
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:20:35: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
+ Stream<List<Set<List<String>>>> baz;
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:26:43: Expected a type, but got '>>>'.
+Stream<List<Set<List</* user curser here*/>>>>
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:27:8: Expected '>' after this.
+Stream<List<Set<List<String>>>> baz;
+ ^^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:27:1: A function declaration needs an explicit list of parameters.
+Stream<List<Set<List<String>>>> baz;
+^^^^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:27:33: Expected a function body, but got 'baz'.
+Stream<List<Set<List<String>>>> baz;
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:27:33: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
+Stream<List<Set<List<String>>>> baz;
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:33:1: Expected an identifier, but got ''.
+
+WARNING: Reporting at eof --- see below for details.
+
+parser/error_recovery/issue_46505_prime_5.crash:32:43: Expected a type, but got '>>>'.
+Stream<List<Set<List</* user curser here*/>>>>
+ ^^^
+
+parser/error_recovery/issue_46505_prime_5.crash:33:1: Expected ';' after this.
+
+WARNING: Reporting at eof --- see below for details.
+
+beginCompilationUnit(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(A, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, A)
+ handleNoType(A)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(B, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, B)
+ handleNoType(B)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(String, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(String, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleIdentifier(foo, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ endMember()
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginMember()
+ beginFields(;)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ handleIdentifier(, fieldDeclaration)
+ handleNoFieldInitializer(})
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 2, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(C, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, C)
+ handleNoType(C)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(String, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(String, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleIdentifier(foo, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ endMember()
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, Stream)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleIdentifier(Stream, methodDeclaration)
+ beginTypeVariables(<)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ handleIdentifier(List, typeVariableDeclaration)
+ beginTypeVariable(List)
+ handleTypeVariablesDefined(List, 1)
+ handleNoType(List)
+ endTypeVariable(<, 0, null, null)
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
+ endTypeVariables(<, >)
+ handleRecoverableError(MissingMethodParameters, Stream, Stream)
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}], baz, baz)
+ handleInvalidFunctionBody({)
+ endClassMethod(null, Stream, (, null, })
+ endMember()
+ beginMetadataStar(baz)
+ endMetadataStar(0)
+ beginMember()
+ beginFields(})
+ handleRecoverableError(MissingConstFinalVarOrType, baz, baz)
+ handleNoType(})
+ handleIdentifier(baz, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, baz, ;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 3, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration(Stream)
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginTopLevelMember(Stream)
+ beginTopLevelMethod(}, null)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleIdentifier(Stream, topLevelFunctionDeclaration)
+ beginTypeVariables(<)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ handleIdentifier(List, typeVariableDeclaration)
+ beginTypeVariable(List)
+ handleTypeVariablesDefined(List, 1)
+ handleNoType(List)
+ endTypeVariable(<, 0, null, null)
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
+ endTypeVariables(<, >)
+ handleRecoverableError(MissingFunctionParameters, Stream, Stream)
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}], baz, baz)
+ handleInvalidFunctionBody({)
+ endTopLevelMethod(Stream, null, })
+ endTopLevelDeclaration(baz)
+ beginMetadataStar(baz)
+ endMetadataStar(0)
+ beginTopLevelMember(baz)
+ beginFields(})
+ handleRecoverableError(MissingConstFinalVarOrType, baz, baz)
+ handleNoType(})
+ handleIdentifier(baz, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, null, null, 1, baz, ;)
+ endTopLevelDeclaration(Stream)
+ beginMetadataStar(Stream)
+ endMetadataStar(0)
+ beginTopLevelMember(Stream)
+ handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ''., Try inserting an identifier before ''., {lexeme: }], , )
+ // WARNING: Reporting at eof for .
+ beginFields(;)
+ handleIdentifier(Stream, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(Set, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Set, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeArguments(1, <, >)
+ handleType(Stream, null)
+ handleIdentifier(, topLevelVariableDeclaration)
+ handleNoFieldInitializer()
+ handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], , )
+ // WARNING: Reporting at eof for .
+ endTopLevelFields(null, null, null, null, null, 1, Stream, ;)
+ endTopLevelDeclaration()
+endCompilationUnit(6, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.intertwined.expect
new file mode 100644
index 0000000..1888ab1
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.intertwined.expect
@@ -0,0 +1,510 @@
+parseUnit(class)
+ skipErrorTokens(class)
+ listener: beginCompilationUnit(class)
+ syntheticPreviousToken(class)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(A, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, A)
+ parseClass(A, class, class, A)
+ parseClassHeaderOpt(A, class, class)
+ parseClassExtendsOpt(A)
+ listener: handleNoType(A)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(A)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(A)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, Stream)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, A)
+ parseMetadataStar({)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(>, {, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, A)
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, A, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ rewriter()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, A)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration(class)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(}, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(}, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(B, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, B)
+ parseClass(B, class, class, B)
+ parseClassHeaderOpt(B, class, class)
+ parseClassExtendsOpt(B)
+ listener: handleNoType(B)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(B)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(B)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, Stream)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, B)
+ parseMetadataStar({)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', foo, DeclarationKind.Class, B, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(String, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(String, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ listener: handleIdentifier(foo, fieldDeclaration)
+ parseFieldInitializerOpt(foo, foo, null, null, null, null, DeclarationKind.Class, B)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
+ notEofOrValue(}, Stream)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, B)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(>, ;, null, null, null, null, null, null, ;, Instance of 'ComplexTypeInfo', null, DeclarationKind.Class, B)
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'ComplexTypeInfo', }, DeclarationKind.Class, B, false)
+ listener: beginFields(;)
+ ensureIdentifier(;, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ insertSyntheticIdentifier(>, fieldDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(}, Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
+ rewriter()
+ listener: handleIdentifier(, fieldDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.Class, B)
+ listener: handleNoFieldInitializer(})
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], }, })
+ rewriter()
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 2, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration(class)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(}, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(}, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(C, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, C)
+ parseClass(C, class, class, C)
+ parseClassHeaderOpt(C, class, class)
+ parseClassExtendsOpt(C)
+ listener: handleNoType(C)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(C)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(C)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, Stream)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, C)
+ parseMetadataStar({)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseFields({, null, null, null, null, null, null, {, Instance of 'ComplexTypeInfo', foo, DeclarationKind.Class, C, false)
+ listener: beginFields({)
+ ensureIdentifier({, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(String, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(String, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ listener: handleIdentifier(foo, fieldDeclaration)
+ parseFieldInitializerOpt(foo, foo, null, null, null, null, DeclarationKind.Class, C)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, Stream, ;)
+ listener: endMember()
+ notEofOrValue(}, Stream)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, C)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(;, null, null, null, null, null, null, ;, Instance of 'ComplexTypeInfo', null, Stream, DeclarationKind.Class, C, false)
+ listener: beginMethod(null, null, null, null, null, Stream)
+ ensureIdentifier(;, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, methodDeclaration, false)
+ listener: handleIdentifier(Stream, methodDeclaration)
+ parseQualifiedRestOpt(Stream, methodDeclarationContinuation)
+ parseMethodTypeVar(Stream)
+ listener: beginTypeVariables(<)
+ parseMetadataStar(<)
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: handleIdentifier(List, typeVariableDeclaration)
+ listener: beginTypeVariable(List)
+ listener: handleTypeVariablesDefined(List, 1)
+ listener: handleNoType(List)
+ listener: endTypeVariable(<, 0, null, null)
+ reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ reportRecoverableError(Set, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: endTypeVariables(<, >)
+ parseGetterOrFormalParameters(>, Stream, false, MemberKind.NonStaticMethod)
+ missingParameterMessage(MemberKind.NonStaticMethod)
+ reportRecoverableError(Stream, MissingMethodParameters)
+ listener: handleRecoverableError(MissingMethodParameters, Stream, Stream)
+ rewriter()
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(0, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ ensureBlock(), Instance of 'Template<(Token) => Message>', null)
+ reportRecoverableError(baz, Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}])
+ listener: handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}], baz, baz)
+ insertBlock())
+ rewriter()
+ rewriter()
+ listener: handleInvalidFunctionBody({)
+ listener: endClassMethod(null, Stream, (, null, })
+ listener: endMember()
+ notEofOrValue(}, baz)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, C)
+ parseMetadataStar(})
+ listener: beginMetadataStar(baz)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ isReservedKeyword(;)
+ parseFields(}, null, null, null, null, null, null, }, Instance of 'NoType', baz, DeclarationKind.Class, C, false)
+ listener: beginFields(})
+ reportRecoverableError(baz, MissingConstFinalVarOrType)
+ listener: handleRecoverableError(MissingConstFinalVarOrType, baz, baz)
+ listener: handleNoType(})
+ ensureIdentifierPotentiallyRecovered(}, fieldDeclaration, false)
+ listener: handleIdentifier(baz, fieldDeclaration)
+ parseFieldInitializerOpt(baz, baz, null, null, null, null, DeclarationKind.Class, C)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, baz, ;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 3, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration(Stream)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(Stream)
+ parseTopLevelMethod(}, null, }, Instance of 'ComplexTypeInfo', null, Stream, false)
+ listener: beginTopLevelMethod(}, null)
+ ensureIdentifier(}, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(Stream, topLevelFunctionDeclaration)
+ parseMethodTypeVar(Stream)
+ listener: beginTypeVariables(<)
+ parseMetadataStar(<)
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: handleIdentifier(List, typeVariableDeclaration)
+ listener: beginTypeVariable(List)
+ listener: handleTypeVariablesDefined(List, 1)
+ listener: handleNoType(List)
+ listener: endTypeVariable(<, 0, null, null)
+ reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}], List, List)
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ reportRecoverableError(Set, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ reportRecoverableError(List, Message[ExpectedAfterButGot, Expected '>' after this., null, {string: >}])
+ parseMetadataStar(<)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: endTypeVariables(<, >)
+ parseGetterOrFormalParameters(>, Stream, false, MemberKind.TopLevelMethod)
+ missingParameterMessage(MemberKind.TopLevelMethod)
+ reportRecoverableError(Stream, MissingFunctionParameters)
+ listener: handleRecoverableError(MissingFunctionParameters, Stream, Stream)
+ rewriter()
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ ensureBlock(), Instance of 'Template<(Token) => Message>', null)
+ reportRecoverableError(baz, Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}])
+ listener: handleRecoverableError(Message[ExpectedFunctionBody, Expected a function body, but got 'baz'., null, {lexeme: baz}], baz, baz)
+ insertBlock())
+ rewriter()
+ rewriter()
+ listener: handleInvalidFunctionBody({)
+ listener: endTopLevelMethod(Stream, null, })
+ listener: endTopLevelDeclaration(baz)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(baz)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(baz)
+ isReservedKeyword(;)
+ parseFields(}, null, null, null, null, null, null, }, Instance of 'NoType', baz, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(})
+ reportRecoverableError(baz, MissingConstFinalVarOrType)
+ listener: handleRecoverableError(MissingConstFinalVarOrType, baz, baz)
+ listener: handleNoType(})
+ ensureIdentifierPotentiallyRecovered(}, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(baz, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(baz, baz, null, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, null, null, 1, baz, ;)
+ listener: endTopLevelDeclaration(Stream)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(Stream)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(Stream)
+ insertSyntheticIdentifier(>, methodDeclaration, message: null, messageOnToken: null)
+ reportRecoverableError(, Message[ExpectedIdentifier, Expected an identifier, but got ''., Try inserting an identifier before ''., {lexeme: }])
+ listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ''., Try inserting an identifier before ''., {lexeme: }], , )
+ listener: // WARNING: Reporting at eof for .
+ rewriter()
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'ComplexTypeInfo', , DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ ensureIdentifier(;, typeReference)
+ listener: handleIdentifier(Stream, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(Set, typeReference)
+ listener: beginTypeArguments(<)
+ ensureIdentifier(<, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>>'., null, {lexeme: >>>}], >>>, >>>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Set, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(Stream, null)
+ ensureIdentifierPotentiallyRecovered(>, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(, , null, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer()
+ ensureSemicolon()
+ reportRecoverableError(, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
+ listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], , )
+ listener: // WARNING: Reporting at eof for .
+ rewriter()
+ listener: endTopLevelFields(null, null, null, null, null, 1, Stream, ;)
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(class)
+ listener: endCompilationUnit(6, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.parser.expect
new file mode 100644
index 0000000..6196a14
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.parser.expect
@@ -0,0 +1,69 @@
+NOTICE: Stream was rewritten by parser!
+
+class A {
+
+
+Stream<List<Set<List< *synthetic*>>>>
+*synthetic*;}
+
+class B {
+Stream<List<Set<List<String>>>> foo;
+
+
+Stream<List<Set<List< *synthetic*>>>>
+*synthetic*;}
+
+class C {
+Stream<List<Set<List<String>>>> foo;
+
+
+
+Stream<List<Set<List< *synthetic*>>>>
+Stream<List<Set<List<String>>>> (){}baz;
+}
+
+
+
+
+Stream<List<Set<List< *synthetic*>>>>
+Stream<List<Set<List<String>>>> (){}baz;
+
+
+
+
+Stream<List<Set<List< *synthetic*>>>>
+*synthetic*;
+
+class[KeywordToken] A[StringToken] {[BeginToken]
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] [SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+
+class[KeywordToken] B[StringToken] {[BeginToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken] foo[StringToken];[SimpleToken]
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] [SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
+[SyntheticStringToken];[SyntheticToken]}[SimpleToken]
+
+class[KeywordToken] C[StringToken] {[BeginToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken] foo[StringToken];[SimpleToken]
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] [SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken] ([SyntheticBeginToken])[SyntheticToken]{[SyntheticBeginToken]}[SyntheticToken]baz[StringToken];[SimpleToken]
+}[SimpleToken]
+
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] [SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken] ([SyntheticBeginToken])[SyntheticToken]{[SyntheticBeginToken]}[SyntheticToken]baz[StringToken];[SimpleToken]
+
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] [SyntheticStringToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]>[SimpleToken]
+[SyntheticStringToken];[SyntheticToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.scanner.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.scanner.expect
new file mode 100644
index 0000000..3081371
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_5.crash_dart.scanner.expect
@@ -0,0 +1,67 @@
+class A {
+
+
+Stream<List<Set<List< >>>>
+}
+
+class B {
+Stream<List<Set<List<String>>>> foo;
+
+
+Stream<List<Set<List< >>>>
+}
+
+class C {
+Stream<List<Set<List<String>>>> foo;
+
+
+
+Stream<List<Set<List< >>>>
+Stream<List<Set<List<String>>>> baz;
+}
+
+
+
+
+Stream<List<Set<List< >>>>
+Stream<List<Set<List<String>>>> baz;
+
+
+
+
+Stream<List<Set<List< >>>>
+
+
+class[KeywordToken] A[StringToken] {[BeginToken]
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] >>>[SimpleToken]>[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] B[StringToken] {[BeginToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>>>[SimpleToken]>[SimpleToken] foo[StringToken];[SimpleToken]
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] >>>[SimpleToken]>[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] C[StringToken] {[BeginToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>>>[SimpleToken]>[SimpleToken] foo[StringToken];[SimpleToken]
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] >>>[SimpleToken]>[SimpleToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>>>[SimpleToken]>[SimpleToken] baz[StringToken];[SimpleToken]
+}[SimpleToken]
+
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] >>>[SimpleToken]>[SimpleToken]
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken]String[StringToken]>>>[SimpleToken]>[SimpleToken] baz[StringToken];[SimpleToken]
+
+
+
+
+Stream[StringToken]<[BeginToken]List[StringToken]<[BeginToken]Set[StringToken]<[BeginToken]List[StringToken]<[BeginToken] >>>[SimpleToken]>[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart
new file mode 100644
index 0000000..b8fbaec
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart
@@ -0,0 +1,6 @@
+class A {
+ // These are names and no return types...
+ stream<T extends List<T>>(T foo) {}
+ stream2<T extends List<>>(T foo) {}
+ stream3<T>(T foo) {}
+}
\ No newline at end of file
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.expect
new file mode 100644
index 0000000..0c00214
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.expect
@@ -0,0 +1,132 @@
+Problems reported:
+
+parser/error_recovery/issue_46505_prime_6.crash:4:26: Expected a type, but got '>>'.
+ stream2<T extends List<>>(T foo) {}
+ ^^
+
+beginCompilationUnit(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(A, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, A)
+ handleNoType(A)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(stream)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, stream)
+ handleNoType({)
+ handleIdentifier(stream, methodDeclaration)
+ beginTypeVariables(<)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ handleIdentifier(T, typeVariableDeclaration)
+ beginTypeVariable(T)
+ handleTypeVariablesDefined(>, 1)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(T, typeReference)
+ handleNoTypeArguments(>)
+ handleType(T, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeVariable(>, 0, extends, null)
+ endTypeVariables(<, >)
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(T, typeReference)
+ handleNoTypeArguments(foo)
+ handleType(T, null)
+ handleIdentifier(foo, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ endBlockFunctionBody(0, {, })
+ endClassMethod(null, stream, (, null, })
+ endMember()
+ beginMetadataStar(stream2)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, stream2)
+ handleNoType(})
+ handleIdentifier(stream2, methodDeclaration)
+ beginTypeVariables(<)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ handleIdentifier(T, typeVariableDeclaration)
+ beginTypeVariable(T)
+ handleTypeVariablesDefined(>, 1)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>'., null, {lexeme: >>}], >>, >>)
+ handleIdentifier(, typeReference)
+ handleNoTypeArguments(>>)
+ handleType(, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ endTypeVariable(>, 0, extends, null)
+ endTypeVariables(<, >)
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(T, typeReference)
+ handleNoTypeArguments(foo)
+ handleType(T, null)
+ handleIdentifier(foo, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ endBlockFunctionBody(0, {, })
+ endClassMethod(null, stream2, (, null, })
+ endMember()
+ beginMetadataStar(stream3)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, stream3)
+ handleNoType(})
+ handleIdentifier(stream3, methodDeclaration)
+ beginTypeVariables(<)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ handleIdentifier(T, typeVariableDeclaration)
+ beginTypeVariable(T)
+ handleTypeVariablesDefined(T, 1)
+ handleNoType(T)
+ endTypeVariable(>, 0, null, null)
+ endTypeVariables(<, >)
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(T)
+ endMetadataStar(0)
+ beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(T, typeReference)
+ handleNoTypeArguments(foo)
+ handleType(T, null)
+ handleIdentifier(foo, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ endBlockFunctionBody(0, {, })
+ endClassMethod(null, stream3, (, null, })
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 3, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration()
+endCompilationUnit(1, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.intertwined.expect
new file mode 100644
index 0000000..01b18e1
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.intertwined.expect
@@ -0,0 +1,210 @@
+parseUnit(class)
+ skipErrorTokens(class)
+ listener: beginCompilationUnit(class)
+ syntheticPreviousToken(class)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(A, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, A)
+ parseClass(A, class, class, A)
+ parseClassHeaderOpt(A, class, class)
+ parseClassExtendsOpt(A)
+ listener: handleNoType(A)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(A)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(A)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, stream)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, A)
+ parseMetadataStar({)
+ listener: beginMetadataStar(stream)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ isReservedKeyword(<)
+ parseMethod({, null, null, null, null, null, null, {, Instance of 'NoType', null, stream, DeclarationKind.Class, A, false)
+ listener: beginMethod(null, null, null, null, null, stream)
+ listener: handleNoType({)
+ ensureIdentifierPotentiallyRecovered({, methodDeclaration, false)
+ listener: handleIdentifier(stream, methodDeclaration)
+ parseQualifiedRestOpt(stream, methodDeclarationContinuation)
+ parseMethodTypeVar(stream)
+ listener: beginTypeVariables(<)
+ parseMetadataStar(<)
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: handleIdentifier(T, typeVariableDeclaration)
+ listener: beginTypeVariable(T)
+ listener: handleTypeVariablesDefined(>, 1)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(T, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(T, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeVariable(>, 0, extends, null)
+ listener: endTypeVariables(<, >)
+ parseGetterOrFormalParameters(>, stream, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(T, typeReference)
+ listener: handleNoTypeArguments(foo)
+ listener: handleType(T, null)
+ ensureIdentifier(T, formalParameterDeclaration)
+ listener: handleIdentifier(foo, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(0, {, })
+ listener: endClassMethod(null, stream, (, null, })
+ listener: endMember()
+ notEofOrValue(}, stream2)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, A)
+ parseMetadataStar(})
+ listener: beginMetadataStar(stream2)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ isReservedKeyword(<)
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'NoType', null, stream2, DeclarationKind.Class, A, false)
+ listener: beginMethod(null, null, null, null, null, stream2)
+ listener: handleNoType(})
+ ensureIdentifierPotentiallyRecovered(}, methodDeclaration, false)
+ listener: handleIdentifier(stream2, methodDeclaration)
+ parseQualifiedRestOpt(stream2, methodDeclarationContinuation)
+ parseMethodTypeVar(stream2)
+ listener: beginTypeVariables(<)
+ parseMetadataStar(<)
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ ensureIdentifier(<, typeVariableDeclaration)
+ listener: handleIdentifier(T, typeVariableDeclaration)
+ listener: beginTypeVariable(T)
+ listener: handleTypeVariablesDefined(>, 1)
+ ensureIdentifier(extends, typeReference)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ reportRecoverableErrorWithToken(>>, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedType, Expected a type, but got '>>'., null, {lexeme: >>}], >>, >>)
+ rewriter()
+ listener: handleIdentifier(, typeReference)
+ listener: handleNoTypeArguments(>>)
+ listener: handleType(, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: endTypeVariable(>, 0, extends, null)
+ listener: endTypeVariables(<, >)
+ parseGetterOrFormalParameters(>, stream2, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(T, typeReference)
+ listener: handleNoTypeArguments(foo)
+ listener: handleType(T, null)
+ ensureIdentifier(T, formalParameterDeclaration)
+ listener: handleIdentifier(foo, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(0, {, })
+ listener: endClassMethod(null, stream2, (, null, })
+ listener: endMember()
+ notEofOrValue(}, stream3)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, A)
+ parseMetadataStar(})
+ listener: beginMetadataStar(stream3)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ isReservedKeyword(<)
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'NoType', null, stream3, DeclarationKind.Class, A, false)
+ listener: beginMethod(null, null, null, null, null, stream3)
+ listener: handleNoType(})
+ ensureIdentifierPotentiallyRecovered(}, methodDeclaration, false)
+ listener: handleIdentifier(stream3, methodDeclaration)
+ parseQualifiedRestOpt(stream3, methodDeclarationContinuation)
+ parseMethodTypeVar(stream3)
+ listener: beginTypeVariables(<)
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(T, typeVariableDeclaration)
+ listener: beginTypeVariable(T)
+ listener: handleTypeVariablesDefined(T, 1)
+ listener: handleNoType(T)
+ listener: endTypeVariable(>, 0, null, null)
+ listener: endTypeVariables(<, >)
+ parseGetterOrFormalParameters(>, stream3, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(T)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(T, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(T, typeReference)
+ listener: handleNoTypeArguments(foo)
+ listener: handleType(T, null)
+ ensureIdentifier(T, formalParameterDeclaration)
+ listener: handleIdentifier(foo, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, foo, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(0, {, })
+ listener: endClassMethod(null, stream3, (, null, })
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 3, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(class)
+ listener: endCompilationUnit(1, )
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.parser.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.parser.expect
new file mode 100644
index 0000000..4c1110d
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.parser.expect
@@ -0,0 +1,15 @@
+NOTICE: Stream was rewritten by parser!
+
+class A {
+
+stream<T extends List<T>>(T foo) {}
+stream2<T extends List<*synthetic*>>(T foo) {}
+stream3<T>(T foo) {}
+}
+
+class[KeywordToken] A[StringToken] {[BeginToken]
+
+stream[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] List[StringToken]<[BeginToken]T[StringToken]>[SimpleToken]>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+stream2[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] List[StringToken]<[BeginToken][SyntheticStringToken]>[SimpleToken]>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+stream3[StringToken]<[BeginToken]T[StringToken]>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.scanner.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.scanner.expect
new file mode 100644
index 0000000..737ebfe
--- /dev/null
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_6.crash_dart.scanner.expect
@@ -0,0 +1,13 @@
+class A {
+
+stream<T extends List<T>>(T foo) {}
+stream2<T extends List<>>(T foo) {}
+stream3<T>(T foo) {}
+}
+
+class[KeywordToken] A[StringToken] {[BeginToken]
+
+stream[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] List[StringToken]<[BeginToken]T[StringToken]>>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+stream2[StringToken]<[BeginToken]T[StringToken] extends[KeywordToken] List[StringToken]<[BeginToken]>>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+stream3[StringToken]<[BeginToken]T[StringToken]>[SimpleToken]([BeginToken]T[StringToken] foo[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/general/operator_01.dart b/pkg/front_end/parser_testcases/general/operator_01.dart
new file mode 100644
index 0000000..e9b9db48
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart
@@ -0,0 +1,21 @@
+class Foo {
+ bool operator <(int x) {
+ return true;
+ }
+
+ int operator <<(int x) {
+ return 42;
+ }
+
+ bool operator >(int x) {
+ return true;
+ }
+
+ int operator >>(int x) {
+ return 42;
+ }
+
+ int operator >>>(int x) {
+ return 42;
+ }
+}
diff --git a/pkg/front_end/parser_testcases/general/operator_01.dart.expect b/pkg/front_end/parser_testcases/general/operator_01.dart.expect
new file mode 100644
index 0000000..88fbc2c
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart.expect
@@ -0,0 +1,162 @@
+beginCompilationUnit(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(Foo, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, Foo)
+ handleNoType(Foo)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(bool)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, operator)
+ handleIdentifier(bool, typeReference)
+ handleNoTypeArguments(operator)
+ handleType(bool, null)
+ handleOperatorName(operator, <)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x)
+ handleType(int, null)
+ handleIdentifier(x, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginReturnStatement(return)
+ handleLiteralBool(true)
+ endReturnStatement(true, return, ;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, bool, (, null, })
+ endMember()
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, operator)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(operator)
+ handleType(int, null)
+ handleOperatorName(operator, <<)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x)
+ handleType(int, null)
+ handleIdentifier(x, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginReturnStatement(return)
+ handleLiteralInt(42)
+ endReturnStatement(true, return, ;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, int, (, null, })
+ endMember()
+ beginMetadataStar(bool)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, operator)
+ handleIdentifier(bool, typeReference)
+ handleNoTypeArguments(operator)
+ handleType(bool, null)
+ handleOperatorName(operator, >)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x)
+ handleType(int, null)
+ handleIdentifier(x, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginReturnStatement(return)
+ handleLiteralBool(true)
+ endReturnStatement(true, return, ;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, bool, (, null, })
+ endMember()
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, operator)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(operator)
+ handleType(int, null)
+ handleOperatorName(operator, >>)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x)
+ handleType(int, null)
+ handleIdentifier(x, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginReturnStatement(return)
+ handleLiteralInt(42)
+ endReturnStatement(true, return, ;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, int, (, null, })
+ endMember()
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, operator)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(operator)
+ handleType(int, null)
+ handleOperatorName(operator, >>>)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x)
+ handleType(int, null)
+ handleIdentifier(x, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginReturnStatement(return)
+ handleLiteralInt(42)
+ endReturnStatement(true, return, ;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, int, (, null, })
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 5, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration()
+endCompilationUnit(1, )
diff --git a/pkg/front_end/parser_testcases/general/operator_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/operator_01.dart.intertwined.expect
new file mode 100644
index 0000000..d90a492
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart.intertwined.expect
@@ -0,0 +1,324 @@
+parseUnit(class)
+ skipErrorTokens(class)
+ listener: beginCompilationUnit(class)
+ syntheticPreviousToken(class)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(Foo, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, Foo)
+ parseClass(Foo, class, class, Foo)
+ parseClassHeaderOpt(Foo, class, class)
+ parseClassExtendsOpt(Foo)
+ listener: handleNoType(Foo)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(Foo)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(Foo)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, bool)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, Foo)
+ parseMetadataStar({)
+ listener: beginMetadataStar(bool)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod({, null, null, null, null, null, null, {, Instance of 'SimpleType', null, operator, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, operator)
+ listener: handleIdentifier(bool, typeReference)
+ listener: handleNoTypeArguments(operator)
+ listener: handleType(bool, null)
+ parseOperatorName(bool)
+ listener: handleOperatorName(operator, <)
+ parseMethodTypeVar(<)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(<, operator, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(<, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, return)
+ parseStatement({)
+ parseStatementX({)
+ parseReturnStatement({)
+ listener: beginReturnStatement(return)
+ parseExpression(return)
+ parsePrecedenceExpression(return, 1, true)
+ parseUnaryExpression(return, true)
+ parsePrimary(return, expression)
+ parseLiteralBool(return)
+ listener: handleLiteralBool(true)
+ ensureSemicolon(true)
+ listener: endReturnStatement(true, return, ;)
+ inGenerator()
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, bool, (, null, })
+ listener: endMember()
+ notEofOrValue(}, int)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, Foo)
+ parseMetadataStar(})
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'SimpleType', null, operator, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, operator)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(operator)
+ listener: handleType(int, null)
+ parseOperatorName(int)
+ listener: handleOperatorName(operator, <<)
+ parseMethodTypeVar(<<)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(<<, operator, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(<<, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, return)
+ parseStatement({)
+ parseStatementX({)
+ parseReturnStatement({)
+ listener: beginReturnStatement(return)
+ parseExpression(return)
+ parsePrecedenceExpression(return, 1, true)
+ parseUnaryExpression(return, true)
+ parsePrimary(return, expression)
+ parseLiteralInt(return)
+ listener: handleLiteralInt(42)
+ ensureSemicolon(42)
+ listener: endReturnStatement(true, return, ;)
+ inGenerator()
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, int, (, null, })
+ listener: endMember()
+ notEofOrValue(}, bool)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, Foo)
+ parseMetadataStar(})
+ listener: beginMetadataStar(bool)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'SimpleType', null, operator, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, operator)
+ listener: handleIdentifier(bool, typeReference)
+ listener: handleNoTypeArguments(operator)
+ listener: handleType(bool, null)
+ parseOperatorName(bool)
+ listener: handleOperatorName(operator, >)
+ parseMethodTypeVar(>)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(>, operator, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, return)
+ parseStatement({)
+ parseStatementX({)
+ parseReturnStatement({)
+ listener: beginReturnStatement(return)
+ parseExpression(return)
+ parsePrecedenceExpression(return, 1, true)
+ parseUnaryExpression(return, true)
+ parsePrimary(return, expression)
+ parseLiteralBool(return)
+ listener: handleLiteralBool(true)
+ ensureSemicolon(true)
+ listener: endReturnStatement(true, return, ;)
+ inGenerator()
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, bool, (, null, })
+ listener: endMember()
+ notEofOrValue(}, int)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, Foo)
+ parseMetadataStar(})
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'SimpleType', null, operator, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, operator)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(operator)
+ listener: handleType(int, null)
+ parseOperatorName(int)
+ listener: handleOperatorName(operator, >>)
+ parseMethodTypeVar(>>)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(>>, operator, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, return)
+ parseStatement({)
+ parseStatementX({)
+ parseReturnStatement({)
+ listener: beginReturnStatement(return)
+ parseExpression(return)
+ parsePrecedenceExpression(return, 1, true)
+ parseUnaryExpression(return, true)
+ parsePrimary(return, expression)
+ parseLiteralInt(return)
+ listener: handleLiteralInt(42)
+ ensureSemicolon(42)
+ listener: endReturnStatement(true, return, ;)
+ inGenerator()
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, int, (, null, })
+ listener: endMember()
+ notEofOrValue(}, int)
+ parseClassOrMixinOrExtensionMemberImpl(}, DeclarationKind.Class, Foo)
+ parseMetadataStar(})
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod(}, null, null, null, null, null, null, }, Instance of 'SimpleType', null, operator, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, operator)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(operator)
+ listener: handleType(int, null)
+ parseOperatorName(int)
+ listener: handleOperatorName(operator, >>>)
+ parseMethodTypeVar(>>>)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(>>>, operator, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(>>>, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(int, MemberKind.NonStaticMethod, null, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, x, null, null, FormalParameterKind.mandatory, MemberKind.NonStaticMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, return)
+ parseStatement({)
+ parseStatementX({)
+ parseReturnStatement({)
+ listener: beginReturnStatement(return)
+ parseExpression(return)
+ parsePrecedenceExpression(return, 1, true)
+ parseUnaryExpression(return, true)
+ parsePrimary(return, expression)
+ parseLiteralInt(return)
+ listener: handleLiteralInt(42)
+ ensureSemicolon(42)
+ listener: endReturnStatement(true, return, ;)
+ inGenerator()
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, int, (, null, })
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 5, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(class)
+ listener: endCompilationUnit(1, )
diff --git a/pkg/front_end/parser_testcases/general/operator_01.dart.parser.expect b/pkg/front_end/parser_testcases/general/operator_01.dart.parser.expect
new file mode 100644
index 0000000..6f599e9
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart.parser.expect
@@ -0,0 +1,45 @@
+class Foo {
+bool operator <(int x) {
+return true;
+}
+
+int operator <<(int x) {
+return 42;
+}
+
+bool operator >(int x) {
+return true;
+}
+
+int operator >>(int x) {
+return 42;
+}
+
+int operator >>>(int x) {
+return 42;
+}
+}
+
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+bool[StringToken] operator[KeywordToken] <[BeginToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] true[KeywordToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] <<[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+
+bool[StringToken] operator[KeywordToken] >[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] true[KeywordToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] >>[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] >>>[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/parser_testcases/general/operator_01.dart.scanner.expect b/pkg/front_end/parser_testcases/general/operator_01.dart.scanner.expect
new file mode 100644
index 0000000..6f599e9
--- /dev/null
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart.scanner.expect
@@ -0,0 +1,45 @@
+class Foo {
+bool operator <(int x) {
+return true;
+}
+
+int operator <<(int x) {
+return 42;
+}
+
+bool operator >(int x) {
+return true;
+}
+
+int operator >>(int x) {
+return 42;
+}
+
+int operator >>>(int x) {
+return 42;
+}
+}
+
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+bool[StringToken] operator[KeywordToken] <[BeginToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] true[KeywordToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] <<[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+
+bool[StringToken] operator[KeywordToken] >[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] true[KeywordToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] >>[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+
+int[StringToken] operator[KeywordToken] >>>[SimpleToken]([BeginToken]int[StringToken] x[StringToken])[SimpleToken] {[BeginToken]
+return[KeywordToken] 42[StringToken];[SimpleToken]
+}[SimpleToken]
+}[SimpleToken]
+[SimpleToken]
diff --git a/pkg/front_end/test/fasta/parser/type_info_test.dart b/pkg/front_end/test/fasta/parser/type_info_test.dart
index a14f5e0..ce747ba 100644
--- a/pkg/front_end/test/fasta/parser/type_info_test.dart
+++ b/pkg/front_end/test/fasta/parser/type_info_test.dart
@@ -67,6 +67,7 @@
expectInfo(noType, 'C*', required: false);
expectInfo(noType, 'C do', required: false);
+ expectInfo(noType, 'C.a', required: false);
expectInfo(noType, 'C.a;', required: false);
expectInfo(noType, 'C.a(', required: false);
expectInfo(noType, 'C.a<', required: false);
@@ -74,6 +75,7 @@
expectInfo(noType, 'C.a*', required: false);
expectInfo(noType, 'C.a do', required: false);
+ expectInfo(noType, 'C<T>', required: false);
expectInfo(noType, 'C<T>;', required: false);
expectInfo(noType, 'C<T>(', required: false);
expectInfo(noType, 'C<T> do', required: false);
@@ -96,6 +98,7 @@
expectInfo(noType, 'C<T>>= operator', required: false);
expectInfo(noType, 'C<T>>= Function', required: false);
+ expectInfo(noType, 'C.a<T>', required: false);
expectInfo(noType, 'C<S,T>=', required: false);
expectInfo(noType, 'C<S<T>>=', required: false);
expectInfo(noType, 'C.a<T>=', required: false);
@@ -231,7 +234,7 @@
@reflectiveTest
class PrefixedTypeInfoTest {
void test_compute() {
- expectInfo(prefixedType, 'C.a', required: null /* i.e. both */);
+ expectInfo(prefixedType, 'C.a', required: true);
expectInfo(prefixedType, 'C.a;', required: true);
expectInfo(prefixedType, 'C.a(', required: true);
expectInfo(prefixedType, 'C.a<', required: true);
@@ -462,7 +465,7 @@
@reflectiveTest
class SimpleTypeWith1ArgumentTest {
void test_compute_gt() {
- expectInfo(simpleTypeWith1Argument, 'C<T>', required: null /* i.e. both */);
+ expectInfo(simpleTypeWith1Argument, 'C<T>', required: true);
expectInfo(simpleTypeWith1Argument, 'C<T>;', required: true);
expectInfo(simpleTypeWith1Argument, 'C<T>(', required: true);
expectInfo(simpleTypeWith1Argument, 'C<T> do', required: true);
@@ -1340,7 +1343,7 @@
}
void test_computeType_prefixedTypeArg() {
- expectComplexInfo('C.a<T>', required: null /* i.e. both */, expectedCalls: [
+ expectComplexInfo('C.a<T>', required: true, expectedCalls: [
'handleIdentifier C prefixedTypeReference',
'handleIdentifier a typeReferenceContinuation',
'handleQualified .',
diff --git a/pkg/front_end/testcases/rasta/issue_000032.dart.textual_outline.expect b/pkg/front_end/testcases/rasta/issue_000032.dart.textual_outline.expect
index b75908e..8be752c 100644
--- a/pkg/front_end/testcases/rasta/issue_000032.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/rasta/issue_000032.dart.textual_outline.expect
@@ -1,5 +1,5 @@
// @dart = 2.9
class C {
- C< >(){}
+ C< >;
}
main() {}
diff --git a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.expect b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.expect
index 761d1fa..4346a6e 100644
--- a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.expect
+++ b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.expect
@@ -2,22 +2,16 @@
//
// Problems in library:
//
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected a type, but got '}'.
+// }
+// ^
+//
// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected an identifier, but got '}'.
// Try inserting an identifier before '}'.
// }
// ^
//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:4: Error: Constructors can't have type parameters.
-// Try removing the type parameters.
-// C<
-// ^^...
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:3: Error: A method declaration needs an explicit list of parameters.
-// Try adding a parameter list to the method declaration.
-// C<
-// ^
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected '{' before this.
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected ';' after this.
// }
// ^
//
@@ -40,8 +34,9 @@
import "dart:core" as core;
class C extends core::Object {
- constructor •() → self::C*
- : super core::Object::•() {}
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
diff --git a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.outline.expect b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.outline.expect
index d9fcdaf..242ea34 100644
--- a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.outline.expect
@@ -2,22 +2,16 @@
//
// Problems in library:
//
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected a type, but got '}'.
+// }
+// ^
+//
// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected an identifier, but got '}'.
// Try inserting an identifier before '}'.
// }
// ^
//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:4: Error: Constructors can't have type parameters.
-// Try removing the type parameters.
-// C<
-// ^^...
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:3: Error: A method declaration needs an explicit list of parameters.
-// Try adding a parameter list to the method declaration.
-// C<
-// ^
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected '{' before this.
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected ';' after this.
// }
// ^
//
@@ -25,7 +19,7 @@
import "dart:core" as core;
class C extends core::Object {
- constructor •() → self::C*
+ synthetic constructor •() → self::C*
;
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
diff --git a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.transformed.expect b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.transformed.expect
index 761d1fa..4346a6e 100644
--- a/pkg/front_end/testcases/rasta/issue_000032.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/rasta/issue_000032.dart.weak.transformed.expect
@@ -2,22 +2,16 @@
//
// Problems in library:
//
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected a type, but got '}'.
+// }
+// ^
+//
// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected an identifier, but got '}'.
// Try inserting an identifier before '}'.
// }
// ^
//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:4: Error: Constructors can't have type parameters.
-// Try removing the type parameters.
-// C<
-// ^^...
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:6:3: Error: A method declaration needs an explicit list of parameters.
-// Try adding a parameter list to the method declaration.
-// C<
-// ^
-//
-// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected '{' before this.
+// pkg/front_end/testcases/rasta/issue_000032.dart:7:1: Error: Expected ';' after this.
// }
// ^
//
@@ -40,8 +34,9 @@
import "dart:core" as core;
class C extends core::Object {
- constructor •() → self::C*
- : super core::Object::•() {}
+ synthetic constructor •() → self::C*
+ : super core::Object::•()
+ ;
abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
diff --git a/tools/VERSION b/tools/VERSION
index 29d3552..6975322 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 15
PATCH 0
-PRERELEASE 31
+PRERELEASE 32
PRERELEASE_PATCH 0
\ No newline at end of file