| Index: pkg/analyzer/lib/src/generated/parser.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
|
| index b8906c16e1f79006bf0d42ab493c05c7b2f21409..0ff0c33660353d916d766e22e642c781b634a203 100644
|
| --- a/pkg/analyzer/lib/src/generated/parser.dart
|
| +++ b/pkg/analyzer/lib/src/generated/parser.dart
|
| @@ -249,12 +249,6 @@ class Parser {
|
| bool _inInitializer = false;
|
|
|
| /**
|
| - * A flag indicating whether the parser is to parse generic function type
|
| - * syntax.
|
| - */
|
| - bool parseGenericFunctionTypes = false;
|
| -
|
| - /**
|
| * A flag indicating whether the parser is to parse generic method syntax.
|
| */
|
| @deprecated
|
| @@ -5057,24 +5051,21 @@ class Parser {
|
| * | functionType
|
| */
|
| TypeAnnotation parseTypeAnnotation(bool inExpression) {
|
| - if (parseGenericFunctionTypes) {
|
| - TypeAnnotation type = null;
|
| - if (_atGenericFunctionTypeAfterReturnType(_currentToken)) {
|
| - // Generic function type with no return type.
|
| - type = parseGenericFunctionTypeAfterReturnType(null);
|
| - } else if (_currentToken.keyword == Keyword.VOID &&
|
| - _atGenericFunctionTypeAfterReturnType(_currentToken.next)) {
|
| - type = astFactory.typeName(
|
| - astFactory.simpleIdentifier(getAndAdvance()), null);
|
| - } else {
|
| - type = parseTypeName(inExpression);
|
| - }
|
| - while (_atGenericFunctionTypeAfterReturnType(_currentToken)) {
|
| - type = parseGenericFunctionTypeAfterReturnType(type);
|
| - }
|
| - return type;
|
| + TypeAnnotation type = null;
|
| + if (_atGenericFunctionTypeAfterReturnType(_currentToken)) {
|
| + // Generic function type with no return type.
|
| + type = parseGenericFunctionTypeAfterReturnType(null);
|
| + } else if (_currentToken.keyword == Keyword.VOID &&
|
| + _atGenericFunctionTypeAfterReturnType(_currentToken.next)) {
|
| + type = astFactory.typeName(
|
| + astFactory.simpleIdentifier(getAndAdvance()), null);
|
| + } else {
|
| + type = parseTypeName(inExpression);
|
| + }
|
| + while (_atGenericFunctionTypeAfterReturnType(_currentToken)) {
|
| + type = parseGenericFunctionTypeAfterReturnType(type);
|
| }
|
| - return parseTypeName(inExpression);
|
| + return type;
|
| }
|
|
|
| /**
|
| @@ -5535,22 +5526,19 @@ class Parser {
|
| * This method must be kept in sync with [parseTypeAnnotation].
|
| */
|
| Token skipTypeAnnotation(Token startToken) {
|
| - if (parseGenericFunctionTypes) {
|
| - Token next = null;
|
| - if (_atGenericFunctionTypeAfterReturnType(startToken)) {
|
| - next = skipGenericFunctionTypeAfterReturnType(startToken);
|
| - } else if (_currentToken.keyword == Keyword.VOID &&
|
| - _atGenericFunctionTypeAfterReturnType(_currentToken.next)) {
|
| - next = next.next;
|
| - } else {
|
| - next = skipTypeName(startToken);
|
| - }
|
| - while (next != null && _tokenMatchesString(next, 'Function')) {
|
| - next = skipGenericFunctionTypeAfterReturnType(next);
|
| - }
|
| - return next;
|
| + Token next = null;
|
| + if (_atGenericFunctionTypeAfterReturnType(startToken)) {
|
| + next = skipGenericFunctionTypeAfterReturnType(startToken);
|
| + } else if (_currentToken.keyword == Keyword.VOID &&
|
| + _atGenericFunctionTypeAfterReturnType(_currentToken.next)) {
|
| + next = next.next;
|
| + } else {
|
| + next = skipTypeName(startToken);
|
| }
|
| - return skipTypeName(startToken);
|
| + while (next != null && _atGenericFunctionTypeAfterReturnType(next)) {
|
| + next = skipGenericFunctionTypeAfterReturnType(next);
|
| + }
|
| + return next;
|
| }
|
|
|
| /**
|
|
|